WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hal_mac_rom.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2020-2022. All rights reserved.
3 * Description: Header file for hal_mac_rom.c.
4 */
5
6#ifndef HAL_MAC_ROM_H
7#define HAL_MAC_ROM_H
8
9/*****************************************************************************
10 1 其他头文件包含
11*****************************************************************************/
12#include "wlan_types_rom.h"
13#include "oam_ext_if.h"
14#include "frw_ext_if_rom.h"
15#include "hal_ext_if_rom.h"
16#include "hal_mac_reg.h"
17#include "hal_chip_rom.h"
18#include "hal_device_rom.h"
19#include "hal_soc_rom.h"
20#include "hal_device_fsm_rom.h"
21#include "frw_rom_cb_rom.h"
22#include "fe_extern_if_device.h"
23#include "hal_mac_reg_field.h"
24#include "hal_reset_rom.h"
25#ifdef __cplusplus
26#if __cplusplus
27extern "C" {
28#endif
29#endif
30
31
32/*****************************************************************************
33 2 宏定义
34*****************************************************************************/
35#define HH503_SIFSTIME 16
36#define HH503_ACK_CTS_FRAME_LEN 14
37#define HH503_LONG_PREAMBLE_LEN_A 16
38#define HH503_LONG_PREAMBLE_LEN_B 144
39#define HH503_PLCP_HEADER_LEN_A 4
40#define HH503_PLCP_HEADER_LEN_B 48
41/* 以下为PHY头时间 单位us */
42#define HH503_LONG_PREAMBLE_TIME 192
43#define HH503_SHORT_PREAMBLE_TIME 96
44#define HH503_LEGACY_OFDM_TIME 20
45#define HH503_HT_PHY_TIME 40
46#define HH503_VHT_PHY_TIME 44
47
48/* RTS时间定义,包括PHY头 帧长/速率+phy头时间 */
49#define HH503_RTSTIME_11B_LONG 221
50#define HH503_RTSTIME_NON_11B 27
51
52/* CTS时间定义,包括PHY头帧长/速率+phy头时间 */
53#define HH503_CTSACKTIME_11B_LONG 212
54#define HH503_CTSACKTIME_NON_11B 25
55
56/* BA时间定义,包括PHY头帧长/速率+phy头时间 */
57#define HH503_BATIME_11B_LONG 238
58#define HH503_BATIME_NON_11B 30
59
60/* 过滤寄存器初始值 */
61#define HH503_MAC_CFG_INIT 0xC7BDFEDA
62
63#define HH503_EIFSTIME_GONLY \
64 (HH503_SIFSTIME + HH503_ACK_CTS_FRAME_LEN * 8 + HH503_PLCP_HEADER_LEN_A + HH503_LONG_PREAMBLE_LEN_A)
65#define HH503_EIFSTIME_GMIXED \
66 (HH503_SIFSTIME + HH503_ACK_CTS_FRAME_LEN * 8 + HH503_PLCP_HEADER_LEN_B + HH503_LONG_PREAMBLE_LEN_B)
67
68#define HH503_LUT_READ_OPERN 0x0
69#define HH503_LUT_WRITE_OPERN 0x1
70#define HH503_LUT_REMOVE_OPERN 0x2
71/* Time (in units of 10us) to wait for CE-LUT update operation to complete */
72#define HH503_NUM_CE_LUT_UPDATE_ATTEMPTS 2
73
74/*****************************************************************************/
75/* Channel Access Timer Management Registers */
76/*****************************************************************************/
77#define HH503_MAC_SEC_CHAN_SLOT_COUNT_INIT_VAL_FREQ_5 0x00000001
78#define HH503_MAC_SEC_CHAN_SLOT_COUNT_INIT_VAL_FREQ_2 0x00000002
79
80#define HH503_PHY_TX_MODE_DEFAULT 0x00000000
81
82#ifdef _PRE_WLAN_DFT_STAT
83/* 维测需要读取硬件寄存器的值,函数定义放在DFT的预编译宏下 */
84#define HAL_DFT_REG_OTA_LEN 1024 /* 寄存器OTA上报的最大限制 */
85#endif
86
87#define BSRP_VAP_MAX 2
88
89#define HH503_PA_LUT_UPDATE_TIMEOUT 2000
90#define HH503_TX_SUSPEND_UPDATE_TIMEOUT 5000
91
92#define P2P_PERIOD_NOA_COUNT 255
93
94#define HH503_MAC_CFG_BIP_REPLAY_FAIL_FLT_EN_MASK 0x80000000
95#define HH503_MAC_CFG_CCMP_REPLAY_FAIL_FLT_EN_MASK 0x4000000
96#define HH503_MAC_CFG_OTHER_CTRL_FRAME_FLT_EN_MASK 0x400
97#define HH503_MAC_CFG_BCMC_MGMT_OTHER_BSS_FLT_EN_MASK 0x10
98#define HH503_MAC_CFG_VAP0_BSSID_H_LEN 16
99#define HH503_MAC_CFG_VAP0_BSSID_H_OFFSET 0
100#define HH503_MAC_CFG_VAP0_BSSID_H_MASK 0xffff
101#define HH503_MAC_CFG_VAP0_BSSID_L_LEN 32
102#define HH503_MAC_CFG_VAP0_BSSID_L_OFFSET 0
103#define HH503_MAC_CFG_VAP0_BSSID_L_MASK 0xffffffff
104
105#define HH503_LUT_RETRY_INTERVAL 10
106#define HH503_LUT_OPER_READ 0
107#define HH503_LUT_OPER_WRITE 1
108#define HH503_LUT_OPER_DEL 2
109#define HH503_LUT_OPER_CLR 3
110
111#define HH503_PN_FRM_TYPE_MCBC_DATA 0
112#define HH503_PN_FRM_TYPE_UC_QOS 1
113#define HH503_PN_FRM_TYPE_UC_NQOS 2
114#define HH503_PN_FRM_TYPE_UC_MGMT 3
115#define HH503_PN_FRM_TYPE_MCBC_MGMT 4
116
117#define HH503_MAX_USR_NUM 8
118
119#define HH503_KEY_IGTK 0
120#define HH503_KEY_PTK 1
121#define HH503_KEY_GTK 2
122/*****************************************************************************
123 3 枚举定义
124*****************************************************************************/
125/*****************************************************************************
126 4 全局变量声明
127*****************************************************************************/
128
129/*****************************************************************************
130 STRUCT定义
131*****************************************************************************/
138
149
168
169typedef union {
170 struct {
174 } bits;
177
181 osal_u16 interval_count);
182
187
188/*****************************************************************************
189 8 UNION定义
190*****************************************************************************/
191
192/*****************************************************************************
193 功能描述 : 获取当前发送完成中断上报的MPDU个数
194 函 数 名 : hh503_get_vap_internal
195 功能描述 : HAL内部获取VAP
196*****************************************************************************/
197static INLINE__ osal_void hh503_get_vap_internal(const hal_device_stru *device, osal_u8 vap_id,
198 hal_to_dmac_vap_stru **hal_vap)
199{
200 /* 检查传入的vap id是否合理 */
201 if (vap_id >= HAL_MAX_VAP_NUM) {
202 *hal_vap = OSAL_NULL;
203 return;
204 }
205 *hal_vap = (hal_to_dmac_vap_stru *)(device->vap_list[vap_id]);
206}
207
208static INLINE__ osal_u32 hh503_get_subband_index(wlan_channel_band_enum_uint8 band, osal_u8 channel_idx,
209 osal_u8 *subband_idx)
210{
211 if (band == WLAN_BAND_5G) {
212 /* ws73不支持5G */
213 return OAL_FAIL;
214 }
215 if ((band == WLAN_BAND_2G) && (channel_idx >= HAL_2G_CHANNEL_NUM + 1)) {
216 return OAL_FAIL;
217 }
218 *subband_idx = channel_idx;
219 return OAL_SUCC;
220}
221
222/*****************************************************************************
223 ROM回调函数类型定义
224*****************************************************************************/
227 osal_u8 chain_val);
229 oal_bool_enum_uint8 extlna_chg_bypass);
236osal_void hh503_get_freq_factor(osal_u8 freq_band, osal_u8 channel_num, osal_u32 *freq_factor);
239osal_void hh503_set_ctrl_frm_pow_code(osal_u32 phy_mode_addr, osal_u32 data_rate_addr, osal_u32 pow_code);
242 osal_u32 wait_10us_cnt);
244
245/*****************************************************************************
246 功能描述 : 根据tx描述符更新beacon_rate寄存器域
247*****************************************************************************/
249
250/*****************************************************************************
251 功能描述 : 恢复硬件发送
252*****************************************************************************/
255/*****************************************************************************
256 功能描述 : 配置MAC PHY ADC的频率
257*****************************************************************************/
260
261#ifdef _PRE_WLAN_FEATURE_CHBA
263#endif
264osal_void hal_vap_set_multi_bssid(osal_u8 *trans_bssid, osal_u8 maxbssid_indicator);
265#ifdef __cplusplus
266#if __cplusplus
267}
268#endif
269#endif
270
271#endif /* end of hal_mac_rom.h */
@ OAL_FAIL
Definition common_error_code_rom.h:570
@ OAL_SUCC
Definition common_error_code_rom.h:18
#define HAL_2G_CHANNEL_NUM
Definition fe_extern_if_device.h:17
@ HAL_MAX_VAP_NUM
Definition hal_common_ops_device_rom.h:33
osal_void hal_sync_update_tsf(osal_u8 vap_id, osal_bool enable)
osal_void(* hh503_set_primary_channel_ext_cb)(hal_to_dmac_device_stru *hal_device, osal_u8 channel_num, wlan_channel_band_enum_uint8 band, osal_u8 channel_idx, wlan_channel_bandwidth_enum_uint8 bandwidth)
Definition hal_mac_rom.h:230
osal_void hal_tsf_pulse_adjust(osal_void)
osal_void hal_chan_update_beacon_rate(hh503_tx_phy_rate_stru *beacon_rate, const hal_tx_ctrl_desc_rate_stru *tx_dscr)
osal_void hh503_set_extlna_chg_cfg_ext(hal_to_dmac_device_stru *hal_device, oal_bool_enum_uint8 extlna_chg_bypass)
osal_void(* p_hh503_set_psm_listen_interval_count_cb)(hal_to_dmac_vap_stru *hal_vap, osal_u16 interval_count)
Definition hal_mac_rom.h:180
osal_void(* p_hh503_enable_radar_det_cb)(osal_u8 enable)
Definition hal_mac_rom.h:179
osal_void hh503_ce_clear_all(osal_void)
osal_void hal_initialize_machw_common(osal_void)
osal_void hal_set_machw_tx_resume(osal_void)
osal_void(* p_hh503_dft_report_all_reg_state_cb)(hal_to_dmac_device_stru *hal_device)
Definition hal_mac_rom.h:178
osal_u32 hh503_enable_ce(osal_void)
osal_void(* hh503_reset_hw_macphy_cb)(osal_bool hw_reset)
Definition hal_mac_rom.h:232
osal_void hh503_set_psm_dtim_count_cb(hal_to_dmac_vap_stru *hal_vap, osal_u8 dtim_count)
osal_void(* hh503_cb_mac_init_hw)(osal_void)
Definition hal_mac_rom.h:225
osal_void(* hh503_set_extlna_chg_cfg_ext_cb)(hal_to_dmac_device_stru *hal_device, oal_bool_enum_uint8 extlna_chg_bypass)
Definition hal_mac_rom.h:228
osal_u32 hh503_wait_mac_done_timeout(osal_u32 reg_addr, osal_u32 bitmask, osal_u32 reg_busy_value, osal_u32 wait_10us_cnt)
osal_void hh503_set_dup_rts_cts_mode(osal_void)
osal_void hh503_set_ctrl_frm_pow_code(osal_u32 phy_mode_addr, osal_u32 data_rate_addr, osal_u32 pow_code)
osal_void hal_device_set_rx_filter1_reg(osal_bool filter)
osal_void hal_vap_set_multi_bssid(osal_u8 *trans_bssid, osal_u8 maxbssid_indicator)
osal_void hh503_get_freq_factor(osal_u8 freq_band, osal_u8 channel_num, osal_u32 *freq_factor)
osal_void(* hh503_set_prot_resp_frame_chain_ext_cb)(hal_to_dmac_device_stru *hal_device, osal_u8 chain_val)
Definition hal_mac_rom.h:226
osal_u8 hal_set_machw_phy_adc_freq(hal_to_dmac_device_stru *hal_device, wlan_channel_bandwidth_enum_uint8 bandwidth)
osal_u8 oal_bool_enum_uint8
Definition oal_types_device_rom.h:45
#define INLINE__
Definition osal_list.h:25
unsigned char osal_u8
Definition osal_types.h:11
osal_u8 osal_bool
Definition osal_types.h:27
#define OSAL_NULL
Definition osal_types.h:65
void osal_void
Definition osal_types.h:29
unsigned int osal_u32
Definition osal_types.h:13
unsigned short osal_u16
Definition osal_types.h:12
Definition hal_mac_rom.h:183
p_hh503_enable_radar_det_cb hh503_enable_radar_det
Definition hal_mac_rom.h:185
p_hh503_dft_report_all_reg_state_cb hh503_dft_report_all_reg_state
Definition hal_mac_rom.h:184
Definition hal_common_ops_device_rom.h:720
Definition hal_mac_rom.h:132
osal_u32 tpc_ch0
Definition hal_mac_rom.h:133
osal_u32 dpd_tpc_lv_ch0
Definition hal_mac_rom.h:134
osal_u32 reseved
Definition hal_mac_rom.h:136
osal_u32 cfr_idx
Definition hal_mac_rom.h:135
Definition hal_device_rom.h:39
hal_vap_stru * vap_list[HAL_MAX_VAP_NUM]
Definition hal_device_rom.h:42
Definition hal_ops_common_rom.h:529
Definition hal_common_ops_device_rom.h:870
Definition hal_mac_rom.h:169
osal_u32 mcs_rate
Definition hal_mac_rom.h:171
osal_u32 protocol_mode
Definition hal_mac_rom.h:172
osal_u8 u8
Definition hal_mac_rom.h:175
osal_u32 reserve
Definition hal_mac_rom.h:173
Definition hal_mac_rom.h:139
osal_u32 tx_vector_freq_bandwidth_mode
Definition hal_mac_rom.h:142
osal_u32 tx_vector_tpc_ch0
Definition hal_mac_rom.h:141
osal_u32 tx_vector_smoothing
Definition hal_mac_rom.h:143
osal_u32 u32
Definition hal_mac_rom.h:147
osal_u32 reserved
Definition hal_mac_rom.h:145
osal_u32 tx_vector_channel_code
Definition hal_mac_rom.h:144
Definition hal_mac_rom.h:150
osal_u32 tx_vector_he_ltf_type
Definition hal_mac_rom.h:152
osal_u32 tx_vector_tpc_dpd_lv_0
Definition hal_mac_rom.h:154
osal_u32 u32
Definition hal_mac_rom.h:166
osal_u32 tx_vector_preamble
Definition hal_mac_rom.h:161
osal_u32 tx_vector_ant_sel
Definition hal_mac_rom.h:153
osal_u32 tx_vector_he_flag
Definition hal_mac_rom.h:159
osal_u32 tx_vector_dcm
Definition hal_mac_rom.h:156
osal_u32 reserve
Definition hal_mac_rom.h:164
osal_u32 tx_vector_pe_duration
Definition hal_mac_rom.h:155
osal_u32 tx_vector_gi_type
Definition hal_mac_rom.h:162
osal_u32 tx_vector_cfr_idx
Definition hal_mac_rom.h:163
osal_u32 tx_vector_protocol_mode
Definition hal_mac_rom.h:158
osal_u32 tx_vector_preamble_boost_flag
Definition hal_mac_rom.h:160
osal_u32 tx_vector_mcs_rate
Definition hal_mac_rom.h:157
osal_u8 wlan_channel_bandwidth_enum_uint8
Definition wlan_types_base_rom.h:237
@ WLAN_BAND_2G
Definition wlan_types_base_rom.h:92
@ WLAN_BAND_5G
Definition wlan_types_base_rom.h:93
osal_u8 wlan_channel_band_enum_uint8
Definition wlan_types_base_rom.h:97