• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: mac csa
15 * Create: 2020-7-5
16 */
17 
18 #ifndef HMAC_CSA_AP_H
19 #define HMAC_CSA_AP_H
20 
21 #include "wlan_types_common.h"
22 #include "mac_vap_ext.h"
23 #include "mac_device_ext.h"
24 #ifdef __cplusplus
25 #if __cplusplus
26 extern "C" {
27 #endif
28 #endif
29 /* CSA调试开关相关的结构体 */
30 typedef struct {
31     osal_bool mode;
32     osal_u8 channel;
33     osal_u8 cnt;
34     wlan_channel_bandwidth_enum_uint8 en_bandwidth;
35     mac_csa_flag_enum_uint8 debug_flag; /* 0:正常切信道; 1:仅beacon帧中含有csa,信道不切换;2:取消beacon帧中含有csa */
36     osal_u8 reserv[3];              /* 预留3字节对齐 */
37 } mac_csa_debug_stru;
38 
39 /* 带宽调试开关相关的结构体 */
40 typedef struct {
41     osal_u32            cmd_bit_map;
42     oal_bool_enum_uint8 band_force_switch_bit0;         /* 恢复40M带宽命令 */
43     oal_bool_enum_uint8 en_2040_ch_swt_proosal_bit1;    /* 不允许20/40带宽切换开关 */
44     oal_bool_enum_uint8 intolerant_40_bit2;             /* 不容忍40M带宽开关 */
45     osal_u8 resv;
46     mac_csa_debug_stru  csa_debug_bit3;
47     oal_bool_enum_uint8 lsigtxop_bit5;  /* lsigtxop使能 */
48     osal_u8             resv0[3];       /* 预留3字节对齐 */
49 } mac_protocol_debug_switch_stru;
50 
51 typedef struct {
52     osal_u8 announced_channel;                             /* 新信道号 */
53     wlan_channel_bandwidth_enum_uint8 announced_bandwidth; /* 新带宽模式 */
54     osal_u8 ch_switch_cnt;                                 /* 信道切换计数 */
55     osal_bool delay_update_switch_cnt;                     /* 标记是否延迟更新switch cnt */
56     wlan_ch_switch_status_enum_uint8 ch_switch_status;     /* 信道切换状态 */
57     oal_bool_enum_uint8 csa_present_in_bcn;                /* Beacon帧中是否包含CSA IE */
58     osal_bool csa_mode; /* 0:csa期间允许发包 1:csa期间不允许发包 */
59     osal_u8 resv;
60 } hmac_csa_ap_info_stru;
61 
62 /*****************************************************************************
63   对外函数声明
64 *****************************************************************************/
65 typedef osal_bool (*hmac_csa_ap_is_ch_switch_cb)(osal_u8 vap_id);
66 typedef osal_void (*hmac_csa_ap_encap_beacon_csa_ie_cb)(hmac_vap_stru *hmac_vap, osal_u8 *buffer,
67     osal_u8 *ie_len);
68 typedef oal_bool_enum_uint8 (*hmac_csa_ap_csa_present_in_bcn_cb)(osal_u8 vap_id);
69 typedef osal_void (*hmac_csa_ap_switch_new_channel_cb)(hmac_vap_stru *hmac_vap, osal_u8 channel,
70     wlan_channel_bandwidth_enum_uint8 en_bandwidth, osal_bool disable_tx, osal_u8 switch_cnt);
71 
72 static osal_u32 hmac_csa_ap_init_weakref(osal_void)
73     __attribute__ ((weakref("hmac_csa_ap_init"), used));
74 static osal_void hmac_csa_ap_deinit_weakref(osal_void)
75     __attribute__ ((weakref("hmac_csa_ap_deinit"), used));
76 #ifdef __cplusplus
77 #if __cplusplus
78 }
79 #endif
80 #endif
81 
82 #endif
83