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: wlan_resource_common_rom.h 仅host侧引用内容 15 * Date: 2022-11-26 16 */ 17 #ifndef __WLAN_RESOURCE_COMMON_H__ 18 #define __WLAN_RESOURCE_COMMON_H__ 19 20 #include "wlan_resource_common_rom.h" 21 22 #ifdef __cplusplus 23 #if __cplusplus 24 extern "C" { 25 #endif 26 #endif 27 28 #define MAC_FCS_MAX_CHL_NUM 2 29 #define MAC_FCS_TIMEOUT_JIFFY 2 30 #define MAC_FCS_DEFAULT_PROTECT_TIME_OUT2 1024 /* us */ 31 #define MAC_FCS_DEFAULT_PROTECT_TIME_OUT4 16000 /* us */ 32 #define MAC_ONE_PACKET_TIME_OUT4 2000 33 #define MAC_FCS_CTS_MAX_BTCOEX_NOR_DURATION 32767 /* us */ 34 #define MAC_FCS_CTS_MAX_BTCOEX_LDAC_DURATION 65535 /* us */ 35 36 /* MAC vap能力特性标识 */ 37 typedef struct { 38 osal_u32 uapsd : 1, 39 txop_ps : 1, 40 wpa : 1, 41 wpa2 : 1, 42 dsss_cck_mode_40mhz : 1, /* 是否允许在40M上使用DSSS/CCK, 1-允许, 0-不允许 */ 43 rifs_tx_on : 1, 44 tdls_prohibited : 1, /* tdls全局禁用开关, 0-不关闭, 1-关闭 */ 45 tdls_channel_switch_prohibited : 1, /* tdls信道切换全局禁用开关, 0-不关闭, 1-关闭 */ 46 hide_ssid : 1, /* AP开启隐藏ssid, 0-关闭, 1-开启 */ 47 wps : 1, /* AP WPS功能:0-关闭, 1-开启 */ 48 support_11ac2g : 1, /* 2.4G下的11ac:0-关闭, 1-开启 */ 49 keepalive : 1, /* vap KeepAlive功能开关: 0-关闭, 1-开启 */ 50 smps : 2, /* vap 当前SMPS能力(暂时不使用) */ 51 dpd_enbale : 1, /* dpd是否开启 */ 52 dpd_done : 1, /* dpd是否完成 */ 53 txbf_11n : 1, /* 11n txbf能力 */ 54 disable_2ght40 : 1, /* 2ght40禁止位,1-禁止,0-不禁止 */ 55 peer_obss_scan : 1, /* 对端支持obss scan能力: 0-不支持, 1-支持 */ 56 is_1024qam : 1, /* 对端支持1024qam能力: 0-不支持, 1-支持 */ 57 wmm_cap : 1, /* 保存与STA关联的AP是否支持wmm能力信息 */ 58 is_interworking : 1, /* 保存与STA关联的AP是否支持interworking能力 */ 59 ip_filter : 1, /* rx方向ip包过滤的功能 */ 60 opmode : 1, /* 对端的probe rsp中的extended capbilities 是否支持OPMODE */ 61 nb : 1, /* 硬件是否支持窄带 */ 62 autoswitch_2040 : 1, /* 是否支持随环境自动2040带宽切换 */ 63 custom_siso_2g : 1, /* 2g是否定制化单天线siso,默认等于0,初始双天线 */ 64 custom_siso_5g : 1, /* 5g是否定制化单天线siso,默认等于0,初始双天线 */ 65 wur_enable : 1, /* ap wur 能力开关 */ 66 wpa3 : 1, 67 bit_resv : 2; 68 } mac_cap_flag_stru; 69 70 typedef struct { 71 osal_u8 tidno; /* tidno,部分action帧使用 */ 72 osal_u8 resv[3]; /* 保留3个字节对齐 */ 73 osal_u8 initiator; /* 触发端方向 */ 74 /* 以下为接收到req帧,发送rsp帧后,需要同步到dmac的内容 */ 75 osal_u8 status; /* rsp帧中的状态 */ 76 osal_u8 mac_addr[WLAN_MAC_ADDR_LEN]; /* 用于DELBA/DELTS查找HMAC用户 */ 77 } dmac_ctx_action_event_stru; 78 79 typedef enum { 80 MAC_FCS_HOOK_ID_DBAC, 81 MAC_FCS_HOOK_ID_ACS, 82 83 MAC_FCS_HOOK_ID_BUTT 84 } mac_fcs_hook_id_enum; 85 typedef osal_u8 mac_fcs_hook_id_enum_uint8; 86 87 typedef struct { 88 osal_u8 ssid[WLAN_SSID_MAX_LEN]; 89 osal_u8 resv[3]; /* 预留3字节对齐 */ 90 } mac_ssid_stru; 91 92 typedef struct { 93 mac_fcs_notify_func func; 94 } mac_fcs_notify_node_stru; 95 96 typedef struct { 97 mac_fcs_notify_node_stru notify_nodes[MAC_FCS_HOOK_ID_BUTT]; 98 } mac_fcs_notify_chain_stru; 99 100 typedef struct { 101 osal_u32 offset_addr; 102 osal_u32 value[MAC_FCS_MAX_CHL_NUM]; 103 } mac_fcs_reg_record_stru; 104 105 /* 106 * enum nl80211_mfp - Management frame protection state 107 * @NL80211_MFP_NO: Management frame protection not used 108 * @NL80211_MFP_REQUIRED: Management frame protection required 109 */ 110 typedef enum { 111 MAC_NL80211_MFP_NO, 112 MAC_NL80211_MFP_REQUIRED, 113 114 MAC_NL80211_MFP_BUTT 115 } mac_nl80211_mfp_enum; 116 typedef osal_u8 mac_nl80211_mfp_enum_uint8; 117 118 #define SERVICE_CONTROL_MGMT_FRAME_TX BIT0 119 #define SERVICE_CONTROL_MGMT_FRAME_RX BIT1 120 #define SERVICE_CONTROL_DATA_FRAME_TX BIT2 121 #define SERVICE_CONTROL_DATA_FRAME_RX BIT3 122 #define SERVICE_CONTROL_SCAN BIT4 123 #define SERVICE_CONTROL_SKIP_PROBE_FRAME BIT5 124 #define SERVICE_CONTROL_DROP_FRAME BIT6 125 126 #ifdef __cplusplus 127 #if __cplusplus 128 } 129 #endif 130 #endif 131 132 #endif /* end of wlan_resource_common.h */ 133