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 * Description: netbuf enum type head file. 15 */ 16 17 #ifndef MAC_USER_COMMON_ROM_H 18 #define MAC_USER_COMMON_ROM_H 19 20 #include "osal_types.h" 21 #include "wlan_types_base_rom.h" 22 #include "mac_frame_common_rom.h" 23 #include "wlan_mib_type.h" 24 #include "wlan_types.h" 25 #include "oal_types_device_rom.h" 26 27 #ifdef __cplusplus 28 #if __cplusplus 29 extern "C" { 30 #endif 31 #endif 32 33 /* 用户与AP的关联状态枚举 */ 34 typedef enum { 35 MAC_USER_STATE_AUTH_COMPLETE = 1, 36 MAC_USER_STATE_AUTH_KEY_SEQ1 = 2, 37 MAC_USER_STATE_ASSOC = 3, 38 39 MAC_USER_STATE_BUTT = 4 40 } mac_user_asoc_state_enum; 41 typedef osal_u8 mac_user_asoc_state_enum_uint8; 42 43 typedef enum { 44 MAC_USER_TYPE_DEFAULT, 45 MAC_USER_TYPE_TDLS, 46 47 MAC_USER_TYPE_BUTT 48 } mac_user_type_enum; 49 typedef osal_u8 mac_user_type_enum_uint8; 50 51 typedef struct mac_key_params_tag { 52 osal_u8 key[OAL_WPA_KEY_LEN]; 53 osal_u8 seq[OAL_WPA_SEQ_LEN]; 54 osal_s32 key_len; 55 osal_s32 seq_len; 56 osal_u32 cipher; 57 } mac_key_params_stru; 58 59 typedef struct { 60 mac_frame_he_cap_ie_stru he_cap_ie; /* HE Cap ie */ 61 mac_frame_he_oper_ie_stru he_oper_ie; /* HE Operation */ 62 wlan_mib_vht_op_width_enum_uint8 channel_width; /* 解析VHT Operation IE */ 63 osal_u16 max_mpdu_length; 64 65 osal_u8 bss_color : 6; /* 保存bss color change announcement ie数据 */ 66 osal_u8 bss_color_exist : 1; 67 osal_u8 he_capable : 1; /* HE capable */ 68 } mac_he_hdl_stru; 69 70 typedef struct { 71 osal_u16 max_mcs_1ss : 2, /* 一个空间流的MCS最大支持MAP */ 72 max_mcs_2ss : 2, /* 一个空间流的MCS最大支持MAP */ 73 max_mcs_3ss : 2, /* 一个空间流的MCS最大支持MAP */ 74 max_mcs_4ss : 2, /* 一个空间流的MCS最大支持MAP */ 75 max_mcs_5ss : 2, /* 一个空间流的MCS最大支持MAP */ 76 max_mcs_6ss : 2, /* 一个空间流的MCS最大支持MAP */ 77 max_mcs_7ss : 2, /* 一个空间流的MCS最大支持MAP */ 78 max_mcs_8ss : 2; /* 一个空间流的MCS最大支持MAP */ 79 } mac_max_mcs_map_stru; 80 81 typedef mac_max_mcs_map_stru mac_tx_max_mcs_map_stru; 82 typedef mac_max_mcs_map_stru mac_rx_max_mcs_map_stru; 83 84 typedef struct { 85 osal_u16 max_mpdu_length; 86 osal_u16 basic_mcs_set; 87 88 osal_u32 max_mpdu_length_flag : 2, 89 supported_channel_width : 2, 90 rx_ldpc : 1, 91 short_gi_80mhz : 1, 92 short_gi_160mhz : 1, 93 tx_stbc : 1, 94 rx_stbc : 3, 95 su_beamformer_cap : 1, /* SU bfer能力,要过AP认证,必须填1 */ 96 su_beamformee_cap : 1, /* SU bfee能力,要过STA认证,必须填1 */ 97 num_bf_ant_supported : 3, /* SU时,最大接收NDP的Nsts,最小是1 */ 98 num_sounding_dim : 3, /* SU时,表示Nsts最大值,最小是1 */ 99 mu_beamformer_cap : 1, /* 不支持,set to 0 */ 100 mu_beamformee_cap : 1, /* 不支持,set to 0 */ 101 vht_txop_ps : 1, 102 htc_vht_capable : 1, 103 max_ampdu_len_exp : 3, 104 vht_link_adaptation : 2, 105 rx_ant_pattern : 1, 106 tx_ant_pattern : 1, 107 resv1 : 2; /* 解析vht Capabilities IE: VHT Capabilities Info field */ 108 109 mac_tx_max_mcs_map_stru tx_max_mcs_map; 110 mac_rx_max_mcs_map_stru rx_max_mcs_map; 111 112 osal_u16 rx_highest_rate : 13, 113 resv2 : 3; 114 osal_u16 tx_highest_rate : 13, 115 resv3 : 3; /* 解析vht Capabilities IE: VHT Supported MCS Set field */ 116 117 oal_bool_enum_uint8 vht_capable; /* VHT capable */ 118 119 /* vht operation只有是ap的情况下有 */ 120 wlan_mib_vht_op_width_enum_uint8 channel_width; /* 解析VHT Operation IE. 0 for 20/40M, 1 for 80M, 2 for 160M */ 121 osal_u8 channel_center_freq_seg0; 122 osal_u8 channel_center_freq_seg1; 123 } mac_vht_hdl_stru; 124 125 /* user tx参数,从架构分析文档获得成员 */ 126 typedef struct { 127 wlan_security_txop_params_stru security; 128 } mac_user_tx_param_stru; 129 130 typedef struct { 131 osal_u16 tid_pkt_num[WLAN_TID_MAX_NUM]; 132 osal_u32 tid_pkt_len[WLAN_TID_MAX_NUM]; 133 } mac_user_tid_pkt_stat_stru; 134 135 typedef struct { 136 osal_u8 rs_nrates; /* 个数 */ 137 osal_u8 rs_rates[WLAN_MAX_SUPP_RATES]; /* 速率 */ 138 } mac_rate_stru; 139 140 /* 密钥管理结构体 */ 141 typedef struct { 142 wlan_ciper_protocol_type_enum_uint8 cipher_type; 143 osal_u8 default_index; /* 默认索引 */ 144 osal_u8 igtk_key_index; /* igtk索引 */ 145 osal_u8 gtk : 1; /* 指示RX GTK的槽位,02使用 */ 146 osal_u8 last_gtk_key_idx : 7; /* igtk索引 */ 147 wlan_priv_key_param_stru key[WLAN_NUM_TK + WLAN_NUM_IGTK]; /* key缓存 */ 148 } mac_key_mgmt_stru; 149 150 /* user下ht相关信息 */ 151 typedef struct { 152 /* ht cap */ 153 oal_bool_enum_uint8 ht_capable; /* HT capable */ 154 osal_u8 max_rx_ampdu_factor; /* Max AMPDU Rx Factor */ 155 osal_u8 min_mpdu_start_spacing; /* Min AMPDU Start Spacing */ 156 osal_u8 htc_support; /* HTC 域支持 */ 157 158 osal_u16 ldpc_coding_cap : 1, /* LDPC 编码 capability */ 159 supported_channel_width : 1, /* STA 支持的带宽 0: 20Mhz, 1: 20/40Mhz */ 160 sm_power_save : 2, /* SM 省电模式 */ 161 ht_green_field : 1, /* 绿野模式 */ 162 short_gi_20mhz : 1, /* 20M下短保护间隔 */ 163 short_gi_40mhz : 1, /* 40M下短保护间隔 */ 164 tx_stbc : 1, /* Indicates support for the transmission of PPDUs using STBC */ 165 rx_stbc : 2, /* 支持 Rx STBC */ 166 ht_delayed_block_ack : 1, /* Indicates support for HT-delayed Block Ack opera-tion. */ 167 max_amsdu_length : 1, /* Indicates maximum A-MSDU length. */ 168 dsss_cck_mode_40mhz : 1, /* 40M下 DSSS/CCK 模式 0:不使用 40M dsss/cck, 1: 使用 40M dsss/cck */ 169 bit_resv : 1, 170 forty_mhz_intolerant : 1, 171 lsig_txop_protection : 1; /* 支持 L-SIG TXOP 保护 */ 172 173 osal_u8 rx_mcs_bitmask[WLAN_HT_MCS_BITMASK_LEN]; /* Rx MCS bitmask */ 174 175 /* ht operation, VAP是STA, user是AP独有 */ 176 osal_u8 primary_channel; 177 178 osal_u8 secondary_chan_offset : 2, 179 sta_chan_width : 1, 180 rifs_mode : 1, 181 ht_protection : 2, 182 nongf_sta_present : 1, 183 obss_nonht_sta_present : 1; 184 185 osal_u8 dual_beacon : 1, 186 dual_cts_protection : 1, 187 secondary_beacon : 1, 188 lsig_txop_protection_full_support : 1, 189 pco_active : 1, 190 pco_phase : 1, 191 resv6 : 2; 192 193 osal_u8 auc_resv[1]; 194 195 osal_u8 basic_mcs_set[16]; 196 197 osal_u32 imbf_receive_cap : 1, /* 隐式TxBf接收能力 */ 198 receive_staggered_sounding_cap : 1, /* 接收交错探测帧的能力 */ 199 transmit_staggered_sounding_cap : 1, /* 发送交错探测帧的能力 */ 200 receive_ndp_cap : 1, /* 接收NDP能力 */ 201 transmit_ndp_cap : 1, /* 发送NDP能力 */ 202 imbf_cap : 1, /* 隐式TxBf能力 */ 203 calibration : 2, /* 0=不支持 1=可以报告不能发起 2=保留 3=可以发起,可以响应 */ 204 exp_csi_txbf_cap : 1, /* 应用CSI反馈进行TxBf的能力 */ 205 exp_noncomp_txbf_cap : 1, /* 应用非压缩矩阵进行TxBf的能力 */ 206 exp_comp_txbf_cap : 1, /* 应用压缩矩阵进行TxBf的能力 */ 207 exp_csi_feedback : 2, /* 0=不支持.1=延迟反馈.2=立即反馈.3=延迟和立即反馈 */ 208 exp_noncomp_feedback : 2, /* 0=不支持.1=延迟反馈.2=立即反馈.3=延迟和立即反馈 */ 209 exp_comp_feedback : 2, /* 0=不支持.1=延迟反馈.2=立即反馈.3=延迟和立即反馈 */ 210 min_grouping : 2, /* 0=不分组.1=1,2分组. 2=1,4分组. 3=1,2,4分组 */ 211 csi_bfer_ant_number : 2, /* CSI反馈时,bfee最多支持的beamformer天线数 */ 212 noncomp_bfer_ant_number : 2, /* 非压缩矩阵反馈时,bfee最多支持的beamformer天线数 */ 213 comp_bfer_ant_number : 2, /* 压缩矩阵反馈时,bfee最多支持的beamformer天线数 */ 214 csi_bfee_max_rows : 2, /* bfer支持的来自bfee的CSI显示反馈的最大行数 */ 215 channel_est_cap : 2, /* 信道估计的能力,0=1空时流,依次递增 */ 216 reserved : 3; 217 }mac_user_ht_hdl_stru; 218 219 #ifdef __cplusplus 220 #if __cplusplus 221 } 222 #endif 223 #endif 224 225 #endif /* end of mac_user_common_rom.h */