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 * 文 件 名 : hmac_device.h
15 * 生成日期 : 2015年1月31日
16 * 功能描述 : hmac_device.c 的头文件,包括hmac device结构的定义
17 */
18
19 #ifndef __HMAC_DEVICE_H__
20 #define __HMAC_DEVICE_H__
21
22 /*****************************************************************************
23 1 其他头文件包含
24 *****************************************************************************/
25 #include "wlan_spec.h"
26 #include "dmac_ext_if_hcm.h"
27 #include "mac_vap_ext.h"
28 #ifdef _PRE_WLAN_TCP_OPT
29 #include "hmac_tcp_opt_struc.h"
30 #include "hcc_host_if.h"
31 #endif
32
33 #ifdef __cplusplus
34 #if __cplusplus
35 extern "C" {
36 #endif
37 #endif
38
39 #undef THIS_FILE_ID
40 #define THIS_FILE_ID OAM_FILE_ID_HMAC_DEVICE_H
41 /*****************************************************************************
42 2 宏定义
43 *****************************************************************************/
44 #define MAX_MAC_ERR_IN_TBTT 5 /* 每一个tbtt间隙允许出现的最大错误数 */
45
46 // 新用户关联rssi门限为a,已关联用户被剔除rssi门限为b,a = b+HMAC_RSSI_LIMIT_DELTA; 配置命令传进来的为b, delta默认为5,可修改
47 #define HMAC_RSSI_LIMIT_DELTA 5
48
49 #ifdef _PRE_WLAN_TCP_OPT
50 #define HCC_TRANS_THREAD_POLICY SCHED_FIFO
51 #define HCC_TRANS_THERAD_PRIORITY (10)
52 #define HCC_TRANS_THERAD_NICE (-10)
53 #endif
54
55 #define is_equal_rates(rate1, rate2) (((rate1) & 0x7f) == ((rate2) & 0x7f))
56
57 typedef enum {
58 HMAC_ACS_TYPE_INIT = 0, /* 初始自动信道选择 */
59 HMAC_ACS_TYPE_CMD = 1, /* 命令触发的自动信道选择 */
60 HMAC_ACS_TYPE_FREE = 2, /* 空闲的自动信道选择 */
61 } hmac_acs_type_enum;
62 typedef osal_u8 hmac_acs_type_enum_uint8;
63 /*****************************************************************************
64 4 全局变量声明
65 *****************************************************************************/
66
67
68 /*****************************************************************************
69 5 消息头定义
70 *****************************************************************************/
71
72
73 /*****************************************************************************
74 6 消息定义
75 *****************************************************************************/
76
77
78 /*****************************************************************************
79 7 STRUCT定义
80 *****************************************************************************/
81
82 /* 存储每个扫描到的bss信息 */
83 typedef struct {
84 struct osal_list_head dlist_head; /* 链表指针 */
85 mac_bss_dscr_stru bss_dscr_info; /* bss描述信息,包括上报的管理帧 */
86 } hmac_scanned_bss_info;
87
88 /*****************************************************************************
89 8 UNION定义
90 *****************************************************************************/
91
92
93 /*****************************************************************************
94 9 OTHERS定义
95 *****************************************************************************/
96 extern osal_u32 hmac_board_exit_etc(mac_board_stru *board);
97
98 extern osal_u32 hmac_board_init_etc(mac_board_stru *board);
99
hmac_fcs_get_mgr_stru(hmac_device_stru * hmac_device)100 static INLINE__ mac_fcs_mgr_stru *hmac_fcs_get_mgr_stru(hmac_device_stru *hmac_device)
101 {
102 return &hmac_device->fcs_mgr;
103 }
104
105 /*****************************************************************************
106 10.1 公共结构体初始化、删除
107 *****************************************************************************/
108 osal_void hmac_board_exit(osal_void);
109 osal_u32 hmac_board_init(osal_void);
110 /*****************************************************************************
111 10.2 公共成员访问部分
112 *****************************************************************************/
113 hal_to_dmac_device_stru *hmac_device_get_another_h2d_dev(const hmac_device_stru *hmac_device,
114 const hal_to_dmac_device_stru *ori_hal_dev);
115 osal_u8 hmac_device_check_fake_queues_empty(osal_void);
116 osal_s32 hmac_config_reset_mac_phy(hmac_vap_stru *hmac_vap, frw_msg *msg);
117 #ifdef __cplusplus
118 #if __cplusplus
119 }
120 #endif
121 #endif
122
123 #endif /* end of mac_device.h */
124