1 /* 2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 19 #ifndef __HMAC_DEVICE_H__ 20 #define __HMAC_DEVICE_H__ 21 22 /* **************************************************************************** 23 1 其他头文件包含 24 **************************************************************************** */ 25 #include "oal_ext_if.h" 26 #include "oam_ext_if.h" 27 #include "frw_timer.h" 28 #include "mac_vap.h" 29 #include "hmac_config.h" 30 31 #ifdef __cplusplus 32 #if __cplusplus 33 extern "C" { 34 #endif 35 #endif 36 37 /* **************************************************************************** 38 2 宏定义 39 **************************************************************************** */ 40 /* **************************************************************************** 41 7 STRUCT定义 42 **************************************************************************** */ 43 /* 存储每个扫描到的bss信息 */ 44 typedef struct { 45 hi_list dlist_head; /* 链表指针 */ 46 mac_bss_dscr_stru bss_dscr_info; /* bss描述信息,包括上报的管理帧 */ 47 } hmac_scanned_bss_info; 48 49 /* 存储在hmac device下的扫描结果维护的结构体 */ 50 typedef struct { 51 oal_spin_lock_stru st_lock; 52 hi_list bss_list_head; 53 hi_u32 bss_num; 54 } hmac_bss_mgmt_stru; 55 56 /* 扫描运行结果记录 */ 57 typedef struct { 58 hmac_bss_mgmt_stru bss_mgmt; /* 存储扫描BSS结果的管理结构 */ 59 hi_u8 chan_numbers; /* 此次扫描总共需要扫描的信道个数 */ 60 hi_u8 vap_id; /* 本次执行扫描的vap id */ 61 mac_scan_status_enum_uint8 scan_rsp_status; /* 本次扫描完成返回的状态码,是成功还是被拒绝 */ 62 mac_vap_state_enum_uint8 vap_last_state; /* 保存VAP进入扫描前的状态,AP/P2P GO模式下20/40M扫描专用 */ 63 64 mac_scan_cb_fn fn_cb; /* 此次扫描结束的回调函数指针 */ 65 hi_u8 is_any_scan; 66 hi_u8 resv[3]; /* 3 保留字节 */ 67 hi_u64 ull_cookie; /* 保存P2P 监听结束上报的cookie 值 */ 68 } hmac_scan_record_stru; 69 70 /* 扫描相关相关控制信息 */ 71 typedef struct { 72 /* scan 相关控制信息 */ 73 hi_u8 is_scanning; /* host侧的扫描请求是否正在执行 */ 74 hi_u8 is_random_mac_addr_scan; /* 是否为随机mac addr扫描,默认关闭(定制化宏开启下废弃) */ 75 hi_u8 complete; /* 内核普通扫描请求是否完成标志 */ 76 hi_u8 sched_scan_complete; /* 调度扫描是否正在运行标记 */ 77 oal_spin_lock_stru st_scan_request_spinlock; /* 内核下发的request资源锁 */ 78 79 oal_cfg80211_scan_request_stru *request; /* 内核下发的扫描请求结构体 */ 80 oal_cfg80211_sched_scan_request_stru *sched_scan_req; /* 内核下发的调度扫描请求结构体 */ 81 82 frw_timeout_stru scan_timeout; /* 扫描模块host侧的超时保护所使用的定时器 */ 83 /* 扫描运行记录管理信息,包括扫描结果和发起扫描者的相关信息 */ 84 hmac_scan_record_stru scan_record_mgmt; 85 mac_channel_stru p2p_listen_channel; 86 /* 记录请求信道列表的map,11b模式下收到非当前信道扫描帧过滤使用,5g管理帧不使用11b速率 */ 87 hi_u32 scan_2g_ch_list_map; 88 } hmac_scan_stru; 89 90 typedef struct { 91 frw_timeout_stru rx_dscr_opt_timer; /* rx_dscr调整定时器 */ 92 hi_u32 rx_pkt_num; 93 hi_u32 rx_pkt_opt_limit; 94 hi_u32 rx_pkt_reset_limit; 95 96 hi_u8 dscr_opt_state; /* TRUE表示已调整 */ 97 hi_u8 dscr_opt_enable; 98 hi_u8 resv[2]; /* 2 保留字节 */ 99 } hmac_rx_dscr_opt_stru; 100 101 /* hmac device结构体,记录只保存在hmac的device公共信息 */ 102 typedef struct { 103 hmac_scan_stru scan_mgmt; /* 扫描管理结构体 */ 104 hi_u32 p2p_intf_status; 105 oal_wait_queue_head_stru netif_change_event; 106 hi_u8 auc_rx_ba_lut_idx_table[DMAC_BA_LUT_IDX_BMAP_LEN]; /* 接收端LUT表 */ 107 #ifndef _PRE_WLAN_FEATURE_AMPDU_VAP 108 hi_u8 rx_ba_session_num; /* 该device下,rx BA会话的数目 */ 109 hi_u8 tx_ba_session_num; /* 该device下,tx BA会话的数目 */ 110 #endif 111 #ifdef _PRE_WLAN_FEATURE_PKT_MEM_OPT 112 hmac_rx_dscr_opt_stru rx_dscr_opt; 113 #endif 114 #ifdef _PRE_WLAN_FEATURE_BTCOEX 115 d2h_btcoex_delba_event_stru d2h_btcoex_delba; 116 #endif 117 hi_u8 resv1[4]; /* 4 BYTE 保留字段 */ 118 } hmac_device_stru; 119 120 /* **************************************************************************** 121 8 UNION定义 122 **************************************************************************** */ 123 /* **************************************************************************** 124 9 OTHERS定义 125 **************************************************************************** */ 126 hmac_device_stru *hmac_get_device_stru(hi_void); 127 hi_u32 hmac_device_init(hi_void); 128 hi_u32 hmac_device_exit(hi_void); 129 #if (_PRE_MULTI_CORE_MODE == _PRE_MULTI_CORE_MODE_OFFLOAD_DMAC) 130 hi_u32 hmac_config_host_dev_init(mac_vap_stru *mac_vap, hi_u16 len, const hi_u8 *param); 131 hi_u32 hmac_config_host_dev_exit(mac_vap_stru *pst_mac_vap, hi_u16 len, const hi_u8 *param); 132 #endif 133 134 #ifdef __cplusplus 135 #if __cplusplus 136 } 137 #endif 138 #endif 139 140 #endif /* __HMAC_DEVICE_H__ */ 141