• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18 
19 #ifndef __HMAC_MGMT_STA_H__
20 #define __HMAC_MGMT_STA_H__
21 
22 /* ****************************************************************************
23   1 其他头文件包含
24 **************************************************************************** */
25 #include "oal_ext_if.h"
26 #include "hmac_ext_if.h"
27 #include "hmac_mgmt_bss_comm.h"
28 
29 #ifdef __cplusplus
30 #if __cplusplus
31 extern "C" {
32 #endif
33 #endif
34 
35 /* ****************************************************************************
36   2 宏定义
37 **************************************************************************** */
38 #define HMAC_WMM_QOS_PARAMS_HDR_LEN        8
39 #define HMAC_WMM_QOSINFO_AND_RESV_LEN      2
40 #define HMAC_WMM_AC_PARAMS_RECORD_LEN      4
41 
42 #define DMAC_MAX_SW_RETRIES         5   /* 数据报文重传次数 */
43 #define DMAC_MGMT_MAX_SW_RETRIES    3   /* 管理报文重传次数 */
44 
45 /* ****************************************************************************
46   3 STRUCT定义
47 **************************************************************************** */
48 /* 加入请求参数 */
49 typedef struct {
50     mac_bss_dscr_stru bss_dscr; /* 要加入的bss网络 */
51     hi_u16 us_join_timeout;     /* 加入超时 */
52     hi_u16 us_probe_delay;
53 } hmac_join_req_stru;
54 
55 /* 认证结果 */
56 typedef struct {
57     hi_u8  peer_sta_addr[WLAN_MAC_ADDR_LEN];
58     hi_u16 us_status_code;  /* 认证结果 */
59 } hmac_auth_rsp_stru;
60 
61 typedef struct hmac_edca_params_info_stru {
62     hi_u8 *puc_payload;
63 
64     hi_u16 us_msg_len;
65     hi_u16 us_info_elem_offset;
66 } hmac_edca_params_info_stru;
67 
68 typedef struct hmac_check_ht_sta_info_stru {
69     hi_u8 *puc_payload;
70     hi_u16 us_offset;
71     hi_u16 us_rx_len;
72 } hmac_check_ht_sta_info_stru;
73 
74 /* ****************************************************************************
75   4 UNION定义
76 **************************************************************************** */
77 /* ****************************************************************************
78   5 函数声明
79 **************************************************************************** */
80 hi_u32 hmac_sta_wait_join(hmac_vap_stru *hmac_vap, hmac_join_req_stru *join_req);
81 hi_u32 hmac_sta_wait_auth(hmac_vap_stru *hmac_vap, hi_u16 auth_timeout);
82 hi_u32 hmac_sta_wait_asoc(hmac_vap_stru *hmac_vap, hi_u16 us_assoc_timeout);
83 hi_u32 hmac_sta_wait_asoc_rx(hmac_vap_stru *hmac_vap, const dmac_wlan_crx_event_stru *crx_event);
84 hi_u32 hmac_sta_wait_auth_seq2_rx(hmac_vap_stru *hmac_vap, const dmac_wlan_crx_event_stru *crx_event);
85 hi_u32 hmac_sta_wait_auth_seq4_rx(hmac_vap_stru *hmac_vap, const dmac_wlan_crx_event_stru *crx_event);
86 hi_u32 hmac_sta_auth_timeout(hmac_vap_stru *hmac_vap);
87 hi_u32 hmac_sta_up_rx_mgmt(hmac_vap_stru *hmac_vap, const dmac_wlan_crx_event_stru *crx_event);
88 hi_u32 hmac_sta_wait_asoc_timeout(hmac_vap_stru *hmac_vap);
89 hi_void hmac_sta_disassoc_rsp(const hmac_vap_stru *hmac_vap, hi_u16 us_disasoc_reason_code,
90                               hi_u16 us_dmac_reason_code);
91 wlan_channel_bandwidth_enum_uint8 hmac_sta_get_band(wlan_bw_cap_enum_uint8 dev_cap,
92     wlan_channel_bandwidth_enum_uint8 bss_cap);
93 hi_u32 hmac_sta_get_user_protocol(mac_bss_dscr_stru *bss_dscr, wlan_protocol_enum_uint8 *protocol_mode);
94 
95 hi_void hmac_sta_update_wmm_info(hmac_vap_stru *hmac_vap, mac_user_stru *mac_user, hi_u8 *puc_wmm_ie);
96 hi_u32 hmac_sta_up_update_edca_params_machw(const hmac_vap_stru *hmac_vap, mac_wmm_set_param_type_enum_uint8 type);
97 hi_void hmac_send_2040_coext_mgmt_frame_sta(mac_vap_stru *mac_vap);
98 hi_u32 hmac_sta_set_txopps_partial_aid(mac_vap_stru *mac_vap);
99 hi_void hmac_sta_up_update_edca_params(const hmac_edca_params_info_stru *edca_params_info,
100     const hmac_vap_stru *hmac_vap, hi_u8 frame_sub_type, const hmac_user_stru *hmac_user);
101 hi_u32 hmac_ie_proc_obss_scan_ie(const mac_vap_stru *mac_vap, const hi_u8 *puc_payload);
102 hi_u8 hmac_is_support_11grate(const hi_u8 *puc_rates, hi_u8 rate_num);
103 hi_u8 hmac_is_support_11brate(const hi_u8 *puc_rates, hi_u8 rate_num);
104 hi_u32 hmac_set_retry_time_en(const mac_vap_stru *mac_vap, hi_u8 retry_time, hi_u8 retry_frame_type);
105 hi_u32 hmac_set_retry_time_close(const mac_vap_stru *mac_vap);
106 
107 #ifdef __cplusplus
108 #if __cplusplus
109 }
110 #endif
111 #endif
112 
113 #endif /* __HMAC_MGMT_STA_H__ */
114