• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * 文 件 名   : hmac_uapsd.h
15  * 生成日期   : 2013年9月18日
16  * 功能描述   : hmac_uapsd.c 的头文件
17  */
18 
19 #ifndef __HMAC_UAPSD_H__
20 #define __HMAC_UAPSD_H__
21 
22 /*****************************************************************************
23   1 其他头文件包含
24 *****************************************************************************/
25 #include "hmac_vap.h"
26 
27 #ifdef __cplusplus
28 #if __cplusplus
29 extern "C" {
30 #endif
31 #endif
32 
33 #undef  THIS_FILE_ID
34 #define THIS_FILE_ID OAM_FILE_ID_HMAC_UAPSD_H
35 
36 /*****************************************************************************
37   2 宏定义
38 *****************************************************************************/
39 #define HMAC_UAPSD_SEND_ALL  0xff       /* 发送队列中所有报文,设置为UINT8变量最大值 */
40 #define HMAC_UAPSD_WME_LEN   8
41 
42 #define HMAC_UAPSD_NOT_SEND_FRAME   (-1)
43 #define HMAC_UAPSD_QDEPTH_DEFAULT   32
44 
45 #define HMAC_USR_UAPSD_EN 0x01   // U-APSD使能
46 #define HMAC_USR_UAPSD_TRIG 0x02 // U-APSD可以被trigger
47 #define HMAC_USR_UAPSD_SP 0x04   // u-APSD在一个Service Period处理中
48 
49 #define HMAC_UAPSD_INVALID_TRIGGER_SEQ 0xffff
50 
51 #define HMAC_UAPSD_IDLE_INT 1000 // esop trigger处理最大时长
52 
53 typedef struct {
54     osal_spinlock lock_uapsd;            /* uapsd操作所 */
55     oal_netbuf_head_stru uapsd_queue_head;    /* uapsd节能队列头 */
56     osal_atomic mpdu_num;                      /* 当前节能队列里的mpdu个数 */
57     osal_u16 uapsd_trigseq[WLAN_WME_AC_BUTT];   /* 最近一个trigger帧的sequence */
58 } hmac_user_uapsd_stru;
59 
60 typedef struct {
61     osal_u8  qos_info;                            /* 关联请求中的WMM IE的QOS info field */
62     osal_u8  max_sp_len;                          /* 从qos info字段中提取翻译的最大服务长度 */
63     osal_u8  auc_resv[2];
64     osal_u8  ac_trigger_ena[WLAN_WME_AC_BUTT];    /* 4个AC的trigger能力 */
65     osal_u8  ac_delievy_ena[WLAN_WME_AC_BUTT];    /* 4个AC的delivery能力 */
66     osal_u32 last_esop_tsf;
67 } mac_user_uapsd_status_stru;
68 
69 typedef struct {
70     hmac_user_uapsd_stru uapsd_stru;
71     mac_user_uapsd_status_stru uapsd_status;
72     osal_u8 uapsd_flag;
73     osal_u8 resv[3];
74 } hmac_user_uapsd_info_stru;
75 /*****************************************************************************
76   10 函数声明
77 *****************************************************************************/
78 
79 typedef osal_u32 (*hmac_uapsd_update_user_para_etc_cb)(osal_u8 *payload, osal_u8 sub_type, osal_u32 msg_len,
80     hmac_user_stru *hmac_user);
81 typedef osal_void (*hmac_uapsd_rx_trigger_check_cb)(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
82     const oal_netbuf_stru *net_buf);
83 typedef osal_s32 (*hmac_uapsd_flush_queue_cb)(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user);
84 typedef osal_u32 (*hmac_uapsd_enqueue_proc_cb)(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
85     mac_tx_ctl_stru *tx_ctl, oal_netbuf_stru *netbuf);
86 typedef oal_bool_enum_uint8 (*hmac_psm_is_uapsd_empty_cb)(hmac_user_stru *hmac_user);
87 typedef hmac_user_uapsd_info_stru *(*hmac_ap_get_user_uapsd_info_cb)(osal_u16 assoc_id);
88 
89 static osal_u32 hmac_uapsd_ap_init_weakref(osal_void)
90     __attribute__ ((weakref("hmac_uapsd_ap_init"), used));
91 static osal_void hmac_uapsd_ap_deinit_weakref(osal_void)
92     __attribute__ ((weakref("hmac_uapsd_ap_deinit"), used));
93 
94 #ifdef __cplusplus
95 #if __cplusplus
96 }
97 #endif
98 #endif
99 
100 #endif /* end of hmac_uapsd.h */
101