WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
mac_ie.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2020-2023. All rights reserved.
3 * Description: Header file of mac_ie.c.
4 * Create: 2020-01-01
5 */
6
7#ifndef __MAC_IE_H__
8#define __MAC_IE_H__
9
10/*****************************************************************************
11 其他头文件包含
12*****************************************************************************/
13#include "oal_ext_if.h"
14#include "wlan_spec.h"
15#include "mac_frame.h"
16#include "wlan_mib_hcm.h"
17#include "wlan_types_common.h"
18#include "mac_user_ext.h"
19#include "mac_vap_ext.h"
20
21#ifdef __cplusplus
22#if __cplusplus
23extern "C" {
24#endif
25#endif
26
27#undef THIS_FILE_ID
28#define THIS_FILE_ID OAM_FILE_ID_MAC_IE_H
29
30/*****************************************************************************
31 宏定义
32*****************************************************************************/
33#define mac_ie_remain_len_is_enough(src_ie, curr_ie, ie_len, remain_len) \
34 (((((curr_ie) - (src_ie)) + (remain_len)) <= (ie_len)) ? OSAL_TRUE : OSAL_FALSE)
35
36/*****************************************************************************
37 OTHERS定义
38*****************************************************************************/
39
40/*****************************************************************************
41 函 数 名 : mac_get_bandwidth_from_sco
42 功能描述 : 根据"次信道偏移量"获取对应的带宽模式
43*****************************************************************************/
44static INLINE__ wlan_channel_bandwidth_enum_uint8 mac_get_bandwidth_from_sco(mac_sec_ch_off_enum_uint8 sec_chan_offset)
45{
46 switch (sec_chan_offset) {
47 case MAC_SCA: /* Secondary Channel Above */
49
50 case MAC_SCB: /* Secondary Channel Below */
52
53 default: /* No Secondary Channel */
55 }
56}
57
58/*****************************************************************************
59 函 数 名 : mac_get_sco_from_bandwidth
60 功能描述 : 根据"带宽模式"获取对应的"次信道偏移量"
61*****************************************************************************/
62static INLINE__ mac_sec_ch_off_enum_uint8 mac_get_sco_from_bandwidth(wlan_channel_bandwidth_enum_uint8 bandwidth)
63{
64 switch (bandwidth) {
68 return MAC_SCA;
72 return MAC_SCB;
73 default:
74 return MAC_SCN;
75 }
76}
77
78/*****************************************************************************
79 函 数 名 : mac_get_bandwith_from_center_freq_seg0
80 功能描述 : 根据信道中心频点获取对应的"带宽模式"
81*****************************************************************************/
82static INLINE__ wlan_channel_bandwidth_enum_uint8 mac_get_bandwith_from_center_freq_seg0(osal_u8 chan_width,
83 osal_u8 channel, osal_u8 chan_center_freq)
84{
85 /* 80+80不支持,暂按80M处理 */
86 if ((WLAN_MIB_VHT_OP_WIDTH_80 & chan_width) != 0) {
87 switch (chan_center_freq - channel) {
88 case 6:
89 /***********************************************************************
90 | 主20 | 从20 | 从40 |
91 |
92 |中心频率相对于主20偏6个信道
93 ************************************************************************/
95
96 case -2:
97 /***********************************************************************
98 | 从40 | 主20 | 从20 |
99 |
100 |中心频率相对于主20偏-2个信道
101 ************************************************************************/
103
104 case 2:
105 /***********************************************************************
106 | 从20 | 主20 | 从40 |
107 |
108 |中心频率相对于主20偏2个信道
109 ************************************************************************/
111
112 case -6:
113 /***********************************************************************
114 | 从40 | 从20 | 主20 |
115 |
116 |中心频率相对于主20偏-6个信道
117 ************************************************************************/
119
120 default:
121 return WLAN_BAND_WIDTH_20M;
122 }
123 } else {
124 return WLAN_BAND_WIDTH_20M;
125 }
126}
127
128static INLINE__ wlan_channel_bandwidth_enum_uint8 mac_get_bandwith_from_center_freq_seg0_seg1(osal_u8 chan_width,
129 osal_u8 channel, osal_u8 chan_center_freq0, osal_u8 chan_center_freq1)
130{
131 unref_param(chan_center_freq1);
132 /* 80+80不支持,暂按80M处理 */
133 if ((WLAN_MIB_VHT_OP_WIDTH_80 & chan_width) != 0) {
134 switch (chan_center_freq0 - channel) {
135 case 2:
136 /***********************************************************************
137 | 从20 | 主20 | 从40 |
138 |
139 |中心频率相对于主20偏2个信道
140 ************************************************************************/
142
143 case 6:
144 /***********************************************************************
145 | 主20 | 从20 | 从40 |
146 |
147 |中心频率相对于主20偏6个信道
148 ************************************************************************/
150
151 case -6:
152 /***********************************************************************
153 | 从40 | 从20 | 主20 |
154 |
155 |中心频率相对于主20偏-6个信道
156 ************************************************************************/
158
159 case -2:
160 /***********************************************************************
161 | 从40 | 主20 | 从20 |
162 |
163 |中心频率相对于主20偏-2个信道
164 ************************************************************************/
166
167 default:
168 return WLAN_BAND_WIDTH_20M;
169 }
170 } else {
171 return WLAN_BAND_WIDTH_20M;
172 }
173}
174
175/*****************************************************************************
176 函数声明
177*****************************************************************************/
178
179#ifdef _PRE_WLAN_FEATURE_20_40_80_COEXIST
180osal_u32 hmac_ie_proc_chwidth_field_etc(const hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user, osal_u8 chwidth);
181#endif
182
183#ifdef _PRE_WLAN_FEATURE_SMPS
184extern osal_u32 hmac_smps_update_user_status(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user);
185#endif
187 osal_u8 smps);
188
190 hmac_vap_stru *hmac_vap, osal_u8 ht_green_field, oal_bool_enum prev_asoc_ht);
191
193 hmac_vap_stru *hmac_vap, osal_u8 supp_chan_width, oal_bool_enum prev_asoc_ht);
194
196 hmac_vap_stru *hmac_vap, osal_u8 lsig_txop_prot_supp, oal_bool_enum prev_asoc_ht);
198extern osal_u8 hmac_ie_get_chan_num_etc(osal_u8 *frame_body, osal_u16 frame_len, osal_u16 offset,
199 osal_u8 curr_chan);
200
202extern osal_u32 mac_ie_proc_ht_sta_etc(const hmac_vap_stru *hmac_vap, osal_u8 *payload,
203 osal_u16 offset_len, hmac_user_stru *mac_user_ap, osal_u16 *amsdu_maxsize);
205
206#ifdef _PRE_WLAN_FEATURE_11AX
207extern osal_u32 hmac_ie_proc_he_opern_ie(hmac_vap_stru *hmac_vap, osal_u8 *payload, hmac_user_stru *hmac_user);
208extern osal_u32 hmac_ie_parse_he_cap(osal_u8 *he_cap_ie, mac_frame_he_cap_ie_stru *he_cap_value);
209extern osal_u32 hmac_ie_parse_he_oper(osal_u8 *he_oper_ie, mac_frame_he_oper_ie_stru *he_oper_ie_data);
210extern osal_u32 hmac_ie_parse_mu_edca_parameter(osal_u8 *edca_ie,
211 mac_frame_he_mu_edca_parameter_ie_stru *he_mu_edca_value);
212extern osal_u32 hmac_ie_parse_he_bss_color_change_announcement_ie(osal_u8 *payload,
214#endif
215
218 hmac_user_stru *hmac_user);
219#ifdef _PRE_WLAN_FEATURE_OPMODE_NOTIFY
220extern osal_u32 hmac_ie_proc_opmode_field_etc(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
221 mac_opmode_notify_stru *opmode_notify);
222extern osal_u32 hmac_check_is_assoc_frame_etc(osal_u8 mgmt_frm_type);
223#endif
226
227#ifdef __cplusplus
228#if __cplusplus
229 }
230#endif
231#endif
232
233#endif /* end of mac_ie.h */
#define unref_param(P)
Definition dmac_misc_type.h:33
@ MAC_SCA
Definition mac_frame.h:548
@ MAC_SCN
Definition mac_frame.h:547
@ MAC_SCB
Definition mac_frame.h:549
osal_u8 mac_sec_ch_off_enum_uint8
Definition mac_frame.h:553
osal_u32 hmac_proc_ht_opern_ie_etc(hmac_vap_stru *hmac_vap, osal_u8 *payload, hmac_user_stru *hmac_user)
osal_u8 * hmac_ie_find_vendor_vht_ie(osal_u8 *frame, osal_u16 frame_len)
osal_u32 hmac_ie_proc_ext_cap_ie_etc(hmac_user_stru *hmac_user, osal_u8 *payload)
osal_u8 hmac_ie_get_chan_num_etc(osal_u8 *frame_body, osal_u16 frame_len, osal_u16 offset, osal_u8 curr_chan)
oal_bool_enum_uint8 hmac_ie_proc_lsig_txop_protection_support_etc(const hmac_user_stru *hmac_user, hmac_vap_stru *hmac_vap, osal_u8 lsig_txop_prot_supp, oal_bool_enum prev_asoc_ht)
osal_u32 hmac_ie_proc_vht_opern_ie_etc(const hmac_vap_stru *hmac_vap, osal_u8 *payload, hmac_user_stru *hmac_user)
osal_u32 mac_ie_proc_ht_sta_etc(const hmac_vap_stru *hmac_vap, osal_u8 *payload, osal_u16 offset_len, hmac_user_stru *mac_user_ap, osal_u16 *amsdu_maxsize)
oal_bool_enum_uint8 mac_ie_proc_ht_supported_channel_width_etc(const hmac_user_stru *hmac_user, hmac_vap_stru *hmac_vap, osal_u8 supp_chan_width, oal_bool_enum prev_asoc_ht)
oal_bool_enum_uint8 mac_ie_proc_ht_green_field_etc(const hmac_user_stru *hmac_user, hmac_vap_stru *hmac_vap, osal_u8 ht_green_field, oal_bool_enum prev_asoc_ht)
wlan_mib_mimo_power_save_enum_uint8 hmac_ie_proc_sm_power_save_field_etc(hmac_user_stru *hmac_user, osal_u8 smps)
oal_bool_enum_uint8 hmac_ie_check_p2p_action_etc(osal_u8 *payload)
osal_u32 hmac_ie_get_rsn_cipher(osal_u8 *rsn_ie, mac_crypto_settings_stru *crypto)
osal_u32 hmac_ie_get_wpa_cipher(osal_u8 *wpa_ie, mac_crypto_settings_stru *crypto)
osal_u8 oal_bool_enum_uint8
Definition oal_types_device_rom.h:45
oal_bool_enum
Definition oal_types_device_rom.h:40
#define INLINE__
Definition osal_list.h:25
unsigned char osal_u8
Definition osal_types.h:11
unsigned int osal_u32
Definition osal_types.h:13
unsigned short osal_u16
Definition osal_types.h:12
Definition mac_user_ext.h:519
Definition mac_vap_ext.h:2019
Definition mac_vap_ext.h:1266
Definition mac_frame_common_rom.h:963
Definition mac_frame_common_rom.h:971
Definition mac_frame.h:1352
osal_u8 wlan_mib_mimo_power_save_enum_uint8
Definition wlan_mib_type.h:248
@ WLAN_MIB_VHT_OP_WIDTH_80
Definition wlan_mib_type.h:710
@ WLAN_BAND_WIDTH_40MINUS
Definition wlan_types_base_rom.h:226
@ WLAN_BAND_WIDTH_40PLUS
Definition wlan_types_base_rom.h:225
@ WLAN_BAND_WIDTH_80MINUSPLUS
Definition wlan_types_base_rom.h:229
@ WLAN_BAND_WIDTH_80MINUSMINUS
Definition wlan_types_base_rom.h:230
@ WLAN_BAND_WIDTH_80PLUSMINUS
Definition wlan_types_base_rom.h:228
@ WLAN_BAND_WIDTH_20M
Definition wlan_types_base_rom.h:224
@ WLAN_BAND_WIDTH_80PLUSPLUS
Definition wlan_types_base_rom.h:227
osal_u8 wlan_channel_bandwidth_enum_uint8
Definition wlan_types_base_rom.h:237