• 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 __MAC_IE_H__
20 #define __MAC_IE_H__
21 
22 /* ****************************************************************************
23   1 其他头文件包含
24 **************************************************************************** */
25 #include "oal_ext_if.h"
26 #include "mac_frame.h"
27 #include "wlan_mib.h"
28 #include "wlan_types.h"
29 #include "mac_user.h"
30 #include "mac_vap.h"
31 
32 #ifdef __cplusplus
33 #if __cplusplus
34 extern "C" {
35 #endif
36 #endif
37 
38 /* ****************************************************************************
39   2 宏定义
40 **************************************************************************** */
41 /* ****************************************************************************
42   3 枚举定义
43 **************************************************************************** */
44 /* ****************************************************************************
45   4 全局变量声明
46 **************************************************************************** */
47 /* ****************************************************************************
48   5 消息头定义
49 **************************************************************************** */
50 /* ****************************************************************************
51   6 消息定义
52 **************************************************************************** */
53 /* ****************************************************************************
54   7 STRUCT定义
55 **************************************************************************** */
56 /* ****************************************************************************
57   8 UNION定义
58 **************************************************************************** */
59 /* ****************************************************************************
60   9 OTHERS定义
61 **************************************************************************** */
62 /* ****************************************************************************
63   10 inline函数定义
64 **************************************************************************** */
65 #ifdef _PRE_WLAN_FEATURE_OPMODE_NOTIFY
66 /* ****************************************************************************
67  功能描述  : 判断帧类型是否为(重)关联请求/响应
68  输入参数  : uc_mgmt_frm_type: 帧类型
69  返 回 值  : 是HI_TRUE/否HI_FALSE
70  修改历史      :
71   1.日    期   : 2014年7月2日
72     作    者   : HiSilicon
73     修改内容   : 新生成函数
74 **************************************************************************** */
mac_check_is_assoc_frame(hi_u8 mgmt_frm_type)75 static inline hi_u32 mac_check_is_assoc_frame(hi_u8 mgmt_frm_type)
76 {
77     if ((mgmt_frm_type == WLAN_FC0_SUBTYPE_ASSOC_RSP) || (mgmt_frm_type == WLAN_FC0_SUBTYPE_REASSOC_REQ) ||
78         (mgmt_frm_type == WLAN_FC0_SUBTYPE_REASSOC_RSP) || (mgmt_frm_type == WLAN_FC0_SUBTYPE_ASSOC_REQ)) {
79         return HI_TRUE;
80     }
81     return HI_FALSE;
82 }
83 #endif
84 
85 /* ****************************************************************************
86   11 函数声明
87 **************************************************************************** */
88 mac_sec_ch_off_enum_uint8 mac_get_sco_from_bandwidth(wlan_channel_bandwidth_enum_uint8 bandwidth);
89 
90 wlan_channel_bandwidth_enum_uint8 mac_get_bandwith_from_center_freq_seg0(hi_u8 channel, hi_u8 chan_center_freq);
91 
92 hi_void mac_ie_get_vht_rx_mcs_map(mac_rx_max_mcs_map_stru *mac_rx_mcs_sta, mac_rx_max_mcs_map_stru *mac_rx_mcs_ap);
93 
94 wlan_mib_mimo_power_save_enum_uint8 mac_ie_proc_sm_power_save_field(hi_u8 smps);
95 hi_u8 mac_ie_proc_ht_green_field(const mac_user_stru *mac_user_sta, mac_vap_stru *mac_vap, hi_u8 ht_green_field,
96     hi_bool prev_asoc_ht);
97 hi_u8 mac_ie_proc_ht_supported_channel_width(const mac_user_stru *mac_user_sta, mac_vap_stru *mac_vap,
98     hi_u8 supported_channel_width, hi_bool prev_asoc_ht);
99 hi_u8 mac_ie_proc_lsig_txop_protection_support(const mac_user_stru *mac_user_sta, mac_vap_stru *mac_vap,
100     hi_u8 lsig_txop_protection_support, hi_bool prev_asoc_ht);
101 hi_u8 mac_ie_get_chan_num(hi_u8 *puc_frame_body, hi_u16 us_frame_len, hi_u16 us_offset, hi_u8 curr_chan);
102 hi_u32 mac_set_second_channel_offset_ie(wlan_channel_bandwidth_enum_uint8 bw, hi_u8 *pauc_buffer,
103     hi_u8 *puc_output_len);
104 hi_u8 mac_ie_check_p2p_action(const hi_u8 *puc_payload);
105 hi_u32 mac_config_set_mib(const mac_vap_stru *mac_vap, hi_u16 us_len, const hi_u8 *puc_param);
106 hi_void mac_ie_proc_ht_sta(const mac_vap_stru *mac_vap, const hi_u8 *puc_payload, const hi_u16 *pus_index,
107     mac_user_stru *mac_user_ap, hi_u16 *pus_ht_cap_info, hi_u16 *pus_amsdu_max);
108 hi_u32 mac_proc_ht_opern_ie(mac_vap_stru *mac_vap, const hi_u8 *puc_payload, mac_user_stru *mac_user);
109 hi_void mac_ie_txbf_set_ht_hdl(mac_user_ht_hdl_stru *ht_hdl, hi_u32 info_elem);
110 wlan_channel_bandwidth_enum_uint8 mac_get_bandwidth_from_sco(mac_sec_ch_off_enum_uint8 sec_chan_offset);
111 
112 
113 #ifdef __cplusplus
114 #if __cplusplus
115 }
116 #endif
117 #endif
118 #endif /* __MAC_IE_H__ */
119