WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hmac_dfs.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2014-2023. All rights reserved.
3 * 文 件 名 : hmac_dfs.h
4 * 生成日期 : 2014年10月16日
5 * 功能描述 : hmac_dfs.c 的头文件
6 */
7
8#ifndef __HMAC_DFS_H__
9#define __HMAC_DFS_H__
10
11#ifdef _PRE_WLAN_FEATURE_DFS
12
13/*****************************************************************************
14 1 其他头文件包含
15*****************************************************************************/
16#include "oal_ext_if.h"
17#include "frw_ext_if.h"
18#include "mac_device_ext.h"
19#include "hmac_vap.h"
20#include "hmac_scan.h"
21#include "hmac_feature_main.h"
22
23#ifdef __cplusplus
24#if __cplusplus
25extern "C" {
26#endif
27#endif
28
29#undef THIS_FILE_ID
30#define THIS_FILE_ID OAM_FILE_ID_HMAC_DFS_H
31
32/*****************************************************************************
33 2 宏定义
34*****************************************************************************/
35#define HMAC_DFS_ONE_SEC_IN_MS 1000
36#define HMAC_DFS_ONE_MIN_IN_MS (60 * HMAC_DFS_ONE_SEC_IN_MS)
37
38/* CAC检测时长,5600MHz ~ 5650MHz频段外,默认60秒 */
39#define HMAC_DFS_CAC_OUTOF_5600_TO_5650_MHZ_TIME_MS HMAC_DFS_ONE_MIN_IN_MS
40
41/* CAC检测时长,5600MHz ~ 5650MHz频段内,默认10分钟 */
42#define HMAC_DFS_CAC_IN_5600_TO_5650_MHZ_TIME_MS (10 * HMAC_DFS_ONE_MIN_IN_MS)
43
44/* Off-Channel CAC检测时长,5600MHz ~ 5650MHz频段外,默认6分钟 */
45#define HMAC_DFS_OFF_CH_CAC_OUTOF_5600_TO_5650_MHZ_TIME_MS (6 * HMAC_DFS_ONE_MIN_IN_MS)
46
47/* Off-Channel CAC检测时长,5600MHz ~ 5650MHz频段内,默认60分钟 */
48#define HMAC_DFS_OFF_CH_CAC_IN_5600_TO_5650_MHZ_TIME_MS (60 * HMAC_DFS_ONE_MIN_IN_MS)
49
50/* Non-Occupancy Period时长,默认30分钟 */
51#define HMAC_DFS_NON_OCCUPANCY_PERIOD_TIME_MS (30 * HMAC_DFS_ONE_MIN_IN_MS)
52
53/* Off-Channel CAC在工作信道上的驻留时长 */
54#define HMAC_DFS_OFF_CHAN_CAC_PERIOD_TIME_MS 15
55
56/* Off-channel CAC在Off-channel信道上的驻留时长 */
57#define HMAC_DFS_OFF_CHAN_CAC_DWELL_TIME_MS 30
58
59#if defined (_PRE_WLAN_FEATURE_DFS_OPTIMIZE) || defined (_PRE_WLAN_FEATURE_DFS_ENABLE)
60#define ETSI_RADAR_CHIRP_CNT 1 /* ETSI chirp雷达中断阈值 */
61#define FCC_RADAR_CHIRP_CNT 3 /* FCC chirp雷达中断阈值 */
62#define MKK_RADAR_CHIRP_CNT 3 /* MKK chirp雷达中断阈值 */
63#else
64#define ETSI_RADAR_CHIRP_CNT 3 /* ETSI chirp雷达中断阈值 */
65#define FCC_RADAR_CHIRP_CNT 4 /* FCC chirp雷达中断阈值 */
66#define MKK_RADAR_CHIRP_CNT 4 /* MKK chirp雷达中断阈值 */
67#endif
68
69#define DFS_CAC_CTRL_TX_CLOSE_WITH_VAP_PAUSE 0
70#define DFS_CAC_CTRL_TX_OPEN_WITH_VAP_UP 1
71#define DFS_CAC_CTRL_TX_OPEN 2
72#define DFS_CAC_CTRL_TX_CLOSE 3
73/*****************************************************************************
74 3 枚举定义
75*****************************************************************************/
76
77/*****************************************************************************
78 4 全局变量声明
79*****************************************************************************/
80
81/*****************************************************************************
82 5 消息头定义
83*****************************************************************************/
84
85/*****************************************************************************
86 6 消息定义
87*****************************************************************************/
88
89/*****************************************************************************
90 7 STRUCT定义
91*****************************************************************************/
92typedef oal_bool_enum_uint8 (*p_dmac_radar_filter_cb)(frw_msg *msg);
93typedef struct {
94 p_dmac_radar_filter_cb hmac_radar_filter;
95} hmac_chan_mgmt_rom_cb;
96
97typedef struct {
98 oal_bool_enum_uint8 dfs_switch; /* DFS使能开关
99 bit0:dfs使能,
100 bit1:标示AP因为DFS特性暂时处于邋wait_start */
101 oal_bool_enum_uint8 cac_switch;
102 oal_bool_enum_uint8 offchan_cac_switch;
103 osal_u8 debug_level; /* bit0:打印雷达带业务,bit1:打印雷达无业务 */
104 osal_u8 offchan_flag; /* bit0:0表示homechan,1表示offchan;
105 bit1:0表示普通,1表示offchancac */
106 osal_u8 offchan_num;
107 osal_u8 timer_cnt;
108 osal_u8 timer_end_cnt;
109 osal_u8 cts_duration;
110 osal_u8 hmac_channel_flag; /* dmac用于标示当前信道off or home */
111 oal_bool_enum_uint8 dfs_init;
112 osal_u8 custom_next_chnum; /* 应用层指定的DFS下一跳信道号 */
113 osal_u32 dfs_cac_outof_5600_to_5650_time_ms; /* CAC检测时长.5600MHz ~ 5650MHz频段外.默认60秒 */
114 osal_u32 dfs_cac_in_5600_to_5650_time_ms; /* CAC检测时长.5600MHz ~ 5650MHz频段内.默认10分钟 */
115 osal_u32 off_chan_cac_outof_5600_to_5650_time_ms; /* Off-Channel CAC检测时长
116 5600MHz ~ 5650MHz频段外.默认6分钟 */
117 osal_u32 off_chan_cac_in_5600_to_5650_time_ms; /* Off-Channel CAC检测时长
118 5600MHz ~ 5650MHz频段内.默认60分钟 */
119 osal_u16 dfs_off_chan_cac_opern_chan_dwell_time; /* Off-channel CAC在工作信道上驻留时长 */
120 osal_u16 dfs_off_chan_cac_off_chan_dwell_time; /* Off-channel CAC在Off-Channel信道上驻留时长 */
121 osal_u32 radar_detected_timestamp;
122 osal_s32 l_radar_th; /* 设置的雷达检测门限,单位db */
123
124 osal_u32 custom_chanlist_bitmap; /* 应用层同步下来的信道列表
125 (0x0000000F 36-48) (0x000000F0 52-64)
126 (0x000FFF00 100-144) (0x01F00000 149-165) */
127 wlan_channel_bandwidth_enum_uint8 next_ch_width_type; /* 设置的下一跳信道的带宽模式 */
128 osal_u8 uac_resv[3];
129 osal_u32 dfs_non_occupancy_period_time_ms;
130 osal_u8 _rom[4];
131} mac_dfs_info_stru;
132
133typedef struct {
134 osal_u8 chan_idx; /* 信道索引 */
135 osal_u8 device_id; /* device id */
136 osal_u8 auc_resv[2];
137 frw_timeout_stru dfs_nol_timer; /* NOL节点定时器 */
138 struct osal_list_head entry; /* NOL链表 */
139} mac_dfs_nol_node_stru;
140
141typedef struct {
142 frw_timeout_stru dfs_cac_timer; /* CAC定时器 */
143 frw_timeout_stru dfs_off_chan_cac_timer; /* Off-Channel CAC定时器 */
144 frw_timeout_stru dfs_chan_dwell_timer; /* 信道驻留定时器,定时器到期,切离该信道 */
145 frw_timeout_stru dfs_radar_timer;
146 mac_dfs_info_stru dfs_info;
147 struct osal_list_head dfs_nol;
148 osal_u16 dfs_timeout;
149 osal_u8 resv[2]; /* 保留2字节对齐 */
150 osal_u32 dfs_cnt; /* 检测到的雷达个数 */
151} mac_dfs_core_stru;
152/*****************************************************************************
153 8 UNION定义
154*****************************************************************************/
155
156/*****************************************************************************
157 9 OTHERS定义
158*****************************************************************************/
159
160
161/*****************************************************************************
162 10 函数声明
163*****************************************************************************/
164extern osal_void hmac_dfs_init(hmac_device_stru *hmac_device);
165extern osal_void hmac_dfs_deinit(hmac_device_stru *hmac_device);
166extern osal_void hmac_dfs_channel_list_init_etc(hmac_device_stru *hmac_device);
167extern osal_u32 hmac_dfs_recalculate_channel_etc(hmac_device_stru *hmac_device, osal_u8 *freq,
168 wlan_channel_bandwidth_enum_uint8 *pen_bandwidth);
169extern osal_void hmac_dfs_cac_start_etc(hmac_device_stru *hmac_device, hmac_vap_stru *hmac_vap);
170extern osal_void hmac_dfs_cac_stop_etc(hmac_device_stru *hmac_device, hmac_vap_stru *hmac_vap, osal_u8 cac_tx_en);
171extern osal_void hmac_dfs_off_cac_stop_etc(hmac_device_stru *hmac_device, hmac_vap_stru *hmac_vap);
172extern osal_s32 hmac_dfs_radar_detect_event_etc(hmac_vap_stru *hmac_vap);
173extern osal_u32 hmac_dfs_radar_detect_event_test(osal_u8 vap_id);
174extern osal_u32 hmac_dfs_ap_wait_start_radar_handler_etc(hmac_vap_stru *hmac_vap);
175extern osal_u32 hmac_dfs_ap_up_radar_handler_etc(hmac_vap_stru *hmac_vap);
176extern osal_void hmac_dfs_radar_wait_etc(hmac_device_stru *hmac_device, hmac_vap_stru *hmac_vap);
177extern osal_void test_dfs(osal_u8 vap_id);
178extern osal_u32 hmac_dfs_start_bss_etc(hmac_vap_stru *hmac_vap);
179extern osal_void hmac_dfs_off_chan_cac_start_etc(hmac_device_stru *hmac_device, hmac_vap_stru *hmac_vap);
180extern oal_bool_enum_uint8 hmac_dfs_try_cac_etc(hmac_device_stru *hmac_device, hmac_vap_stru *hmac_vap);
181extern osal_u32 hmac_dfs_init_scan_hook_etc(hmac_scan_record_stru *scan_record,
182 hmac_device_stru *hmac_device);
183extern oal_bool_enum_uint8 mac_vap_get_dfs_enable(hmac_vap_stru *hmac_vap);
184void mac_dfs_set_cac_enable(hmac_device_stru *hmac_device, oal_bool_enum_uint8 val);
185void mac_dfs_set_offchan_cac_enable(hmac_device_stru *hmac_device, oal_bool_enum_uint8 val);
186oal_bool_enum_uint8 mac_dfs_get_offchan_cac_enable(hmac_device_stru *hmac_device);
187oal_bool_enum_uint8 mac_dfs_get_cac_enable(hmac_device_stru *hmac_device);
188void mac_dfs_set_dfs_enable(hmac_device_stru *hmac_device, oal_bool_enum_uint8 val);
189oal_bool_enum_uint8 mac_dfs_get_dfs_enable( hmac_device_stru *hmac_device);
190void mac_dfs_set_debug_level(hmac_device_stru *hmac_device, osal_u8 debug_lev);
191osal_u8 mac_dfs_get_debug_level(hmac_device_stru *hmac_device);
192osal_void hmac_dfs_radar_detect_check(hal_to_dmac_device_stru *hal_device, hmac_device_stru *hmac_device,
193 const hmac_vap_stru *hmac_vap);
194osal_s32 hmac_cac_chan_ctrl_machw_tx_event_process(hmac_vap_stru *hmac_vap, osal_u8 cac_machw_en);
195osal_s32 hmac_dfs_radar_detect_event(hmac_vap_stru *hmac_vap, frw_msg *msg);
196osal_s32 hmac_config_set_country_for_dfs(hmac_vap_stru *hmac_vap, frw_msg *msg);
197osal_void hmac_config_cali_dfs_handle(hal_to_dmac_device_stru *hal_device, hmac_vap_stru *hmac_vap,
198 const hmac_device_stru *hmac_device);
199extern osal_void hmac_cac_chan_ctrl_machw_tx(hmac_vap_stru *hmac_vap, osal_u8 cac_machw_en);
200osal_bool hmac_is_dfs_with_dbac_check(const hmac_vap_stru *hmac_vap, const hmac_device_stru *mac_device,
201 const osal_u8 channel);
202oal_bool_enum_uint8 hmac_dfs_need_for_cac(hmac_device_stru *hmac_device, hmac_vap_stru *hmac_vap);
203#ifdef __cplusplus
204#if __cplusplus
205}
206#endif
207#endif
208
209#endif /* end of _PRE_WLAN_FEATURE_DFS */
210
211#endif /* end of hmac_dfs.h */
osal_u8 oal_bool_enum_uint8
Definition oal_types_device_rom.h:45
int osal_s32
Definition osal_types.h:19
unsigned char osal_u8
Definition osal_types.h:11
osal_u8 osal_bool
Definition osal_types.h:27
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 frw_msg_rom.h:74
Definition frw_ext_common_rom.h:20
Definition mac_device_ext.h:856
Definition mac_device_ext.h:545
Definition mac_vap_ext.h:2019
Definition osal_list.h:39
Definition hal_ops_common_rom.h:529
osal_u8 wlan_channel_bandwidth_enum_uint8
Definition wlan_types_base_rom.h:237