18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * NXP Wireless LAN device driver: major data structures and prototypes 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Copyright 2011-2020 NXP 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * This software file (the "File") is distributed by NXP 78c2ecf20Sopenharmony_ci * under the terms of the GNU General Public License Version 2, June 1991 88c2ecf20Sopenharmony_ci * (the "License"). You may use, redistribute and/or modify this File in 98c2ecf20Sopenharmony_ci * accordance with the terms and conditions of the License, a copy of which 108c2ecf20Sopenharmony_ci * is available by writing to the Free Software Foundation, Inc., 118c2ecf20Sopenharmony_ci * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the 128c2ecf20Sopenharmony_ci * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE 158c2ecf20Sopenharmony_ci * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 168c2ecf20Sopenharmony_ci * ARE EXPRESSLY DISCLAIMED. The License provides additional details about 178c2ecf20Sopenharmony_ci * this warranty disclaimer. 188c2ecf20Sopenharmony_ci */ 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#ifndef _MWIFIEX_MAIN_H_ 218c2ecf20Sopenharmony_ci#define _MWIFIEX_MAIN_H_ 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#include <linux/completion.h> 248c2ecf20Sopenharmony_ci#include <linux/kernel.h> 258c2ecf20Sopenharmony_ci#include <linux/module.h> 268c2ecf20Sopenharmony_ci#include <linux/sched.h> 278c2ecf20Sopenharmony_ci#include <linux/semaphore.h> 288c2ecf20Sopenharmony_ci#include <linux/ip.h> 298c2ecf20Sopenharmony_ci#include <linux/skbuff.h> 308c2ecf20Sopenharmony_ci#include <linux/if_arp.h> 318c2ecf20Sopenharmony_ci#include <linux/etherdevice.h> 328c2ecf20Sopenharmony_ci#include <net/sock.h> 338c2ecf20Sopenharmony_ci#include <net/lib80211.h> 348c2ecf20Sopenharmony_ci#include <linux/vmalloc.h> 358c2ecf20Sopenharmony_ci#include <linux/firmware.h> 368c2ecf20Sopenharmony_ci#include <linux/ctype.h> 378c2ecf20Sopenharmony_ci#include <linux/of.h> 388c2ecf20Sopenharmony_ci#include <linux/idr.h> 398c2ecf20Sopenharmony_ci#include <linux/inetdevice.h> 408c2ecf20Sopenharmony_ci#include <linux/devcoredump.h> 418c2ecf20Sopenharmony_ci#include <linux/err.h> 428c2ecf20Sopenharmony_ci#include <linux/gpio.h> 438c2ecf20Sopenharmony_ci#include <linux/gfp.h> 448c2ecf20Sopenharmony_ci#include <linux/interrupt.h> 458c2ecf20Sopenharmony_ci#include <linux/io.h> 468c2ecf20Sopenharmony_ci#include <linux/of_gpio.h> 478c2ecf20Sopenharmony_ci#include <linux/of_platform.h> 488c2ecf20Sopenharmony_ci#include <linux/platform_device.h> 498c2ecf20Sopenharmony_ci#include <linux/pm_runtime.h> 508c2ecf20Sopenharmony_ci#include <linux/slab.h> 518c2ecf20Sopenharmony_ci#include <linux/of_irq.h> 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci#include "decl.h" 548c2ecf20Sopenharmony_ci#include "ioctl.h" 558c2ecf20Sopenharmony_ci#include "util.h" 568c2ecf20Sopenharmony_ci#include "fw.h" 578c2ecf20Sopenharmony_ci#include "pcie.h" 588c2ecf20Sopenharmony_ci#include "usb.h" 598c2ecf20Sopenharmony_ci#include "sdio.h" 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ciextern const char driver_version[]; 628c2ecf20Sopenharmony_ciextern bool mfg_mode; 638c2ecf20Sopenharmony_ciextern bool aggr_ctrl; 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_cistruct mwifiex_adapter; 668c2ecf20Sopenharmony_cistruct mwifiex_private; 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_cienum { 698c2ecf20Sopenharmony_ci MWIFIEX_ASYNC_CMD, 708c2ecf20Sopenharmony_ci MWIFIEX_SYNC_CMD 718c2ecf20Sopenharmony_ci}; 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci#define MWIFIEX_DRIVER_MODE_STA BIT(0) 748c2ecf20Sopenharmony_ci#define MWIFIEX_DRIVER_MODE_UAP BIT(1) 758c2ecf20Sopenharmony_ci#define MWIFIEX_DRIVER_MODE_P2P BIT(2) 768c2ecf20Sopenharmony_ci#define MWIFIEX_DRIVER_MODE_BITMASK (BIT(0) | BIT(1) | BIT(2)) 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci#define MWIFIEX_MAX_AP 64 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci#define MWIFIEX_MAX_PKTS_TXQ 16 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci#define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ) 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci#define MWIFIEX_TIMER_10S 10000 858c2ecf20Sopenharmony_ci#define MWIFIEX_TIMER_1S 1000 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci#define MAX_TX_PENDING 400 888c2ecf20Sopenharmony_ci#define LOW_TX_PENDING 380 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci#define HIGH_RX_PENDING 50 918c2ecf20Sopenharmony_ci#define LOW_RX_PENDING 20 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci#define MWIFIEX_UPLD_SIZE (2312) 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci#define MAX_EVENT_SIZE 2048 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci#define MWIFIEX_FW_DUMP_SIZE (2 * 1024 * 1024) 988c2ecf20Sopenharmony_ci 998c2ecf20Sopenharmony_ci#define ARP_FILTER_MAX_BUF_SIZE 68 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci#define MWIFIEX_KEY_BUFFER_SIZE 16 1028c2ecf20Sopenharmony_ci#define MWIFIEX_DEFAULT_LISTEN_INTERVAL 10 1038c2ecf20Sopenharmony_ci#define MWIFIEX_MAX_REGION_CODE 9 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci#define DEFAULT_BCN_AVG_FACTOR 8 1068c2ecf20Sopenharmony_ci#define DEFAULT_DATA_AVG_FACTOR 8 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ci#define FIRST_VALID_CHANNEL 0xff 1098c2ecf20Sopenharmony_ci#define DEFAULT_AD_HOC_CHANNEL 6 1108c2ecf20Sopenharmony_ci#define DEFAULT_AD_HOC_CHANNEL_A 36 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ci#define DEFAULT_BCN_MISS_TIMEOUT 5 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci#define MAX_SCAN_BEACON_BUFFER 8000 1158c2ecf20Sopenharmony_ci 1168c2ecf20Sopenharmony_ci#define SCAN_BEACON_ENTRY_PAD 6 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ci#define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 110 1198c2ecf20Sopenharmony_ci#define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 40 1208c2ecf20Sopenharmony_ci#define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME 40 1218c2ecf20Sopenharmony_ci#define MWIFIEX_DEF_SCAN_CHAN_GAP_TIME 50 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ci#define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI))) 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci#define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S) 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ci#define WPA_GTK_OUI_OFFSET 2 1288c2ecf20Sopenharmony_ci#define RSN_GTK_OUI_OFFSET 2 1298c2ecf20Sopenharmony_ci 1308c2ecf20Sopenharmony_ci#define MWIFIEX_OUI_NOT_PRESENT 0 1318c2ecf20Sopenharmony_ci#define MWIFIEX_OUI_PRESENT 1 1328c2ecf20Sopenharmony_ci 1338c2ecf20Sopenharmony_ci#define PKT_TYPE_MGMT 0xE5 1348c2ecf20Sopenharmony_ci 1358c2ecf20Sopenharmony_ci/* 1368c2ecf20Sopenharmony_ci * Do not check for data_received for USB, as data_received 1378c2ecf20Sopenharmony_ci * is handled in mwifiex_usb_recv for USB 1388c2ecf20Sopenharmony_ci */ 1398c2ecf20Sopenharmony_ci#define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \ 1408c2ecf20Sopenharmony_ci adapter->event_received || \ 1418c2ecf20Sopenharmony_ci adapter->data_received) 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_ci#define MWIFIEX_TYPE_CMD 1 1448c2ecf20Sopenharmony_ci#define MWIFIEX_TYPE_DATA 0 1458c2ecf20Sopenharmony_ci#define MWIFIEX_TYPE_AGGR_DATA 10 1468c2ecf20Sopenharmony_ci#define MWIFIEX_TYPE_EVENT 3 1478c2ecf20Sopenharmony_ci 1488c2ecf20Sopenharmony_ci#define MAX_BITMAP_RATES_SIZE 18 1498c2ecf20Sopenharmony_ci 1508c2ecf20Sopenharmony_ci#define MAX_CHANNEL_BAND_BG 14 1518c2ecf20Sopenharmony_ci#define MAX_CHANNEL_BAND_A 165 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ci#define MAX_FREQUENCY_BAND_BG 2484 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ci#define MWIFIEX_EVENT_HEADER_LEN 4 1568c2ecf20Sopenharmony_ci#define MWIFIEX_UAP_EVENT_EXTRA_HEADER 2 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_ci#define MWIFIEX_TYPE_LEN 4 1598c2ecf20Sopenharmony_ci#define MWIFIEX_USB_TYPE_CMD 0xF00DFACE 1608c2ecf20Sopenharmony_ci#define MWIFIEX_USB_TYPE_DATA 0xBEADC0DE 1618c2ecf20Sopenharmony_ci#define MWIFIEX_USB_TYPE_EVENT 0xBEEFFACE 1628c2ecf20Sopenharmony_ci 1638c2ecf20Sopenharmony_ci/* Threshold for tx_timeout_cnt before we trigger a card reset */ 1648c2ecf20Sopenharmony_ci#define TX_TIMEOUT_THRESHOLD 6 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ci#define MWIFIEX_DRV_INFO_SIZE_MAX 0x40000 1678c2ecf20Sopenharmony_ci 1688c2ecf20Sopenharmony_ci/* Address alignment */ 1698c2ecf20Sopenharmony_ci#define MWIFIEX_ALIGN_ADDR(p, a) (((long)(p) + (a) - 1) & ~((a) - 1)) 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci#define MWIFIEX_MAC_LOCAL_ADMIN_BIT 41 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_ci/** 1748c2ecf20Sopenharmony_ci *enum mwifiex_debug_level - marvell wifi debug level 1758c2ecf20Sopenharmony_ci */ 1768c2ecf20Sopenharmony_cienum MWIFIEX_DEBUG_LEVEL { 1778c2ecf20Sopenharmony_ci MWIFIEX_DBG_MSG = 0x00000001, 1788c2ecf20Sopenharmony_ci MWIFIEX_DBG_FATAL = 0x00000002, 1798c2ecf20Sopenharmony_ci MWIFIEX_DBG_ERROR = 0x00000004, 1808c2ecf20Sopenharmony_ci MWIFIEX_DBG_DATA = 0x00000008, 1818c2ecf20Sopenharmony_ci MWIFIEX_DBG_CMD = 0x00000010, 1828c2ecf20Sopenharmony_ci MWIFIEX_DBG_EVENT = 0x00000020, 1838c2ecf20Sopenharmony_ci MWIFIEX_DBG_INTR = 0x00000040, 1848c2ecf20Sopenharmony_ci MWIFIEX_DBG_IOCTL = 0x00000080, 1858c2ecf20Sopenharmony_ci 1868c2ecf20Sopenharmony_ci MWIFIEX_DBG_MPA_D = 0x00008000, 1878c2ecf20Sopenharmony_ci MWIFIEX_DBG_DAT_D = 0x00010000, 1888c2ecf20Sopenharmony_ci MWIFIEX_DBG_CMD_D = 0x00020000, 1898c2ecf20Sopenharmony_ci MWIFIEX_DBG_EVT_D = 0x00040000, 1908c2ecf20Sopenharmony_ci MWIFIEX_DBG_FW_D = 0x00080000, 1918c2ecf20Sopenharmony_ci MWIFIEX_DBG_IF_D = 0x00100000, 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_ci MWIFIEX_DBG_ENTRY = 0x10000000, 1948c2ecf20Sopenharmony_ci MWIFIEX_DBG_WARN = 0x20000000, 1958c2ecf20Sopenharmony_ci MWIFIEX_DBG_INFO = 0x40000000, 1968c2ecf20Sopenharmony_ci MWIFIEX_DBG_DUMP = 0x80000000, 1978c2ecf20Sopenharmony_ci 1988c2ecf20Sopenharmony_ci MWIFIEX_DBG_ANY = 0xffffffff 1998c2ecf20Sopenharmony_ci}; 2008c2ecf20Sopenharmony_ci 2018c2ecf20Sopenharmony_ci#define MWIFIEX_DEFAULT_DEBUG_MASK (MWIFIEX_DBG_MSG | \ 2028c2ecf20Sopenharmony_ci MWIFIEX_DBG_FATAL | \ 2038c2ecf20Sopenharmony_ci MWIFIEX_DBG_ERROR) 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci__printf(3, 4) 2068c2ecf20Sopenharmony_civoid _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask, 2078c2ecf20Sopenharmony_ci const char *fmt, ...); 2088c2ecf20Sopenharmony_ci#define mwifiex_dbg(adapter, mask, fmt, ...) \ 2098c2ecf20Sopenharmony_ci _mwifiex_dbg(adapter, MWIFIEX_DBG_##mask, fmt, ##__VA_ARGS__) 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_ci#define DEBUG_DUMP_DATA_MAX_LEN 128 2128c2ecf20Sopenharmony_ci#define mwifiex_dbg_dump(adapter, dbg_mask, str, buf, len) \ 2138c2ecf20Sopenharmony_cido { \ 2148c2ecf20Sopenharmony_ci if ((adapter)->debug_mask & MWIFIEX_DBG_##dbg_mask) \ 2158c2ecf20Sopenharmony_ci print_hex_dump(KERN_DEBUG, str, \ 2168c2ecf20Sopenharmony_ci DUMP_PREFIX_OFFSET, 16, 1, \ 2178c2ecf20Sopenharmony_ci buf, len, false); \ 2188c2ecf20Sopenharmony_ci} while (0) 2198c2ecf20Sopenharmony_ci 2208c2ecf20Sopenharmony_ci/** Min BGSCAN interval 15 second */ 2218c2ecf20Sopenharmony_ci#define MWIFIEX_BGSCAN_INTERVAL 15000 2228c2ecf20Sopenharmony_ci/** default repeat count */ 2238c2ecf20Sopenharmony_ci#define MWIFIEX_BGSCAN_REPEAT_COUNT 6 2248c2ecf20Sopenharmony_ci 2258c2ecf20Sopenharmony_cistruct mwifiex_dbg { 2268c2ecf20Sopenharmony_ci u32 num_cmd_host_to_card_failure; 2278c2ecf20Sopenharmony_ci u32 num_cmd_sleep_cfm_host_to_card_failure; 2288c2ecf20Sopenharmony_ci u32 num_tx_host_to_card_failure; 2298c2ecf20Sopenharmony_ci u32 num_event_deauth; 2308c2ecf20Sopenharmony_ci u32 num_event_disassoc; 2318c2ecf20Sopenharmony_ci u32 num_event_link_lost; 2328c2ecf20Sopenharmony_ci u32 num_cmd_deauth; 2338c2ecf20Sopenharmony_ci u32 num_cmd_assoc_success; 2348c2ecf20Sopenharmony_ci u32 num_cmd_assoc_failure; 2358c2ecf20Sopenharmony_ci u32 num_tx_timeout; 2368c2ecf20Sopenharmony_ci u16 timeout_cmd_id; 2378c2ecf20Sopenharmony_ci u16 timeout_cmd_act; 2388c2ecf20Sopenharmony_ci u16 last_cmd_id[DBG_CMD_NUM]; 2398c2ecf20Sopenharmony_ci u16 last_cmd_act[DBG_CMD_NUM]; 2408c2ecf20Sopenharmony_ci u16 last_cmd_index; 2418c2ecf20Sopenharmony_ci u16 last_cmd_resp_id[DBG_CMD_NUM]; 2428c2ecf20Sopenharmony_ci u16 last_cmd_resp_index; 2438c2ecf20Sopenharmony_ci u16 last_event[DBG_CMD_NUM]; 2448c2ecf20Sopenharmony_ci u16 last_event_index; 2458c2ecf20Sopenharmony_ci u32 last_mp_wr_bitmap[MWIFIEX_DBG_SDIO_MP_NUM]; 2468c2ecf20Sopenharmony_ci u32 last_mp_wr_ports[MWIFIEX_DBG_SDIO_MP_NUM]; 2478c2ecf20Sopenharmony_ci u32 last_mp_wr_len[MWIFIEX_DBG_SDIO_MP_NUM]; 2488c2ecf20Sopenharmony_ci u32 last_mp_curr_wr_port[MWIFIEX_DBG_SDIO_MP_NUM]; 2498c2ecf20Sopenharmony_ci u8 last_sdio_mp_index; 2508c2ecf20Sopenharmony_ci}; 2518c2ecf20Sopenharmony_ci 2528c2ecf20Sopenharmony_cienum MWIFIEX_HARDWARE_STATUS { 2538c2ecf20Sopenharmony_ci MWIFIEX_HW_STATUS_READY, 2548c2ecf20Sopenharmony_ci MWIFIEX_HW_STATUS_INITIALIZING, 2558c2ecf20Sopenharmony_ci MWIFIEX_HW_STATUS_INIT_DONE, 2568c2ecf20Sopenharmony_ci MWIFIEX_HW_STATUS_RESET, 2578c2ecf20Sopenharmony_ci MWIFIEX_HW_STATUS_NOT_READY 2588c2ecf20Sopenharmony_ci}; 2598c2ecf20Sopenharmony_ci 2608c2ecf20Sopenharmony_cienum MWIFIEX_802_11_POWER_MODE { 2618c2ecf20Sopenharmony_ci MWIFIEX_802_11_POWER_MODE_CAM, 2628c2ecf20Sopenharmony_ci MWIFIEX_802_11_POWER_MODE_PSP 2638c2ecf20Sopenharmony_ci}; 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_cistruct mwifiex_tx_param { 2668c2ecf20Sopenharmony_ci u32 next_pkt_len; 2678c2ecf20Sopenharmony_ci}; 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_cienum MWIFIEX_PS_STATE { 2708c2ecf20Sopenharmony_ci PS_STATE_AWAKE, 2718c2ecf20Sopenharmony_ci PS_STATE_PRE_SLEEP, 2728c2ecf20Sopenharmony_ci PS_STATE_SLEEP_CFM, 2738c2ecf20Sopenharmony_ci PS_STATE_SLEEP 2748c2ecf20Sopenharmony_ci}; 2758c2ecf20Sopenharmony_ci 2768c2ecf20Sopenharmony_cienum mwifiex_iface_type { 2778c2ecf20Sopenharmony_ci MWIFIEX_SDIO, 2788c2ecf20Sopenharmony_ci MWIFIEX_PCIE, 2798c2ecf20Sopenharmony_ci MWIFIEX_USB 2808c2ecf20Sopenharmony_ci}; 2818c2ecf20Sopenharmony_ci 2828c2ecf20Sopenharmony_cistruct mwifiex_add_ba_param { 2838c2ecf20Sopenharmony_ci u32 tx_win_size; 2848c2ecf20Sopenharmony_ci u32 rx_win_size; 2858c2ecf20Sopenharmony_ci u32 timeout; 2868c2ecf20Sopenharmony_ci u8 tx_amsdu; 2878c2ecf20Sopenharmony_ci u8 rx_amsdu; 2888c2ecf20Sopenharmony_ci}; 2898c2ecf20Sopenharmony_ci 2908c2ecf20Sopenharmony_cistruct mwifiex_tx_aggr { 2918c2ecf20Sopenharmony_ci u8 ampdu_user; 2928c2ecf20Sopenharmony_ci u8 ampdu_ap; 2938c2ecf20Sopenharmony_ci u8 amsdu; 2948c2ecf20Sopenharmony_ci}; 2958c2ecf20Sopenharmony_ci 2968c2ecf20Sopenharmony_cienum mwifiex_ba_status { 2978c2ecf20Sopenharmony_ci BA_SETUP_NONE = 0, 2988c2ecf20Sopenharmony_ci BA_SETUP_INPROGRESS, 2998c2ecf20Sopenharmony_ci BA_SETUP_COMPLETE 3008c2ecf20Sopenharmony_ci}; 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_cistruct mwifiex_ra_list_tbl { 3038c2ecf20Sopenharmony_ci struct list_head list; 3048c2ecf20Sopenharmony_ci struct sk_buff_head skb_head; 3058c2ecf20Sopenharmony_ci u8 ra[ETH_ALEN]; 3068c2ecf20Sopenharmony_ci u32 is_11n_enabled; 3078c2ecf20Sopenharmony_ci u16 max_amsdu; 3088c2ecf20Sopenharmony_ci u16 ba_pkt_count; 3098c2ecf20Sopenharmony_ci u8 ba_packet_thr; 3108c2ecf20Sopenharmony_ci enum mwifiex_ba_status ba_status; 3118c2ecf20Sopenharmony_ci u8 amsdu_in_ampdu; 3128c2ecf20Sopenharmony_ci u16 total_pkt_count; 3138c2ecf20Sopenharmony_ci bool tdls_link; 3148c2ecf20Sopenharmony_ci bool tx_paused; 3158c2ecf20Sopenharmony_ci}; 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_cistruct mwifiex_tid_tbl { 3188c2ecf20Sopenharmony_ci struct list_head ra_list; 3198c2ecf20Sopenharmony_ci}; 3208c2ecf20Sopenharmony_ci 3218c2ecf20Sopenharmony_ci#define WMM_HIGHEST_PRIORITY 7 3228c2ecf20Sopenharmony_ci#define HIGH_PRIO_TID 7 3238c2ecf20Sopenharmony_ci#define LOW_PRIO_TID 0 3248c2ecf20Sopenharmony_ci#define NO_PKT_PRIO_TID -1 3258c2ecf20Sopenharmony_ci#define MWIFIEX_WMM_DRV_DELAY_MAX 510 3268c2ecf20Sopenharmony_ci 3278c2ecf20Sopenharmony_cistruct mwifiex_wmm_desc { 3288c2ecf20Sopenharmony_ci struct mwifiex_tid_tbl tid_tbl_ptr[MAX_NUM_TID]; 3298c2ecf20Sopenharmony_ci u32 packets_out[MAX_NUM_TID]; 3308c2ecf20Sopenharmony_ci u32 pkts_paused[MAX_NUM_TID]; 3318c2ecf20Sopenharmony_ci /* spin lock to protect ra_list */ 3328c2ecf20Sopenharmony_ci spinlock_t ra_list_spinlock; 3338c2ecf20Sopenharmony_ci struct mwifiex_wmm_ac_status ac_status[IEEE80211_NUM_ACS]; 3348c2ecf20Sopenharmony_ci enum mwifiex_wmm_ac_e ac_down_graded_vals[IEEE80211_NUM_ACS]; 3358c2ecf20Sopenharmony_ci u32 drv_pkt_delay_max; 3368c2ecf20Sopenharmony_ci u8 queue_priority[IEEE80211_NUM_ACS]; 3378c2ecf20Sopenharmony_ci u32 user_pri_pkt_tx_ctrl[WMM_HIGHEST_PRIORITY + 1]; /* UP: 0 to 7 */ 3388c2ecf20Sopenharmony_ci /* Number of transmit packets queued */ 3398c2ecf20Sopenharmony_ci atomic_t tx_pkts_queued; 3408c2ecf20Sopenharmony_ci /* Tracks highest priority with a packet queued */ 3418c2ecf20Sopenharmony_ci atomic_t highest_queued_prio; 3428c2ecf20Sopenharmony_ci}; 3438c2ecf20Sopenharmony_ci 3448c2ecf20Sopenharmony_cistruct mwifiex_802_11_security { 3458c2ecf20Sopenharmony_ci u8 wpa_enabled; 3468c2ecf20Sopenharmony_ci u8 wpa2_enabled; 3478c2ecf20Sopenharmony_ci u8 wapi_enabled; 3488c2ecf20Sopenharmony_ci u8 wapi_key_on; 3498c2ecf20Sopenharmony_ci u8 wep_enabled; 3508c2ecf20Sopenharmony_ci u32 authentication_mode; 3518c2ecf20Sopenharmony_ci u8 is_authtype_auto; 3528c2ecf20Sopenharmony_ci u32 encryption_mode; 3538c2ecf20Sopenharmony_ci}; 3548c2ecf20Sopenharmony_ci 3558c2ecf20Sopenharmony_cistruct ieee_types_header { 3568c2ecf20Sopenharmony_ci u8 element_id; 3578c2ecf20Sopenharmony_ci u8 len; 3588c2ecf20Sopenharmony_ci} __packed; 3598c2ecf20Sopenharmony_ci 3608c2ecf20Sopenharmony_cistruct ieee_types_vendor_specific { 3618c2ecf20Sopenharmony_ci struct ieee_types_vendor_header vend_hdr; 3628c2ecf20Sopenharmony_ci u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)]; 3638c2ecf20Sopenharmony_ci} __packed; 3648c2ecf20Sopenharmony_ci 3658c2ecf20Sopenharmony_cistruct ieee_types_generic { 3668c2ecf20Sopenharmony_ci struct ieee_types_header ieee_hdr; 3678c2ecf20Sopenharmony_ci u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_header)]; 3688c2ecf20Sopenharmony_ci} __packed; 3698c2ecf20Sopenharmony_ci 3708c2ecf20Sopenharmony_cistruct ieee_types_bss_co_2040 { 3718c2ecf20Sopenharmony_ci struct ieee_types_header ieee_hdr; 3728c2ecf20Sopenharmony_ci u8 bss_2040co; 3738c2ecf20Sopenharmony_ci} __packed; 3748c2ecf20Sopenharmony_ci 3758c2ecf20Sopenharmony_cistruct ieee_types_extcap { 3768c2ecf20Sopenharmony_ci struct ieee_types_header ieee_hdr; 3778c2ecf20Sopenharmony_ci u8 ext_capab[8]; 3788c2ecf20Sopenharmony_ci} __packed; 3798c2ecf20Sopenharmony_ci 3808c2ecf20Sopenharmony_cistruct ieee_types_vht_cap { 3818c2ecf20Sopenharmony_ci struct ieee_types_header ieee_hdr; 3828c2ecf20Sopenharmony_ci struct ieee80211_vht_cap vhtcap; 3838c2ecf20Sopenharmony_ci} __packed; 3848c2ecf20Sopenharmony_ci 3858c2ecf20Sopenharmony_cistruct ieee_types_vht_oper { 3868c2ecf20Sopenharmony_ci struct ieee_types_header ieee_hdr; 3878c2ecf20Sopenharmony_ci struct ieee80211_vht_operation vhtoper; 3888c2ecf20Sopenharmony_ci} __packed; 3898c2ecf20Sopenharmony_ci 3908c2ecf20Sopenharmony_cistruct ieee_types_aid { 3918c2ecf20Sopenharmony_ci struct ieee_types_header ieee_hdr; 3928c2ecf20Sopenharmony_ci u16 aid; 3938c2ecf20Sopenharmony_ci} __packed; 3948c2ecf20Sopenharmony_ci 3958c2ecf20Sopenharmony_cistruct mwifiex_bssdescriptor { 3968c2ecf20Sopenharmony_ci u8 mac_address[ETH_ALEN]; 3978c2ecf20Sopenharmony_ci struct cfg80211_ssid ssid; 3988c2ecf20Sopenharmony_ci u32 privacy; 3998c2ecf20Sopenharmony_ci s32 rssi; 4008c2ecf20Sopenharmony_ci u32 channel; 4018c2ecf20Sopenharmony_ci u32 freq; 4028c2ecf20Sopenharmony_ci u16 beacon_period; 4038c2ecf20Sopenharmony_ci u8 erp_flags; 4048c2ecf20Sopenharmony_ci u32 bss_mode; 4058c2ecf20Sopenharmony_ci u8 supported_rates[MWIFIEX_SUPPORTED_RATES]; 4068c2ecf20Sopenharmony_ci u8 data_rates[MWIFIEX_SUPPORTED_RATES]; 4078c2ecf20Sopenharmony_ci /* Network band. 4088c2ecf20Sopenharmony_ci * BAND_B(0x01): 'b' band 4098c2ecf20Sopenharmony_ci * BAND_G(0x02): 'g' band 4108c2ecf20Sopenharmony_ci * BAND_A(0X04): 'a' band 4118c2ecf20Sopenharmony_ci */ 4128c2ecf20Sopenharmony_ci u16 bss_band; 4138c2ecf20Sopenharmony_ci u64 fw_tsf; 4148c2ecf20Sopenharmony_ci u64 timestamp; 4158c2ecf20Sopenharmony_ci union ieee_types_phy_param_set phy_param_set; 4168c2ecf20Sopenharmony_ci union ieee_types_ss_param_set ss_param_set; 4178c2ecf20Sopenharmony_ci u16 cap_info_bitmap; 4188c2ecf20Sopenharmony_ci struct ieee_types_wmm_parameter wmm_ie; 4198c2ecf20Sopenharmony_ci u8 disable_11n; 4208c2ecf20Sopenharmony_ci struct ieee80211_ht_cap *bcn_ht_cap; 4218c2ecf20Sopenharmony_ci u16 ht_cap_offset; 4228c2ecf20Sopenharmony_ci struct ieee80211_ht_operation *bcn_ht_oper; 4238c2ecf20Sopenharmony_ci u16 ht_info_offset; 4248c2ecf20Sopenharmony_ci u8 *bcn_bss_co_2040; 4258c2ecf20Sopenharmony_ci u16 bss_co_2040_offset; 4268c2ecf20Sopenharmony_ci u8 *bcn_ext_cap; 4278c2ecf20Sopenharmony_ci u16 ext_cap_offset; 4288c2ecf20Sopenharmony_ci struct ieee80211_vht_cap *bcn_vht_cap; 4298c2ecf20Sopenharmony_ci u16 vht_cap_offset; 4308c2ecf20Sopenharmony_ci struct ieee80211_vht_operation *bcn_vht_oper; 4318c2ecf20Sopenharmony_ci u16 vht_info_offset; 4328c2ecf20Sopenharmony_ci struct ieee_types_oper_mode_ntf *oper_mode; 4338c2ecf20Sopenharmony_ci u16 oper_mode_offset; 4348c2ecf20Sopenharmony_ci u8 disable_11ac; 4358c2ecf20Sopenharmony_ci struct ieee_types_vendor_specific *bcn_wpa_ie; 4368c2ecf20Sopenharmony_ci u16 wpa_offset; 4378c2ecf20Sopenharmony_ci struct ieee_types_generic *bcn_rsn_ie; 4388c2ecf20Sopenharmony_ci u16 rsn_offset; 4398c2ecf20Sopenharmony_ci struct ieee_types_generic *bcn_wapi_ie; 4408c2ecf20Sopenharmony_ci u16 wapi_offset; 4418c2ecf20Sopenharmony_ci u8 *beacon_buf; 4428c2ecf20Sopenharmony_ci u32 beacon_buf_size; 4438c2ecf20Sopenharmony_ci u8 sensed_11h; 4448c2ecf20Sopenharmony_ci u8 local_constraint; 4458c2ecf20Sopenharmony_ci u8 chan_sw_ie_present; 4468c2ecf20Sopenharmony_ci}; 4478c2ecf20Sopenharmony_ci 4488c2ecf20Sopenharmony_cistruct mwifiex_current_bss_params { 4498c2ecf20Sopenharmony_ci struct mwifiex_bssdescriptor bss_descriptor; 4508c2ecf20Sopenharmony_ci u8 wmm_enabled; 4518c2ecf20Sopenharmony_ci u8 wmm_uapsd_enabled; 4528c2ecf20Sopenharmony_ci u8 band; 4538c2ecf20Sopenharmony_ci u32 num_of_rates; 4548c2ecf20Sopenharmony_ci u8 data_rates[MWIFIEX_SUPPORTED_RATES]; 4558c2ecf20Sopenharmony_ci}; 4568c2ecf20Sopenharmony_ci 4578c2ecf20Sopenharmony_cistruct mwifiex_sleep_params { 4588c2ecf20Sopenharmony_ci u16 sp_error; 4598c2ecf20Sopenharmony_ci u16 sp_offset; 4608c2ecf20Sopenharmony_ci u16 sp_stable_time; 4618c2ecf20Sopenharmony_ci u8 sp_cal_control; 4628c2ecf20Sopenharmony_ci u8 sp_ext_sleep_clk; 4638c2ecf20Sopenharmony_ci u16 sp_reserved; 4648c2ecf20Sopenharmony_ci}; 4658c2ecf20Sopenharmony_ci 4668c2ecf20Sopenharmony_cistruct mwifiex_sleep_period { 4678c2ecf20Sopenharmony_ci u16 period; 4688c2ecf20Sopenharmony_ci u16 reserved; 4698c2ecf20Sopenharmony_ci}; 4708c2ecf20Sopenharmony_ci 4718c2ecf20Sopenharmony_cistruct mwifiex_wep_key { 4728c2ecf20Sopenharmony_ci u32 length; 4738c2ecf20Sopenharmony_ci u32 key_index; 4748c2ecf20Sopenharmony_ci u32 key_length; 4758c2ecf20Sopenharmony_ci u8 key_material[MWIFIEX_KEY_BUFFER_SIZE]; 4768c2ecf20Sopenharmony_ci}; 4778c2ecf20Sopenharmony_ci 4788c2ecf20Sopenharmony_ci#define MAX_REGION_CHANNEL_NUM 2 4798c2ecf20Sopenharmony_ci 4808c2ecf20Sopenharmony_cistruct mwifiex_chan_freq_power { 4818c2ecf20Sopenharmony_ci u16 channel; 4828c2ecf20Sopenharmony_ci u32 freq; 4838c2ecf20Sopenharmony_ci u16 max_tx_power; 4848c2ecf20Sopenharmony_ci u8 unsupported; 4858c2ecf20Sopenharmony_ci}; 4868c2ecf20Sopenharmony_ci 4878c2ecf20Sopenharmony_cienum state_11d_t { 4888c2ecf20Sopenharmony_ci DISABLE_11D = 0, 4898c2ecf20Sopenharmony_ci ENABLE_11D = 1, 4908c2ecf20Sopenharmony_ci}; 4918c2ecf20Sopenharmony_ci 4928c2ecf20Sopenharmony_ci#define MWIFIEX_MAX_TRIPLET_802_11D 83 4938c2ecf20Sopenharmony_ci 4948c2ecf20Sopenharmony_cistruct mwifiex_802_11d_domain_reg { 4958c2ecf20Sopenharmony_ci u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; 4968c2ecf20Sopenharmony_ci u8 no_of_triplet; 4978c2ecf20Sopenharmony_ci struct ieee80211_country_ie_triplet 4988c2ecf20Sopenharmony_ci triplet[MWIFIEX_MAX_TRIPLET_802_11D]; 4998c2ecf20Sopenharmony_ci}; 5008c2ecf20Sopenharmony_ci 5018c2ecf20Sopenharmony_cistruct mwifiex_vendor_spec_cfg_ie { 5028c2ecf20Sopenharmony_ci u16 mask; 5038c2ecf20Sopenharmony_ci u16 flag; 5048c2ecf20Sopenharmony_ci u8 ie[MWIFIEX_MAX_VSIE_LEN]; 5058c2ecf20Sopenharmony_ci}; 5068c2ecf20Sopenharmony_ci 5078c2ecf20Sopenharmony_cistruct wps { 5088c2ecf20Sopenharmony_ci u8 session_enable; 5098c2ecf20Sopenharmony_ci}; 5108c2ecf20Sopenharmony_ci 5118c2ecf20Sopenharmony_cistruct mwifiex_roc_cfg { 5128c2ecf20Sopenharmony_ci u64 cookie; 5138c2ecf20Sopenharmony_ci struct ieee80211_channel chan; 5148c2ecf20Sopenharmony_ci}; 5158c2ecf20Sopenharmony_ci 5168c2ecf20Sopenharmony_cienum mwifiex_iface_work_flags { 5178c2ecf20Sopenharmony_ci MWIFIEX_IFACE_WORK_DEVICE_DUMP, 5188c2ecf20Sopenharmony_ci MWIFIEX_IFACE_WORK_CARD_RESET, 5198c2ecf20Sopenharmony_ci}; 5208c2ecf20Sopenharmony_ci 5218c2ecf20Sopenharmony_cienum mwifiex_adapter_work_flags { 5228c2ecf20Sopenharmony_ci MWIFIEX_SURPRISE_REMOVED, 5238c2ecf20Sopenharmony_ci MWIFIEX_IS_CMD_TIMEDOUT, 5248c2ecf20Sopenharmony_ci MWIFIEX_IS_SUSPENDED, 5258c2ecf20Sopenharmony_ci MWIFIEX_IS_HS_CONFIGURED, 5268c2ecf20Sopenharmony_ci MWIFIEX_IS_HS_ENABLING, 5278c2ecf20Sopenharmony_ci}; 5288c2ecf20Sopenharmony_ci 5298c2ecf20Sopenharmony_cistruct mwifiex_band_config { 5308c2ecf20Sopenharmony_ci u8 chan_band:2; 5318c2ecf20Sopenharmony_ci u8 chan_width:2; 5328c2ecf20Sopenharmony_ci u8 chan2_offset:2; 5338c2ecf20Sopenharmony_ci u8 scan_mode:2; 5348c2ecf20Sopenharmony_ci} __packed; 5358c2ecf20Sopenharmony_ci 5368c2ecf20Sopenharmony_cistruct mwifiex_channel_band { 5378c2ecf20Sopenharmony_ci struct mwifiex_band_config band_config; 5388c2ecf20Sopenharmony_ci u8 channel; 5398c2ecf20Sopenharmony_ci}; 5408c2ecf20Sopenharmony_ci 5418c2ecf20Sopenharmony_cistruct mwifiex_private { 5428c2ecf20Sopenharmony_ci struct mwifiex_adapter *adapter; 5438c2ecf20Sopenharmony_ci u8 bss_type; 5448c2ecf20Sopenharmony_ci u8 bss_role; 5458c2ecf20Sopenharmony_ci u8 bss_priority; 5468c2ecf20Sopenharmony_ci u8 bss_num; 5478c2ecf20Sopenharmony_ci u8 bss_started; 5488c2ecf20Sopenharmony_ci u8 frame_type; 5498c2ecf20Sopenharmony_ci u8 curr_addr[ETH_ALEN]; 5508c2ecf20Sopenharmony_ci u8 media_connected; 5518c2ecf20Sopenharmony_ci u8 port_open; 5528c2ecf20Sopenharmony_ci u8 usb_port; 5538c2ecf20Sopenharmony_ci u32 num_tx_timeout; 5548c2ecf20Sopenharmony_ci /* track consecutive timeout */ 5558c2ecf20Sopenharmony_ci u8 tx_timeout_cnt; 5568c2ecf20Sopenharmony_ci struct net_device *netdev; 5578c2ecf20Sopenharmony_ci struct net_device_stats stats; 5588c2ecf20Sopenharmony_ci u32 curr_pkt_filter; 5598c2ecf20Sopenharmony_ci u32 bss_mode; 5608c2ecf20Sopenharmony_ci u32 pkt_tx_ctrl; 5618c2ecf20Sopenharmony_ci u16 tx_power_level; 5628c2ecf20Sopenharmony_ci u8 max_tx_power_level; 5638c2ecf20Sopenharmony_ci u8 min_tx_power_level; 5648c2ecf20Sopenharmony_ci u32 tx_ant; 5658c2ecf20Sopenharmony_ci u32 rx_ant; 5668c2ecf20Sopenharmony_ci u8 tx_rate; 5678c2ecf20Sopenharmony_ci u8 tx_htinfo; 5688c2ecf20Sopenharmony_ci u8 rxpd_htinfo; 5698c2ecf20Sopenharmony_ci u8 rxpd_rate; 5708c2ecf20Sopenharmony_ci u16 rate_bitmap; 5718c2ecf20Sopenharmony_ci u16 bitmap_rates[MAX_BITMAP_RATES_SIZE]; 5728c2ecf20Sopenharmony_ci u32 data_rate; 5738c2ecf20Sopenharmony_ci u8 is_data_rate_auto; 5748c2ecf20Sopenharmony_ci u16 bcn_avg_factor; 5758c2ecf20Sopenharmony_ci u16 data_avg_factor; 5768c2ecf20Sopenharmony_ci s16 data_rssi_last; 5778c2ecf20Sopenharmony_ci s16 data_nf_last; 5788c2ecf20Sopenharmony_ci s16 data_rssi_avg; 5798c2ecf20Sopenharmony_ci s16 data_nf_avg; 5808c2ecf20Sopenharmony_ci s16 bcn_rssi_last; 5818c2ecf20Sopenharmony_ci s16 bcn_nf_last; 5828c2ecf20Sopenharmony_ci s16 bcn_rssi_avg; 5838c2ecf20Sopenharmony_ci s16 bcn_nf_avg; 5848c2ecf20Sopenharmony_ci struct mwifiex_bssdescriptor *attempted_bss_desc; 5858c2ecf20Sopenharmony_ci struct cfg80211_ssid prev_ssid; 5868c2ecf20Sopenharmony_ci u8 prev_bssid[ETH_ALEN]; 5878c2ecf20Sopenharmony_ci struct mwifiex_current_bss_params curr_bss_params; 5888c2ecf20Sopenharmony_ci u16 beacon_period; 5898c2ecf20Sopenharmony_ci u8 dtim_period; 5908c2ecf20Sopenharmony_ci u16 listen_interval; 5918c2ecf20Sopenharmony_ci u16 atim_window; 5928c2ecf20Sopenharmony_ci u8 adhoc_channel; 5938c2ecf20Sopenharmony_ci u8 adhoc_is_link_sensed; 5948c2ecf20Sopenharmony_ci u8 adhoc_state; 5958c2ecf20Sopenharmony_ci struct mwifiex_802_11_security sec_info; 5968c2ecf20Sopenharmony_ci struct mwifiex_wep_key wep_key[NUM_WEP_KEYS]; 5978c2ecf20Sopenharmony_ci u16 wep_key_curr_index; 5988c2ecf20Sopenharmony_ci u8 wpa_ie[256]; 5998c2ecf20Sopenharmony_ci u16 wpa_ie_len; 6008c2ecf20Sopenharmony_ci u8 wpa_is_gtk_set; 6018c2ecf20Sopenharmony_ci struct host_cmd_ds_802_11_key_material aes_key; 6028c2ecf20Sopenharmony_ci struct host_cmd_ds_802_11_key_material_v2 aes_key_v2; 6038c2ecf20Sopenharmony_ci u8 wapi_ie[256]; 6048c2ecf20Sopenharmony_ci u16 wapi_ie_len; 6058c2ecf20Sopenharmony_ci u8 *wps_ie; 6068c2ecf20Sopenharmony_ci u16 wps_ie_len; 6078c2ecf20Sopenharmony_ci u8 wmm_required; 6088c2ecf20Sopenharmony_ci u8 wmm_enabled; 6098c2ecf20Sopenharmony_ci u8 wmm_qosinfo; 6108c2ecf20Sopenharmony_ci struct mwifiex_wmm_desc wmm; 6118c2ecf20Sopenharmony_ci atomic_t wmm_tx_pending[IEEE80211_NUM_ACS]; 6128c2ecf20Sopenharmony_ci struct list_head sta_list; 6138c2ecf20Sopenharmony_ci /* spin lock for associated station/TDLS peers list */ 6148c2ecf20Sopenharmony_ci spinlock_t sta_list_spinlock; 6158c2ecf20Sopenharmony_ci struct list_head auto_tdls_list; 6168c2ecf20Sopenharmony_ci /* spin lock for auto TDLS peer list */ 6178c2ecf20Sopenharmony_ci spinlock_t auto_tdls_lock; 6188c2ecf20Sopenharmony_ci struct list_head tx_ba_stream_tbl_ptr; 6198c2ecf20Sopenharmony_ci /* spin lock for tx_ba_stream_tbl_ptr queue */ 6208c2ecf20Sopenharmony_ci spinlock_t tx_ba_stream_tbl_lock; 6218c2ecf20Sopenharmony_ci struct mwifiex_tx_aggr aggr_prio_tbl[MAX_NUM_TID]; 6228c2ecf20Sopenharmony_ci struct mwifiex_add_ba_param add_ba_param; 6238c2ecf20Sopenharmony_ci u16 rx_seq[MAX_NUM_TID]; 6248c2ecf20Sopenharmony_ci u8 tos_to_tid_inv[MAX_NUM_TID]; 6258c2ecf20Sopenharmony_ci struct list_head rx_reorder_tbl_ptr; 6268c2ecf20Sopenharmony_ci /* spin lock for rx_reorder_tbl_ptr queue */ 6278c2ecf20Sopenharmony_ci spinlock_t rx_reorder_tbl_lock; 6288c2ecf20Sopenharmony_ci#define MWIFIEX_ASSOC_RSP_BUF_SIZE 500 6298c2ecf20Sopenharmony_ci u8 assoc_rsp_buf[MWIFIEX_ASSOC_RSP_BUF_SIZE]; 6308c2ecf20Sopenharmony_ci u32 assoc_rsp_size; 6318c2ecf20Sopenharmony_ci 6328c2ecf20Sopenharmony_ci#define MWIFIEX_GENIE_BUF_SIZE 256 6338c2ecf20Sopenharmony_ci u8 gen_ie_buf[MWIFIEX_GENIE_BUF_SIZE]; 6348c2ecf20Sopenharmony_ci u8 gen_ie_buf_len; 6358c2ecf20Sopenharmony_ci 6368c2ecf20Sopenharmony_ci struct mwifiex_vendor_spec_cfg_ie vs_ie[MWIFIEX_MAX_VSIE_NUM]; 6378c2ecf20Sopenharmony_ci 6388c2ecf20Sopenharmony_ci#define MWIFIEX_ASSOC_TLV_BUF_SIZE 256 6398c2ecf20Sopenharmony_ci u8 assoc_tlv_buf[MWIFIEX_ASSOC_TLV_BUF_SIZE]; 6408c2ecf20Sopenharmony_ci u8 assoc_tlv_buf_len; 6418c2ecf20Sopenharmony_ci 6428c2ecf20Sopenharmony_ci u8 *curr_bcn_buf; 6438c2ecf20Sopenharmony_ci u32 curr_bcn_size; 6448c2ecf20Sopenharmony_ci /* spin lock for beacon buffer */ 6458c2ecf20Sopenharmony_ci spinlock_t curr_bcn_buf_lock; 6468c2ecf20Sopenharmony_ci struct wireless_dev wdev; 6478c2ecf20Sopenharmony_ci struct mwifiex_chan_freq_power cfp; 6488c2ecf20Sopenharmony_ci u32 versionstrsel; 6498c2ecf20Sopenharmony_ci char version_str[128]; 6508c2ecf20Sopenharmony_ci#ifdef CONFIG_DEBUG_FS 6518c2ecf20Sopenharmony_ci struct dentry *dfs_dev_dir; 6528c2ecf20Sopenharmony_ci#endif 6538c2ecf20Sopenharmony_ci u16 current_key_index; 6548c2ecf20Sopenharmony_ci struct mutex async_mutex; 6558c2ecf20Sopenharmony_ci struct cfg80211_scan_request *scan_request; 6568c2ecf20Sopenharmony_ci u8 cfg_bssid[6]; 6578c2ecf20Sopenharmony_ci struct wps wps; 6588c2ecf20Sopenharmony_ci u8 scan_block; 6598c2ecf20Sopenharmony_ci s32 cqm_rssi_thold; 6608c2ecf20Sopenharmony_ci u32 cqm_rssi_hyst; 6618c2ecf20Sopenharmony_ci u8 subsc_evt_rssi_state; 6628c2ecf20Sopenharmony_ci struct mwifiex_ds_misc_subsc_evt async_subsc_evt_storage; 6638c2ecf20Sopenharmony_ci struct mwifiex_ie mgmt_ie[MAX_MGMT_IE_INDEX]; 6648c2ecf20Sopenharmony_ci u16 beacon_idx; 6658c2ecf20Sopenharmony_ci u16 proberesp_idx; 6668c2ecf20Sopenharmony_ci u16 assocresp_idx; 6678c2ecf20Sopenharmony_ci u16 gen_idx; 6688c2ecf20Sopenharmony_ci u8 ap_11n_enabled; 6698c2ecf20Sopenharmony_ci u8 ap_11ac_enabled; 6708c2ecf20Sopenharmony_ci u32 mgmt_frame_mask; 6718c2ecf20Sopenharmony_ci struct mwifiex_roc_cfg roc_cfg; 6728c2ecf20Sopenharmony_ci bool scan_aborting; 6738c2ecf20Sopenharmony_ci u8 sched_scanning; 6748c2ecf20Sopenharmony_ci u8 csa_chan; 6758c2ecf20Sopenharmony_ci unsigned long csa_expire_time; 6768c2ecf20Sopenharmony_ci u8 del_list_idx; 6778c2ecf20Sopenharmony_ci bool hs2_enabled; 6788c2ecf20Sopenharmony_ci struct mwifiex_uap_bss_param bss_cfg; 6798c2ecf20Sopenharmony_ci struct cfg80211_chan_def bss_chandef; 6808c2ecf20Sopenharmony_ci struct station_parameters *sta_params; 6818c2ecf20Sopenharmony_ci struct sk_buff_head tdls_txq; 6828c2ecf20Sopenharmony_ci u8 check_tdls_tx; 6838c2ecf20Sopenharmony_ci struct timer_list auto_tdls_timer; 6848c2ecf20Sopenharmony_ci bool auto_tdls_timer_active; 6858c2ecf20Sopenharmony_ci struct idr ack_status_frames; 6868c2ecf20Sopenharmony_ci /* spin lock for ack status */ 6878c2ecf20Sopenharmony_ci spinlock_t ack_status_lock; 6888c2ecf20Sopenharmony_ci /** rx histogram data */ 6898c2ecf20Sopenharmony_ci struct mwifiex_histogram_data *hist_data; 6908c2ecf20Sopenharmony_ci struct cfg80211_chan_def dfs_chandef; 6918c2ecf20Sopenharmony_ci struct workqueue_struct *dfs_cac_workqueue; 6928c2ecf20Sopenharmony_ci struct delayed_work dfs_cac_work; 6938c2ecf20Sopenharmony_ci struct timer_list dfs_chan_switch_timer; 6948c2ecf20Sopenharmony_ci struct workqueue_struct *dfs_chan_sw_workqueue; 6958c2ecf20Sopenharmony_ci struct delayed_work dfs_chan_sw_work; 6968c2ecf20Sopenharmony_ci struct cfg80211_beacon_data beacon_after; 6978c2ecf20Sopenharmony_ci struct mwifiex_11h_intf_state state_11h; 6988c2ecf20Sopenharmony_ci struct mwifiex_ds_mem_rw mem_rw; 6998c2ecf20Sopenharmony_ci struct sk_buff_head bypass_txq; 7008c2ecf20Sopenharmony_ci struct mwifiex_user_scan_chan hidden_chan[MWIFIEX_USER_SCAN_CHAN_MAX]; 7018c2ecf20Sopenharmony_ci u8 assoc_resp_ht_param; 7028c2ecf20Sopenharmony_ci bool ht_param_present; 7038c2ecf20Sopenharmony_ci}; 7048c2ecf20Sopenharmony_ci 7058c2ecf20Sopenharmony_ci 7068c2ecf20Sopenharmony_cistruct mwifiex_tx_ba_stream_tbl { 7078c2ecf20Sopenharmony_ci struct list_head list; 7088c2ecf20Sopenharmony_ci int tid; 7098c2ecf20Sopenharmony_ci u8 ra[ETH_ALEN]; 7108c2ecf20Sopenharmony_ci enum mwifiex_ba_status ba_status; 7118c2ecf20Sopenharmony_ci u8 amsdu; 7128c2ecf20Sopenharmony_ci}; 7138c2ecf20Sopenharmony_ci 7148c2ecf20Sopenharmony_cistruct mwifiex_rx_reorder_tbl; 7158c2ecf20Sopenharmony_ci 7168c2ecf20Sopenharmony_cistruct reorder_tmr_cnxt { 7178c2ecf20Sopenharmony_ci struct timer_list timer; 7188c2ecf20Sopenharmony_ci struct mwifiex_rx_reorder_tbl *ptr; 7198c2ecf20Sopenharmony_ci struct mwifiex_private *priv; 7208c2ecf20Sopenharmony_ci u8 timer_is_set; 7218c2ecf20Sopenharmony_ci}; 7228c2ecf20Sopenharmony_ci 7238c2ecf20Sopenharmony_cistruct mwifiex_rx_reorder_tbl { 7248c2ecf20Sopenharmony_ci struct list_head list; 7258c2ecf20Sopenharmony_ci int tid; 7268c2ecf20Sopenharmony_ci u8 ta[ETH_ALEN]; 7278c2ecf20Sopenharmony_ci int init_win; 7288c2ecf20Sopenharmony_ci int start_win; 7298c2ecf20Sopenharmony_ci int win_size; 7308c2ecf20Sopenharmony_ci void **rx_reorder_ptr; 7318c2ecf20Sopenharmony_ci struct reorder_tmr_cnxt timer_context; 7328c2ecf20Sopenharmony_ci u8 amsdu; 7338c2ecf20Sopenharmony_ci u8 flags; 7348c2ecf20Sopenharmony_ci}; 7358c2ecf20Sopenharmony_ci 7368c2ecf20Sopenharmony_cistruct mwifiex_bss_prio_node { 7378c2ecf20Sopenharmony_ci struct list_head list; 7388c2ecf20Sopenharmony_ci struct mwifiex_private *priv; 7398c2ecf20Sopenharmony_ci}; 7408c2ecf20Sopenharmony_ci 7418c2ecf20Sopenharmony_cistruct mwifiex_bss_prio_tbl { 7428c2ecf20Sopenharmony_ci struct list_head bss_prio_head; 7438c2ecf20Sopenharmony_ci /* spin lock for bss priority */ 7448c2ecf20Sopenharmony_ci spinlock_t bss_prio_lock; 7458c2ecf20Sopenharmony_ci struct mwifiex_bss_prio_node *bss_prio_cur; 7468c2ecf20Sopenharmony_ci}; 7478c2ecf20Sopenharmony_ci 7488c2ecf20Sopenharmony_cistruct cmd_ctrl_node { 7498c2ecf20Sopenharmony_ci struct list_head list; 7508c2ecf20Sopenharmony_ci struct mwifiex_private *priv; 7518c2ecf20Sopenharmony_ci u32 cmd_no; 7528c2ecf20Sopenharmony_ci u32 cmd_flag; 7538c2ecf20Sopenharmony_ci struct sk_buff *cmd_skb; 7548c2ecf20Sopenharmony_ci struct sk_buff *resp_skb; 7558c2ecf20Sopenharmony_ci void *data_buf; 7568c2ecf20Sopenharmony_ci u32 wait_q_enabled; 7578c2ecf20Sopenharmony_ci struct sk_buff *skb; 7588c2ecf20Sopenharmony_ci u8 *condition; 7598c2ecf20Sopenharmony_ci u8 cmd_wait_q_woken; 7608c2ecf20Sopenharmony_ci}; 7618c2ecf20Sopenharmony_ci 7628c2ecf20Sopenharmony_cistruct mwifiex_bss_priv { 7638c2ecf20Sopenharmony_ci u8 band; 7648c2ecf20Sopenharmony_ci u64 fw_tsf; 7658c2ecf20Sopenharmony_ci}; 7668c2ecf20Sopenharmony_ci 7678c2ecf20Sopenharmony_cistruct mwifiex_tdls_capab { 7688c2ecf20Sopenharmony_ci __le16 capab; 7698c2ecf20Sopenharmony_ci u8 rates[32]; 7708c2ecf20Sopenharmony_ci u8 rates_len; 7718c2ecf20Sopenharmony_ci u8 qos_info; 7728c2ecf20Sopenharmony_ci u8 coex_2040; 7738c2ecf20Sopenharmony_ci u16 aid; 7748c2ecf20Sopenharmony_ci struct ieee80211_ht_cap ht_capb; 7758c2ecf20Sopenharmony_ci struct ieee80211_ht_operation ht_oper; 7768c2ecf20Sopenharmony_ci struct ieee_types_extcap extcap; 7778c2ecf20Sopenharmony_ci struct ieee_types_generic rsn_ie; 7788c2ecf20Sopenharmony_ci struct ieee80211_vht_cap vhtcap; 7798c2ecf20Sopenharmony_ci struct ieee80211_vht_operation vhtoper; 7808c2ecf20Sopenharmony_ci}; 7818c2ecf20Sopenharmony_ci 7828c2ecf20Sopenharmony_cistruct mwifiex_station_stats { 7838c2ecf20Sopenharmony_ci u64 last_rx; 7848c2ecf20Sopenharmony_ci s8 rssi; 7858c2ecf20Sopenharmony_ci u64 rx_bytes; 7868c2ecf20Sopenharmony_ci u64 tx_bytes; 7878c2ecf20Sopenharmony_ci u32 rx_packets; 7888c2ecf20Sopenharmony_ci u32 tx_packets; 7898c2ecf20Sopenharmony_ci u32 tx_failed; 7908c2ecf20Sopenharmony_ci u8 last_tx_rate; 7918c2ecf20Sopenharmony_ci u8 last_tx_htinfo; 7928c2ecf20Sopenharmony_ci}; 7938c2ecf20Sopenharmony_ci 7948c2ecf20Sopenharmony_ci/* This is AP/TDLS specific structure which stores information 7958c2ecf20Sopenharmony_ci * about associated/peer STA 7968c2ecf20Sopenharmony_ci */ 7978c2ecf20Sopenharmony_cistruct mwifiex_sta_node { 7988c2ecf20Sopenharmony_ci struct list_head list; 7998c2ecf20Sopenharmony_ci u8 mac_addr[ETH_ALEN]; 8008c2ecf20Sopenharmony_ci u8 is_wmm_enabled; 8018c2ecf20Sopenharmony_ci u8 is_11n_enabled; 8028c2ecf20Sopenharmony_ci u8 is_11ac_enabled; 8038c2ecf20Sopenharmony_ci u8 ampdu_sta[MAX_NUM_TID]; 8048c2ecf20Sopenharmony_ci u16 rx_seq[MAX_NUM_TID]; 8058c2ecf20Sopenharmony_ci u16 max_amsdu; 8068c2ecf20Sopenharmony_ci u8 tdls_status; 8078c2ecf20Sopenharmony_ci struct mwifiex_tdls_capab tdls_cap; 8088c2ecf20Sopenharmony_ci struct mwifiex_station_stats stats; 8098c2ecf20Sopenharmony_ci u8 tx_pause; 8108c2ecf20Sopenharmony_ci}; 8118c2ecf20Sopenharmony_ci 8128c2ecf20Sopenharmony_cistruct mwifiex_auto_tdls_peer { 8138c2ecf20Sopenharmony_ci struct list_head list; 8148c2ecf20Sopenharmony_ci u8 mac_addr[ETH_ALEN]; 8158c2ecf20Sopenharmony_ci u8 tdls_status; 8168c2ecf20Sopenharmony_ci int rssi; 8178c2ecf20Sopenharmony_ci long rssi_jiffies; 8188c2ecf20Sopenharmony_ci u8 failure_count; 8198c2ecf20Sopenharmony_ci u8 do_discover; 8208c2ecf20Sopenharmony_ci u8 do_setup; 8218c2ecf20Sopenharmony_ci}; 8228c2ecf20Sopenharmony_ci 8238c2ecf20Sopenharmony_ci#define MWIFIEX_TYPE_AGGR_DATA_V2 11 8248c2ecf20Sopenharmony_ci#define MWIFIEX_BUS_AGGR_MODE_LEN_V2 (2) 8258c2ecf20Sopenharmony_ci#define MWIFIEX_BUS_AGGR_MAX_LEN 16000 8268c2ecf20Sopenharmony_ci#define MWIFIEX_BUS_AGGR_MAX_NUM 10 8278c2ecf20Sopenharmony_cistruct bus_aggr_params { 8288c2ecf20Sopenharmony_ci u16 enable; 8298c2ecf20Sopenharmony_ci u16 mode; 8308c2ecf20Sopenharmony_ci u16 tx_aggr_max_size; 8318c2ecf20Sopenharmony_ci u16 tx_aggr_max_num; 8328c2ecf20Sopenharmony_ci u16 tx_aggr_align; 8338c2ecf20Sopenharmony_ci}; 8348c2ecf20Sopenharmony_ci 8358c2ecf20Sopenharmony_cistruct mwifiex_if_ops { 8368c2ecf20Sopenharmony_ci int (*init_if) (struct mwifiex_adapter *); 8378c2ecf20Sopenharmony_ci void (*cleanup_if) (struct mwifiex_adapter *); 8388c2ecf20Sopenharmony_ci int (*check_fw_status) (struct mwifiex_adapter *, u32); 8398c2ecf20Sopenharmony_ci int (*check_winner_status)(struct mwifiex_adapter *); 8408c2ecf20Sopenharmony_ci int (*prog_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *); 8418c2ecf20Sopenharmony_ci int (*register_dev) (struct mwifiex_adapter *); 8428c2ecf20Sopenharmony_ci void (*unregister_dev) (struct mwifiex_adapter *); 8438c2ecf20Sopenharmony_ci int (*enable_int) (struct mwifiex_adapter *); 8448c2ecf20Sopenharmony_ci void (*disable_int) (struct mwifiex_adapter *); 8458c2ecf20Sopenharmony_ci int (*process_int_status) (struct mwifiex_adapter *); 8468c2ecf20Sopenharmony_ci int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *, 8478c2ecf20Sopenharmony_ci struct mwifiex_tx_param *); 8488c2ecf20Sopenharmony_ci int (*wakeup) (struct mwifiex_adapter *); 8498c2ecf20Sopenharmony_ci int (*wakeup_complete) (struct mwifiex_adapter *); 8508c2ecf20Sopenharmony_ci 8518c2ecf20Sopenharmony_ci /* Interface specific functions */ 8528c2ecf20Sopenharmony_ci void (*update_mp_end_port) (struct mwifiex_adapter *, u16); 8538c2ecf20Sopenharmony_ci void (*cleanup_mpa_buf) (struct mwifiex_adapter *); 8548c2ecf20Sopenharmony_ci int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *); 8558c2ecf20Sopenharmony_ci int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *); 8568c2ecf20Sopenharmony_ci int (*init_fw_port) (struct mwifiex_adapter *); 8578c2ecf20Sopenharmony_ci int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *); 8588c2ecf20Sopenharmony_ci void (*card_reset) (struct mwifiex_adapter *); 8598c2ecf20Sopenharmony_ci int (*reg_dump)(struct mwifiex_adapter *, char *); 8608c2ecf20Sopenharmony_ci void (*device_dump)(struct mwifiex_adapter *); 8618c2ecf20Sopenharmony_ci int (*clean_pcie_ring) (struct mwifiex_adapter *adapter); 8628c2ecf20Sopenharmony_ci void (*iface_work)(struct work_struct *work); 8638c2ecf20Sopenharmony_ci void (*submit_rem_rx_urbs)(struct mwifiex_adapter *adapter); 8648c2ecf20Sopenharmony_ci void (*deaggr_pkt)(struct mwifiex_adapter *, struct sk_buff *); 8658c2ecf20Sopenharmony_ci void (*multi_port_resync)(struct mwifiex_adapter *); 8668c2ecf20Sopenharmony_ci bool (*is_port_ready)(struct mwifiex_private *); 8678c2ecf20Sopenharmony_ci void (*down_dev)(struct mwifiex_adapter *); 8688c2ecf20Sopenharmony_ci void (*up_dev)(struct mwifiex_adapter *); 8698c2ecf20Sopenharmony_ci}; 8708c2ecf20Sopenharmony_ci 8718c2ecf20Sopenharmony_cistruct mwifiex_adapter { 8728c2ecf20Sopenharmony_ci u8 iface_type; 8738c2ecf20Sopenharmony_ci unsigned int debug_mask; 8748c2ecf20Sopenharmony_ci struct mwifiex_iface_comb iface_limit; 8758c2ecf20Sopenharmony_ci struct mwifiex_iface_comb curr_iface_comb; 8768c2ecf20Sopenharmony_ci struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM]; 8778c2ecf20Sopenharmony_ci u8 priv_num; 8788c2ecf20Sopenharmony_ci const struct firmware *firmware; 8798c2ecf20Sopenharmony_ci char fw_name[32]; 8808c2ecf20Sopenharmony_ci int winner; 8818c2ecf20Sopenharmony_ci struct device *dev; 8828c2ecf20Sopenharmony_ci struct wiphy *wiphy; 8838c2ecf20Sopenharmony_ci u8 perm_addr[ETH_ALEN]; 8848c2ecf20Sopenharmony_ci unsigned long work_flags; 8858c2ecf20Sopenharmony_ci u32 fw_release_number; 8868c2ecf20Sopenharmony_ci u8 intf_hdr_len; 8878c2ecf20Sopenharmony_ci u16 init_wait_q_woken; 8888c2ecf20Sopenharmony_ci wait_queue_head_t init_wait_q; 8898c2ecf20Sopenharmony_ci void *card; 8908c2ecf20Sopenharmony_ci struct mwifiex_if_ops if_ops; 8918c2ecf20Sopenharmony_ci atomic_t bypass_tx_pending; 8928c2ecf20Sopenharmony_ci atomic_t rx_pending; 8938c2ecf20Sopenharmony_ci atomic_t tx_pending; 8948c2ecf20Sopenharmony_ci atomic_t cmd_pending; 8958c2ecf20Sopenharmony_ci atomic_t tx_hw_pending; 8968c2ecf20Sopenharmony_ci struct workqueue_struct *workqueue; 8978c2ecf20Sopenharmony_ci struct work_struct main_work; 8988c2ecf20Sopenharmony_ci struct workqueue_struct *rx_workqueue; 8998c2ecf20Sopenharmony_ci struct work_struct rx_work; 9008c2ecf20Sopenharmony_ci struct workqueue_struct *dfs_workqueue; 9018c2ecf20Sopenharmony_ci struct work_struct dfs_work; 9028c2ecf20Sopenharmony_ci bool rx_work_enabled; 9038c2ecf20Sopenharmony_ci bool rx_processing; 9048c2ecf20Sopenharmony_ci bool delay_main_work; 9058c2ecf20Sopenharmony_ci bool rx_locked; 9068c2ecf20Sopenharmony_ci bool main_locked; 9078c2ecf20Sopenharmony_ci struct mwifiex_bss_prio_tbl bss_prio_tbl[MWIFIEX_MAX_BSS_NUM]; 9088c2ecf20Sopenharmony_ci /* spin lock for main process */ 9098c2ecf20Sopenharmony_ci spinlock_t main_proc_lock; 9108c2ecf20Sopenharmony_ci u32 mwifiex_processing; 9118c2ecf20Sopenharmony_ci u8 more_task_flag; 9128c2ecf20Sopenharmony_ci u16 tx_buf_size; 9138c2ecf20Sopenharmony_ci u16 curr_tx_buf_size; 9148c2ecf20Sopenharmony_ci /* sdio single port rx aggregation capability */ 9158c2ecf20Sopenharmony_ci bool host_disable_sdio_rx_aggr; 9168c2ecf20Sopenharmony_ci bool sdio_rx_aggr_enable; 9178c2ecf20Sopenharmony_ci u16 sdio_rx_block_size; 9188c2ecf20Sopenharmony_ci u32 ioport; 9198c2ecf20Sopenharmony_ci enum MWIFIEX_HARDWARE_STATUS hw_status; 9208c2ecf20Sopenharmony_ci u16 number_of_antenna; 9218c2ecf20Sopenharmony_ci u32 fw_cap_info; 9228c2ecf20Sopenharmony_ci /* spin lock for interrupt handling */ 9238c2ecf20Sopenharmony_ci spinlock_t int_lock; 9248c2ecf20Sopenharmony_ci u8 int_status; 9258c2ecf20Sopenharmony_ci u32 event_cause; 9268c2ecf20Sopenharmony_ci struct sk_buff *event_skb; 9278c2ecf20Sopenharmony_ci u8 upld_buf[MWIFIEX_UPLD_SIZE]; 9288c2ecf20Sopenharmony_ci u8 data_sent; 9298c2ecf20Sopenharmony_ci u8 cmd_sent; 9308c2ecf20Sopenharmony_ci u8 cmd_resp_received; 9318c2ecf20Sopenharmony_ci u8 event_received; 9328c2ecf20Sopenharmony_ci u8 data_received; 9338c2ecf20Sopenharmony_ci u16 seq_num; 9348c2ecf20Sopenharmony_ci struct cmd_ctrl_node *cmd_pool; 9358c2ecf20Sopenharmony_ci struct cmd_ctrl_node *curr_cmd; 9368c2ecf20Sopenharmony_ci /* spin lock for command */ 9378c2ecf20Sopenharmony_ci spinlock_t mwifiex_cmd_lock; 9388c2ecf20Sopenharmony_ci u16 last_init_cmd; 9398c2ecf20Sopenharmony_ci struct timer_list cmd_timer; 9408c2ecf20Sopenharmony_ci struct list_head cmd_free_q; 9418c2ecf20Sopenharmony_ci /* spin lock for cmd_free_q */ 9428c2ecf20Sopenharmony_ci spinlock_t cmd_free_q_lock; 9438c2ecf20Sopenharmony_ci struct list_head cmd_pending_q; 9448c2ecf20Sopenharmony_ci /* spin lock for cmd_pending_q */ 9458c2ecf20Sopenharmony_ci spinlock_t cmd_pending_q_lock; 9468c2ecf20Sopenharmony_ci struct list_head scan_pending_q; 9478c2ecf20Sopenharmony_ci /* spin lock for scan_pending_q */ 9488c2ecf20Sopenharmony_ci spinlock_t scan_pending_q_lock; 9498c2ecf20Sopenharmony_ci /* spin lock for RX processing routine */ 9508c2ecf20Sopenharmony_ci spinlock_t rx_proc_lock; 9518c2ecf20Sopenharmony_ci struct sk_buff_head tx_data_q; 9528c2ecf20Sopenharmony_ci atomic_t tx_queued; 9538c2ecf20Sopenharmony_ci u32 scan_processing; 9548c2ecf20Sopenharmony_ci u16 region_code; 9558c2ecf20Sopenharmony_ci struct mwifiex_802_11d_domain_reg domain_reg; 9568c2ecf20Sopenharmony_ci u16 scan_probes; 9578c2ecf20Sopenharmony_ci u32 scan_mode; 9588c2ecf20Sopenharmony_ci u16 specific_scan_time; 9598c2ecf20Sopenharmony_ci u16 active_scan_time; 9608c2ecf20Sopenharmony_ci u16 passive_scan_time; 9618c2ecf20Sopenharmony_ci u16 scan_chan_gap_time; 9628c2ecf20Sopenharmony_ci u8 fw_bands; 9638c2ecf20Sopenharmony_ci u8 adhoc_start_band; 9648c2ecf20Sopenharmony_ci u8 config_bands; 9658c2ecf20Sopenharmony_ci struct mwifiex_chan_scan_param_set *scan_channels; 9668c2ecf20Sopenharmony_ci u8 tx_lock_flag; 9678c2ecf20Sopenharmony_ci struct mwifiex_sleep_params sleep_params; 9688c2ecf20Sopenharmony_ci struct mwifiex_sleep_period sleep_period; 9698c2ecf20Sopenharmony_ci u16 ps_mode; 9708c2ecf20Sopenharmony_ci u32 ps_state; 9718c2ecf20Sopenharmony_ci u8 need_to_wakeup; 9728c2ecf20Sopenharmony_ci u16 multiple_dtim; 9738c2ecf20Sopenharmony_ci u16 local_listen_interval; 9748c2ecf20Sopenharmony_ci u16 null_pkt_interval; 9758c2ecf20Sopenharmony_ci struct sk_buff *sleep_cfm; 9768c2ecf20Sopenharmony_ci u16 bcn_miss_time_out; 9778c2ecf20Sopenharmony_ci u16 adhoc_awake_period; 9788c2ecf20Sopenharmony_ci u8 is_deep_sleep; 9798c2ecf20Sopenharmony_ci u8 delay_null_pkt; 9808c2ecf20Sopenharmony_ci u16 delay_to_ps; 9818c2ecf20Sopenharmony_ci u16 enhanced_ps_mode; 9828c2ecf20Sopenharmony_ci u8 pm_wakeup_card_req; 9838c2ecf20Sopenharmony_ci u16 gen_null_pkt; 9848c2ecf20Sopenharmony_ci u16 pps_uapsd_mode; 9858c2ecf20Sopenharmony_ci u32 pm_wakeup_fw_try; 9868c2ecf20Sopenharmony_ci struct timer_list wakeup_timer; 9878c2ecf20Sopenharmony_ci struct mwifiex_hs_config_param hs_cfg; 9888c2ecf20Sopenharmony_ci u8 hs_activated; 9898c2ecf20Sopenharmony_ci u16 hs_activate_wait_q_woken; 9908c2ecf20Sopenharmony_ci wait_queue_head_t hs_activate_wait_q; 9918c2ecf20Sopenharmony_ci u8 event_body[MAX_EVENT_SIZE]; 9928c2ecf20Sopenharmony_ci u32 hw_dot_11n_dev_cap; 9938c2ecf20Sopenharmony_ci u8 hw_dev_mcs_support; 9948c2ecf20Sopenharmony_ci u8 user_dev_mcs_support; 9958c2ecf20Sopenharmony_ci u8 adhoc_11n_enabled; 9968c2ecf20Sopenharmony_ci u8 sec_chan_offset; 9978c2ecf20Sopenharmony_ci struct mwifiex_dbg dbg; 9988c2ecf20Sopenharmony_ci u8 arp_filter[ARP_FILTER_MAX_BUF_SIZE]; 9998c2ecf20Sopenharmony_ci u32 arp_filter_size; 10008c2ecf20Sopenharmony_ci struct mwifiex_wait_queue cmd_wait_q; 10018c2ecf20Sopenharmony_ci u8 scan_wait_q_woken; 10028c2ecf20Sopenharmony_ci spinlock_t queue_lock; /* lock for tx queues */ 10038c2ecf20Sopenharmony_ci u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; 10048c2ecf20Sopenharmony_ci u16 max_mgmt_ie_index; 10058c2ecf20Sopenharmony_ci const struct firmware *cal_data; 10068c2ecf20Sopenharmony_ci struct device_node *dt_node; 10078c2ecf20Sopenharmony_ci 10088c2ecf20Sopenharmony_ci /* 11AC */ 10098c2ecf20Sopenharmony_ci u32 is_hw_11ac_capable; 10108c2ecf20Sopenharmony_ci u32 hw_dot_11ac_dev_cap; 10118c2ecf20Sopenharmony_ci u32 hw_dot_11ac_mcs_support; 10128c2ecf20Sopenharmony_ci u32 usr_dot_11ac_dev_cap_bg; 10138c2ecf20Sopenharmony_ci u32 usr_dot_11ac_dev_cap_a; 10148c2ecf20Sopenharmony_ci u32 usr_dot_11ac_mcs_support; 10158c2ecf20Sopenharmony_ci 10168c2ecf20Sopenharmony_ci atomic_t pending_bridged_pkts; 10178c2ecf20Sopenharmony_ci 10188c2ecf20Sopenharmony_ci /* For synchronizing FW initialization with device lifecycle. */ 10198c2ecf20Sopenharmony_ci struct completion *fw_done; 10208c2ecf20Sopenharmony_ci bool is_up; 10218c2ecf20Sopenharmony_ci 10228c2ecf20Sopenharmony_ci bool ext_scan; 10238c2ecf20Sopenharmony_ci u8 fw_api_ver; 10248c2ecf20Sopenharmony_ci u8 key_api_major_ver, key_api_minor_ver; 10258c2ecf20Sopenharmony_ci u8 max_p2p_conn, max_sta_conn; 10268c2ecf20Sopenharmony_ci struct memory_type_mapping *mem_type_mapping_tbl; 10278c2ecf20Sopenharmony_ci u8 num_mem_types; 10288c2ecf20Sopenharmony_ci bool scan_chan_gap_enabled; 10298c2ecf20Sopenharmony_ci struct sk_buff_head rx_data_q; 10308c2ecf20Sopenharmony_ci bool mfg_mode; 10318c2ecf20Sopenharmony_ci struct mwifiex_chan_stats *chan_stats; 10328c2ecf20Sopenharmony_ci u32 num_in_chan_stats; 10338c2ecf20Sopenharmony_ci int survey_idx; 10348c2ecf20Sopenharmony_ci bool auto_tdls; 10358c2ecf20Sopenharmony_ci u8 coex_scan; 10368c2ecf20Sopenharmony_ci u8 coex_min_scan_time; 10378c2ecf20Sopenharmony_ci u8 coex_max_scan_time; 10388c2ecf20Sopenharmony_ci u8 coex_win_size; 10398c2ecf20Sopenharmony_ci u8 coex_tx_win_size; 10408c2ecf20Sopenharmony_ci u8 coex_rx_win_size; 10418c2ecf20Sopenharmony_ci bool drcs_enabled; 10428c2ecf20Sopenharmony_ci u8 active_scan_triggered; 10438c2ecf20Sopenharmony_ci bool usb_mc_status; 10448c2ecf20Sopenharmony_ci bool usb_mc_setup; 10458c2ecf20Sopenharmony_ci struct cfg80211_wowlan_nd_info *nd_info; 10468c2ecf20Sopenharmony_ci struct ieee80211_regdomain *regd; 10478c2ecf20Sopenharmony_ci 10488c2ecf20Sopenharmony_ci /* Wake-on-WLAN (WoWLAN) */ 10498c2ecf20Sopenharmony_ci int irq_wakeup; 10508c2ecf20Sopenharmony_ci bool wake_by_wifi; 10518c2ecf20Sopenharmony_ci /* Aggregation parameters*/ 10528c2ecf20Sopenharmony_ci struct bus_aggr_params bus_aggr; 10538c2ecf20Sopenharmony_ci /* Device dump data/length */ 10548c2ecf20Sopenharmony_ci void *devdump_data; 10558c2ecf20Sopenharmony_ci int devdump_len; 10568c2ecf20Sopenharmony_ci struct timer_list devdump_timer; 10578c2ecf20Sopenharmony_ci 10588c2ecf20Sopenharmony_ci bool ignore_btcoex_events; 10598c2ecf20Sopenharmony_ci}; 10608c2ecf20Sopenharmony_ci 10618c2ecf20Sopenharmony_civoid mwifiex_process_tx_queue(struct mwifiex_adapter *adapter); 10628c2ecf20Sopenharmony_ci 10638c2ecf20Sopenharmony_ciint mwifiex_init_lock_list(struct mwifiex_adapter *adapter); 10648c2ecf20Sopenharmony_ci 10658c2ecf20Sopenharmony_civoid mwifiex_set_trans_start(struct net_device *dev); 10668c2ecf20Sopenharmony_ci 10678c2ecf20Sopenharmony_civoid mwifiex_stop_net_dev_queue(struct net_device *netdev, 10688c2ecf20Sopenharmony_ci struct mwifiex_adapter *adapter); 10698c2ecf20Sopenharmony_ci 10708c2ecf20Sopenharmony_civoid mwifiex_wake_up_net_dev_queue(struct net_device *netdev, 10718c2ecf20Sopenharmony_ci struct mwifiex_adapter *adapter); 10728c2ecf20Sopenharmony_ci 10738c2ecf20Sopenharmony_ciint mwifiex_init_priv(struct mwifiex_private *priv); 10748c2ecf20Sopenharmony_civoid mwifiex_free_priv(struct mwifiex_private *priv); 10758c2ecf20Sopenharmony_ci 10768c2ecf20Sopenharmony_ciint mwifiex_init_fw(struct mwifiex_adapter *adapter); 10778c2ecf20Sopenharmony_ci 10788c2ecf20Sopenharmony_ciint mwifiex_init_fw_complete(struct mwifiex_adapter *adapter); 10798c2ecf20Sopenharmony_ci 10808c2ecf20Sopenharmony_civoid mwifiex_shutdown_drv(struct mwifiex_adapter *adapter); 10818c2ecf20Sopenharmony_ci 10828c2ecf20Sopenharmony_ciint mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *); 10838c2ecf20Sopenharmony_ci 10848c2ecf20Sopenharmony_ciint mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb); 10858c2ecf20Sopenharmony_ciint mwifiex_uap_recv_packet(struct mwifiex_private *priv, 10868c2ecf20Sopenharmony_ci struct sk_buff *skb); 10878c2ecf20Sopenharmony_ci 10888c2ecf20Sopenharmony_ciint mwifiex_process_mgmt_packet(struct mwifiex_private *priv, 10898c2ecf20Sopenharmony_ci struct sk_buff *skb); 10908c2ecf20Sopenharmony_ci 10918c2ecf20Sopenharmony_ciint mwifiex_process_event(struct mwifiex_adapter *adapter); 10928c2ecf20Sopenharmony_ci 10938c2ecf20Sopenharmony_ciint mwifiex_complete_cmd(struct mwifiex_adapter *adapter, 10948c2ecf20Sopenharmony_ci struct cmd_ctrl_node *cmd_node); 10958c2ecf20Sopenharmony_ci 10968c2ecf20Sopenharmony_ciint mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no, 10978c2ecf20Sopenharmony_ci u16 cmd_action, u32 cmd_oid, void *data_buf, bool sync); 10988c2ecf20Sopenharmony_ci 10998c2ecf20Sopenharmony_civoid mwifiex_cmd_timeout_func(struct timer_list *t); 11008c2ecf20Sopenharmony_ci 11018c2ecf20Sopenharmony_ciint mwifiex_get_debug_info(struct mwifiex_private *, 11028c2ecf20Sopenharmony_ci struct mwifiex_debug_info *); 11038c2ecf20Sopenharmony_ci 11048c2ecf20Sopenharmony_ciint mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter); 11058c2ecf20Sopenharmony_civoid mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter); 11068c2ecf20Sopenharmony_civoid mwifiex_free_cmd_buffers(struct mwifiex_adapter *adapter); 11078c2ecf20Sopenharmony_civoid mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter); 11088c2ecf20Sopenharmony_civoid mwifiex_cancel_pending_scan_cmd(struct mwifiex_adapter *adapter); 11098c2ecf20Sopenharmony_civoid mwifiex_cancel_scan(struct mwifiex_adapter *adapter); 11108c2ecf20Sopenharmony_ci 11118c2ecf20Sopenharmony_civoid mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter, 11128c2ecf20Sopenharmony_ci struct cmd_ctrl_node *cmd_node); 11138c2ecf20Sopenharmony_ci 11148c2ecf20Sopenharmony_civoid mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter, 11158c2ecf20Sopenharmony_ci struct cmd_ctrl_node *cmd_node); 11168c2ecf20Sopenharmony_ci 11178c2ecf20Sopenharmony_ciint mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter); 11188c2ecf20Sopenharmony_ciint mwifiex_process_cmdresp(struct mwifiex_adapter *adapter); 11198c2ecf20Sopenharmony_ciint mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter, 11208c2ecf20Sopenharmony_ci struct sk_buff *skb); 11218c2ecf20Sopenharmony_ciint mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, 11228c2ecf20Sopenharmony_ci struct mwifiex_tx_param *tx_param); 11238c2ecf20Sopenharmony_ciint mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags); 11248c2ecf20Sopenharmony_ciint mwifiex_write_data_complete(struct mwifiex_adapter *adapter, 11258c2ecf20Sopenharmony_ci struct sk_buff *skb, int aggr, int status); 11268c2ecf20Sopenharmony_civoid mwifiex_clean_txrx(struct mwifiex_private *priv); 11278c2ecf20Sopenharmony_ciu8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv); 11288c2ecf20Sopenharmony_civoid mwifiex_check_ps_cond(struct mwifiex_adapter *adapter); 11298c2ecf20Sopenharmony_civoid mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *, u8 *, 11308c2ecf20Sopenharmony_ci u32); 11318c2ecf20Sopenharmony_ciint mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv, 11328c2ecf20Sopenharmony_ci struct host_cmd_ds_command *cmd, 11338c2ecf20Sopenharmony_ci u16 cmd_action, uint16_t ps_bitmap, 11348c2ecf20Sopenharmony_ci struct mwifiex_ds_auto_ds *auto_ds); 11358c2ecf20Sopenharmony_ciint mwifiex_ret_enh_power_mode(struct mwifiex_private *priv, 11368c2ecf20Sopenharmony_ci struct host_cmd_ds_command *resp, 11378c2ecf20Sopenharmony_ci struct mwifiex_ds_pm_cfg *pm_cfg); 11388c2ecf20Sopenharmony_civoid mwifiex_process_hs_config(struct mwifiex_adapter *adapter); 11398c2ecf20Sopenharmony_civoid mwifiex_hs_activated_event(struct mwifiex_private *priv, 11408c2ecf20Sopenharmony_ci u8 activated); 11418c2ecf20Sopenharmony_ciint mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, 11428c2ecf20Sopenharmony_ci int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg); 11438c2ecf20Sopenharmony_ciint mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, 11448c2ecf20Sopenharmony_ci struct host_cmd_ds_command *resp); 11458c2ecf20Sopenharmony_ciint mwifiex_process_rx_packet(struct mwifiex_private *priv, 11468c2ecf20Sopenharmony_ci struct sk_buff *skb); 11478c2ecf20Sopenharmony_ciint mwifiex_sta_prepare_cmd(struct mwifiex_private *, uint16_t cmd_no, 11488c2ecf20Sopenharmony_ci u16 cmd_action, u32 cmd_oid, 11498c2ecf20Sopenharmony_ci void *data_buf, void *cmd_buf); 11508c2ecf20Sopenharmony_ciint mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, 11518c2ecf20Sopenharmony_ci u16 cmd_action, u32 cmd_oid, 11528c2ecf20Sopenharmony_ci void *data_buf, void *cmd_buf); 11538c2ecf20Sopenharmony_ciint mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no, 11548c2ecf20Sopenharmony_ci struct host_cmd_ds_command *resp); 11558c2ecf20Sopenharmony_ciint mwifiex_process_sta_rx_packet(struct mwifiex_private *, 11568c2ecf20Sopenharmony_ci struct sk_buff *skb); 11578c2ecf20Sopenharmony_ciint mwifiex_process_uap_rx_packet(struct mwifiex_private *priv, 11588c2ecf20Sopenharmony_ci struct sk_buff *skb); 11598c2ecf20Sopenharmony_ciint mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv, 11608c2ecf20Sopenharmony_ci struct sk_buff *skb); 11618c2ecf20Sopenharmony_ciint mwifiex_process_sta_event(struct mwifiex_private *); 11628c2ecf20Sopenharmony_ciint mwifiex_process_uap_event(struct mwifiex_private *); 11638c2ecf20Sopenharmony_civoid mwifiex_delete_all_station_list(struct mwifiex_private *priv); 11648c2ecf20Sopenharmony_civoid mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv, 11658c2ecf20Sopenharmony_ci const u8 *ra_addr); 11668c2ecf20Sopenharmony_civoid *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb); 11678c2ecf20Sopenharmony_civoid *mwifiex_process_uap_txpd(struct mwifiex_private *, struct sk_buff *skb); 11688c2ecf20Sopenharmony_ciint mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta, bool init); 11698c2ecf20Sopenharmony_ciint mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd, 11708c2ecf20Sopenharmony_ci struct mwifiex_scan_cmd_config *scan_cfg); 11718c2ecf20Sopenharmony_civoid mwifiex_queue_scan_cmd(struct mwifiex_private *priv, 11728c2ecf20Sopenharmony_ci struct cmd_ctrl_node *cmd_node); 11738c2ecf20Sopenharmony_ciint mwifiex_ret_802_11_scan(struct mwifiex_private *priv, 11748c2ecf20Sopenharmony_ci struct host_cmd_ds_command *resp); 11758c2ecf20Sopenharmony_cis32 mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2); 11768c2ecf20Sopenharmony_ciint mwifiex_associate(struct mwifiex_private *priv, 11778c2ecf20Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 11788c2ecf20Sopenharmony_ciint mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, 11798c2ecf20Sopenharmony_ci struct host_cmd_ds_command *cmd, 11808c2ecf20Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 11818c2ecf20Sopenharmony_ciint mwifiex_ret_802_11_associate(struct mwifiex_private *priv, 11828c2ecf20Sopenharmony_ci struct host_cmd_ds_command *resp); 11838c2ecf20Sopenharmony_civoid mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason, 11848c2ecf20Sopenharmony_ci bool from_ap); 11858c2ecf20Sopenharmony_ciu8 mwifiex_band_to_radio_type(u8 band); 11868c2ecf20Sopenharmony_ciint mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac); 11878c2ecf20Sopenharmony_civoid mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter); 11888c2ecf20Sopenharmony_ciint mwifiex_adhoc_start(struct mwifiex_private *priv, 11898c2ecf20Sopenharmony_ci struct cfg80211_ssid *adhoc_ssid); 11908c2ecf20Sopenharmony_ciint mwifiex_adhoc_join(struct mwifiex_private *priv, 11918c2ecf20Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 11928c2ecf20Sopenharmony_ciint mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, 11938c2ecf20Sopenharmony_ci struct host_cmd_ds_command *cmd, 11948c2ecf20Sopenharmony_ci struct cfg80211_ssid *req_ssid); 11958c2ecf20Sopenharmony_ciint mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, 11968c2ecf20Sopenharmony_ci struct host_cmd_ds_command *cmd, 11978c2ecf20Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 11988c2ecf20Sopenharmony_ciint mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv, 11998c2ecf20Sopenharmony_ci struct host_cmd_ds_command *resp); 12008c2ecf20Sopenharmony_ciint mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command *cmd); 12018c2ecf20Sopenharmony_cistruct mwifiex_chan_freq_power *mwifiex_get_cfp(struct mwifiex_private *priv, 12028c2ecf20Sopenharmony_ci u8 band, u16 channel, u32 freq); 12038c2ecf20Sopenharmony_ciu32 mwifiex_index_to_data_rate(struct mwifiex_private *priv, 12048c2ecf20Sopenharmony_ci u8 index, u8 ht_info); 12058c2ecf20Sopenharmony_ciu32 mwifiex_index_to_acs_data_rate(struct mwifiex_private *priv, 12068c2ecf20Sopenharmony_ci u8 index, u8 ht_info); 12078c2ecf20Sopenharmony_ciu32 mwifiex_find_freq_from_band_chan(u8, u8); 12088c2ecf20Sopenharmony_ciint mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv, u16 vsie_mask, 12098c2ecf20Sopenharmony_ci u8 **buffer); 12108c2ecf20Sopenharmony_ciu32 mwifiex_get_active_data_rates(struct mwifiex_private *priv, 12118c2ecf20Sopenharmony_ci u8 *rates); 12128c2ecf20Sopenharmony_ciu32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates); 12138c2ecf20Sopenharmony_ciu32 mwifiex_get_rates_from_cfg80211(struct mwifiex_private *priv, 12148c2ecf20Sopenharmony_ci u8 *rates, u8 radio_type); 12158c2ecf20Sopenharmony_ciu8 mwifiex_is_rate_auto(struct mwifiex_private *priv); 12168c2ecf20Sopenharmony_ciextern u16 region_code_index[MWIFIEX_MAX_REGION_CODE]; 12178c2ecf20Sopenharmony_civoid mwifiex_save_curr_bcn(struct mwifiex_private *priv); 12188c2ecf20Sopenharmony_civoid mwifiex_free_curr_bcn(struct mwifiex_private *priv); 12198c2ecf20Sopenharmony_ciint mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv, 12208c2ecf20Sopenharmony_ci struct host_cmd_ds_command *cmd); 12218c2ecf20Sopenharmony_ciint mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, 12228c2ecf20Sopenharmony_ci struct host_cmd_ds_command *resp); 12238c2ecf20Sopenharmony_ciint is_command_pending(struct mwifiex_adapter *adapter); 12248c2ecf20Sopenharmony_civoid mwifiex_init_priv_params(struct mwifiex_private *priv, 12258c2ecf20Sopenharmony_ci struct net_device *dev); 12268c2ecf20Sopenharmony_ciint mwifiex_set_secure_params(struct mwifiex_private *priv, 12278c2ecf20Sopenharmony_ci struct mwifiex_uap_bss_param *bss_config, 12288c2ecf20Sopenharmony_ci struct cfg80211_ap_settings *params); 12298c2ecf20Sopenharmony_civoid mwifiex_set_ht_params(struct mwifiex_private *priv, 12308c2ecf20Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg, 12318c2ecf20Sopenharmony_ci struct cfg80211_ap_settings *params); 12328c2ecf20Sopenharmony_civoid mwifiex_set_vht_params(struct mwifiex_private *priv, 12338c2ecf20Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg, 12348c2ecf20Sopenharmony_ci struct cfg80211_ap_settings *params); 12358c2ecf20Sopenharmony_civoid mwifiex_set_tpc_params(struct mwifiex_private *priv, 12368c2ecf20Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg, 12378c2ecf20Sopenharmony_ci struct cfg80211_ap_settings *params); 12388c2ecf20Sopenharmony_civoid mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg, 12398c2ecf20Sopenharmony_ci struct cfg80211_ap_settings *params); 12408c2ecf20Sopenharmony_civoid mwifiex_set_vht_width(struct mwifiex_private *priv, 12418c2ecf20Sopenharmony_ci enum nl80211_chan_width width, 12428c2ecf20Sopenharmony_ci bool ap_11ac_disable); 12438c2ecf20Sopenharmony_civoid 12448c2ecf20Sopenharmony_cimwifiex_set_wmm_params(struct mwifiex_private *priv, 12458c2ecf20Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg, 12468c2ecf20Sopenharmony_ci struct cfg80211_ap_settings *params); 12478c2ecf20Sopenharmony_civoid mwifiex_set_ba_params(struct mwifiex_private *priv); 12488c2ecf20Sopenharmony_ci 12498c2ecf20Sopenharmony_civoid mwifiex_update_ampdu_txwinsize(struct mwifiex_adapter *pmadapter); 12508c2ecf20Sopenharmony_civoid mwifiex_bt_coex_wlan_param_update_event(struct mwifiex_private *priv, 12518c2ecf20Sopenharmony_ci struct sk_buff *event_skb); 12528c2ecf20Sopenharmony_ci 12538c2ecf20Sopenharmony_civoid mwifiex_set_11ac_ba_params(struct mwifiex_private *priv); 12548c2ecf20Sopenharmony_ciint mwifiex_cmd_802_11_scan_ext(struct mwifiex_private *priv, 12558c2ecf20Sopenharmony_ci struct host_cmd_ds_command *cmd, 12568c2ecf20Sopenharmony_ci void *data_buf); 12578c2ecf20Sopenharmony_ciint mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv, 12588c2ecf20Sopenharmony_ci struct host_cmd_ds_command *resp); 12598c2ecf20Sopenharmony_ciint mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv, 12608c2ecf20Sopenharmony_ci void *buf); 12618c2ecf20Sopenharmony_ciint mwifiex_cmd_802_11_bg_scan_config(struct mwifiex_private *priv, 12628c2ecf20Sopenharmony_ci struct host_cmd_ds_command *cmd, 12638c2ecf20Sopenharmony_ci void *data_buf); 12648c2ecf20Sopenharmony_ciint mwifiex_stop_bg_scan(struct mwifiex_private *priv); 12658c2ecf20Sopenharmony_ci 12668c2ecf20Sopenharmony_ci/* 12678c2ecf20Sopenharmony_ci * This function checks if the queuing is RA based or not. 12688c2ecf20Sopenharmony_ci */ 12698c2ecf20Sopenharmony_cistatic inline u8 12708c2ecf20Sopenharmony_cimwifiex_queuing_ra_based(struct mwifiex_private *priv) 12718c2ecf20Sopenharmony_ci{ 12728c2ecf20Sopenharmony_ci /* 12738c2ecf20Sopenharmony_ci * Currently we assume if we are in Infra, then DA=RA. This might not be 12748c2ecf20Sopenharmony_ci * true in the future 12758c2ecf20Sopenharmony_ci */ 12768c2ecf20Sopenharmony_ci if ((priv->bss_mode == NL80211_IFTYPE_STATION || 12778c2ecf20Sopenharmony_ci priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) && 12788c2ecf20Sopenharmony_ci (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA)) 12798c2ecf20Sopenharmony_ci return false; 12808c2ecf20Sopenharmony_ci 12818c2ecf20Sopenharmony_ci return true; 12828c2ecf20Sopenharmony_ci} 12838c2ecf20Sopenharmony_ci 12848c2ecf20Sopenharmony_ci/* 12858c2ecf20Sopenharmony_ci * This function copies rates. 12868c2ecf20Sopenharmony_ci */ 12878c2ecf20Sopenharmony_cistatic inline u32 12888c2ecf20Sopenharmony_cimwifiex_copy_rates(u8 *dest, u32 pos, u8 *src, int len) 12898c2ecf20Sopenharmony_ci{ 12908c2ecf20Sopenharmony_ci int i; 12918c2ecf20Sopenharmony_ci 12928c2ecf20Sopenharmony_ci for (i = 0; i < len && src[i]; i++, pos++) { 12938c2ecf20Sopenharmony_ci if (pos >= MWIFIEX_SUPPORTED_RATES) 12948c2ecf20Sopenharmony_ci break; 12958c2ecf20Sopenharmony_ci dest[pos] = src[i]; 12968c2ecf20Sopenharmony_ci } 12978c2ecf20Sopenharmony_ci 12988c2ecf20Sopenharmony_ci return pos; 12998c2ecf20Sopenharmony_ci} 13008c2ecf20Sopenharmony_ci 13018c2ecf20Sopenharmony_ci/* 13028c2ecf20Sopenharmony_ci * This function returns the correct private structure pointer based 13038c2ecf20Sopenharmony_ci * upon the BSS type and BSS number. 13048c2ecf20Sopenharmony_ci */ 13058c2ecf20Sopenharmony_cistatic inline struct mwifiex_private * 13068c2ecf20Sopenharmony_cimwifiex_get_priv_by_id(struct mwifiex_adapter *adapter, 13078c2ecf20Sopenharmony_ci u8 bss_num, u8 bss_type) 13088c2ecf20Sopenharmony_ci{ 13098c2ecf20Sopenharmony_ci int i; 13108c2ecf20Sopenharmony_ci 13118c2ecf20Sopenharmony_ci for (i = 0; i < adapter->priv_num; i++) { 13128c2ecf20Sopenharmony_ci if (adapter->priv[i]) { 13138c2ecf20Sopenharmony_ci if ((adapter->priv[i]->bss_num == bss_num) && 13148c2ecf20Sopenharmony_ci (adapter->priv[i]->bss_type == bss_type)) 13158c2ecf20Sopenharmony_ci break; 13168c2ecf20Sopenharmony_ci } 13178c2ecf20Sopenharmony_ci } 13188c2ecf20Sopenharmony_ci return ((i < adapter->priv_num) ? adapter->priv[i] : NULL); 13198c2ecf20Sopenharmony_ci} 13208c2ecf20Sopenharmony_ci 13218c2ecf20Sopenharmony_ci/* 13228c2ecf20Sopenharmony_ci * This function returns the first available private structure pointer 13238c2ecf20Sopenharmony_ci * based upon the BSS role. 13248c2ecf20Sopenharmony_ci */ 13258c2ecf20Sopenharmony_cistatic inline struct mwifiex_private * 13268c2ecf20Sopenharmony_cimwifiex_get_priv(struct mwifiex_adapter *adapter, 13278c2ecf20Sopenharmony_ci enum mwifiex_bss_role bss_role) 13288c2ecf20Sopenharmony_ci{ 13298c2ecf20Sopenharmony_ci int i; 13308c2ecf20Sopenharmony_ci 13318c2ecf20Sopenharmony_ci for (i = 0; i < adapter->priv_num; i++) { 13328c2ecf20Sopenharmony_ci if (adapter->priv[i]) { 13338c2ecf20Sopenharmony_ci if (bss_role == MWIFIEX_BSS_ROLE_ANY || 13348c2ecf20Sopenharmony_ci GET_BSS_ROLE(adapter->priv[i]) == bss_role) 13358c2ecf20Sopenharmony_ci break; 13368c2ecf20Sopenharmony_ci } 13378c2ecf20Sopenharmony_ci } 13388c2ecf20Sopenharmony_ci 13398c2ecf20Sopenharmony_ci return ((i < adapter->priv_num) ? adapter->priv[i] : NULL); 13408c2ecf20Sopenharmony_ci} 13418c2ecf20Sopenharmony_ci 13428c2ecf20Sopenharmony_ci/* 13438c2ecf20Sopenharmony_ci * This function checks available bss_num when adding new interface or 13448c2ecf20Sopenharmony_ci * changing interface type. 13458c2ecf20Sopenharmony_ci */ 13468c2ecf20Sopenharmony_cistatic inline u8 13478c2ecf20Sopenharmony_cimwifiex_get_unused_bss_num(struct mwifiex_adapter *adapter, u8 bss_type) 13488c2ecf20Sopenharmony_ci{ 13498c2ecf20Sopenharmony_ci u8 i, j; 13508c2ecf20Sopenharmony_ci int index[MWIFIEX_MAX_BSS_NUM]; 13518c2ecf20Sopenharmony_ci 13528c2ecf20Sopenharmony_ci memset(index, 0, sizeof(index)); 13538c2ecf20Sopenharmony_ci for (i = 0; i < adapter->priv_num; i++) 13548c2ecf20Sopenharmony_ci if (adapter->priv[i]) { 13558c2ecf20Sopenharmony_ci if (adapter->priv[i]->bss_type == bss_type && 13568c2ecf20Sopenharmony_ci !(adapter->priv[i]->bss_mode == 13578c2ecf20Sopenharmony_ci NL80211_IFTYPE_UNSPECIFIED)) { 13588c2ecf20Sopenharmony_ci index[adapter->priv[i]->bss_num] = 1; 13598c2ecf20Sopenharmony_ci } 13608c2ecf20Sopenharmony_ci } 13618c2ecf20Sopenharmony_ci for (j = 0; j < MWIFIEX_MAX_BSS_NUM; j++) 13628c2ecf20Sopenharmony_ci if (!index[j]) 13638c2ecf20Sopenharmony_ci return j; 13648c2ecf20Sopenharmony_ci return -1; 13658c2ecf20Sopenharmony_ci} 13668c2ecf20Sopenharmony_ci 13678c2ecf20Sopenharmony_ci/* 13688c2ecf20Sopenharmony_ci * This function returns the first available unused private structure pointer. 13698c2ecf20Sopenharmony_ci */ 13708c2ecf20Sopenharmony_cistatic inline struct mwifiex_private * 13718c2ecf20Sopenharmony_cimwifiex_get_unused_priv_by_bss_type(struct mwifiex_adapter *adapter, 13728c2ecf20Sopenharmony_ci u8 bss_type) 13738c2ecf20Sopenharmony_ci{ 13748c2ecf20Sopenharmony_ci u8 i; 13758c2ecf20Sopenharmony_ci 13768c2ecf20Sopenharmony_ci for (i = 0; i < adapter->priv_num; i++) 13778c2ecf20Sopenharmony_ci if (adapter->priv[i]->bss_mode == 13788c2ecf20Sopenharmony_ci NL80211_IFTYPE_UNSPECIFIED) { 13798c2ecf20Sopenharmony_ci adapter->priv[i]->bss_num = 13808c2ecf20Sopenharmony_ci mwifiex_get_unused_bss_num(adapter, bss_type); 13818c2ecf20Sopenharmony_ci break; 13828c2ecf20Sopenharmony_ci } 13838c2ecf20Sopenharmony_ci 13848c2ecf20Sopenharmony_ci return ((i < adapter->priv_num) ? adapter->priv[i] : NULL); 13858c2ecf20Sopenharmony_ci} 13868c2ecf20Sopenharmony_ci 13878c2ecf20Sopenharmony_ci/* 13888c2ecf20Sopenharmony_ci * This function returns the driver private structure of a network device. 13898c2ecf20Sopenharmony_ci */ 13908c2ecf20Sopenharmony_cistatic inline struct mwifiex_private * 13918c2ecf20Sopenharmony_cimwifiex_netdev_get_priv(struct net_device *dev) 13928c2ecf20Sopenharmony_ci{ 13938c2ecf20Sopenharmony_ci return (struct mwifiex_private *) (*(unsigned long *) netdev_priv(dev)); 13948c2ecf20Sopenharmony_ci} 13958c2ecf20Sopenharmony_ci 13968c2ecf20Sopenharmony_ci/* 13978c2ecf20Sopenharmony_ci * This function checks if a skb holds a management frame. 13988c2ecf20Sopenharmony_ci */ 13998c2ecf20Sopenharmony_cistatic inline bool mwifiex_is_skb_mgmt_frame(struct sk_buff *skb) 14008c2ecf20Sopenharmony_ci{ 14018c2ecf20Sopenharmony_ci return (get_unaligned_le32(skb->data) == PKT_TYPE_MGMT); 14028c2ecf20Sopenharmony_ci} 14038c2ecf20Sopenharmony_ci 14048c2ecf20Sopenharmony_ci/* This function retrieves channel closed for operation by Channel 14058c2ecf20Sopenharmony_ci * Switch Announcement. 14068c2ecf20Sopenharmony_ci */ 14078c2ecf20Sopenharmony_cistatic inline u8 14088c2ecf20Sopenharmony_cimwifiex_11h_get_csa_closed_channel(struct mwifiex_private *priv) 14098c2ecf20Sopenharmony_ci{ 14108c2ecf20Sopenharmony_ci if (!priv->csa_chan) 14118c2ecf20Sopenharmony_ci return 0; 14128c2ecf20Sopenharmony_ci 14138c2ecf20Sopenharmony_ci /* Clear csa channel, if DFS channel move time has passed */ 14148c2ecf20Sopenharmony_ci if (time_after(jiffies, priv->csa_expire_time)) { 14158c2ecf20Sopenharmony_ci priv->csa_chan = 0; 14168c2ecf20Sopenharmony_ci priv->csa_expire_time = 0; 14178c2ecf20Sopenharmony_ci } 14188c2ecf20Sopenharmony_ci 14198c2ecf20Sopenharmony_ci return priv->csa_chan; 14208c2ecf20Sopenharmony_ci} 14218c2ecf20Sopenharmony_ci 14228c2ecf20Sopenharmony_cistatic inline u8 mwifiex_is_any_intf_active(struct mwifiex_private *priv) 14238c2ecf20Sopenharmony_ci{ 14248c2ecf20Sopenharmony_ci struct mwifiex_private *priv_num; 14258c2ecf20Sopenharmony_ci int i; 14268c2ecf20Sopenharmony_ci 14278c2ecf20Sopenharmony_ci for (i = 0; i < priv->adapter->priv_num; i++) { 14288c2ecf20Sopenharmony_ci priv_num = priv->adapter->priv[i]; 14298c2ecf20Sopenharmony_ci if (priv_num) { 14308c2ecf20Sopenharmony_ci if ((GET_BSS_ROLE(priv_num) == MWIFIEX_BSS_ROLE_UAP && 14318c2ecf20Sopenharmony_ci priv_num->bss_started) || 14328c2ecf20Sopenharmony_ci (GET_BSS_ROLE(priv_num) == MWIFIEX_BSS_ROLE_STA && 14338c2ecf20Sopenharmony_ci priv_num->media_connected)) 14348c2ecf20Sopenharmony_ci return 1; 14358c2ecf20Sopenharmony_ci } 14368c2ecf20Sopenharmony_ci } 14378c2ecf20Sopenharmony_ci 14388c2ecf20Sopenharmony_ci return 0; 14398c2ecf20Sopenharmony_ci} 14408c2ecf20Sopenharmony_ci 14418c2ecf20Sopenharmony_cistatic inline u8 mwifiex_is_tdls_link_setup(u8 status) 14428c2ecf20Sopenharmony_ci{ 14438c2ecf20Sopenharmony_ci switch (status) { 14448c2ecf20Sopenharmony_ci case TDLS_SETUP_COMPLETE: 14458c2ecf20Sopenharmony_ci case TDLS_CHAN_SWITCHING: 14468c2ecf20Sopenharmony_ci case TDLS_IN_BASE_CHAN: 14478c2ecf20Sopenharmony_ci case TDLS_IN_OFF_CHAN: 14488c2ecf20Sopenharmony_ci return true; 14498c2ecf20Sopenharmony_ci default: 14508c2ecf20Sopenharmony_ci break; 14518c2ecf20Sopenharmony_ci } 14528c2ecf20Sopenharmony_ci 14538c2ecf20Sopenharmony_ci return false; 14548c2ecf20Sopenharmony_ci} 14558c2ecf20Sopenharmony_ci 14568c2ecf20Sopenharmony_ci/* Disable platform specific wakeup interrupt */ 14578c2ecf20Sopenharmony_cistatic inline void mwifiex_disable_wake(struct mwifiex_adapter *adapter) 14588c2ecf20Sopenharmony_ci{ 14598c2ecf20Sopenharmony_ci if (adapter->irq_wakeup >= 0) { 14608c2ecf20Sopenharmony_ci disable_irq_wake(adapter->irq_wakeup); 14618c2ecf20Sopenharmony_ci disable_irq(adapter->irq_wakeup); 14628c2ecf20Sopenharmony_ci if (adapter->wake_by_wifi) 14638c2ecf20Sopenharmony_ci /* Undo our disable, since interrupt handler already 14648c2ecf20Sopenharmony_ci * did this. 14658c2ecf20Sopenharmony_ci */ 14668c2ecf20Sopenharmony_ci enable_irq(adapter->irq_wakeup); 14678c2ecf20Sopenharmony_ci 14688c2ecf20Sopenharmony_ci } 14698c2ecf20Sopenharmony_ci} 14708c2ecf20Sopenharmony_ci 14718c2ecf20Sopenharmony_ci/* Enable platform specific wakeup interrupt */ 14728c2ecf20Sopenharmony_cistatic inline void mwifiex_enable_wake(struct mwifiex_adapter *adapter) 14738c2ecf20Sopenharmony_ci{ 14748c2ecf20Sopenharmony_ci /* Enable platform specific wakeup interrupt */ 14758c2ecf20Sopenharmony_ci if (adapter->irq_wakeup >= 0) { 14768c2ecf20Sopenharmony_ci adapter->wake_by_wifi = false; 14778c2ecf20Sopenharmony_ci enable_irq(adapter->irq_wakeup); 14788c2ecf20Sopenharmony_ci enable_irq_wake(adapter->irq_wakeup); 14798c2ecf20Sopenharmony_ci } 14808c2ecf20Sopenharmony_ci} 14818c2ecf20Sopenharmony_ci 14828c2ecf20Sopenharmony_ciint mwifiex_init_shutdown_fw(struct mwifiex_private *priv, 14838c2ecf20Sopenharmony_ci u32 func_init_shutdown); 14848c2ecf20Sopenharmony_ci 14858c2ecf20Sopenharmony_ciint mwifiex_add_card(void *card, struct completion *fw_done, 14868c2ecf20Sopenharmony_ci struct mwifiex_if_ops *if_ops, u8 iface_type, 14878c2ecf20Sopenharmony_ci struct device *dev); 14888c2ecf20Sopenharmony_ciint mwifiex_remove_card(struct mwifiex_adapter *adapter); 14898c2ecf20Sopenharmony_ci 14908c2ecf20Sopenharmony_civoid mwifiex_get_version(struct mwifiex_adapter *adapter, char *version, 14918c2ecf20Sopenharmony_ci int maxlen); 14928c2ecf20Sopenharmony_ciint mwifiex_request_set_multicast_list(struct mwifiex_private *priv, 14938c2ecf20Sopenharmony_ci struct mwifiex_multicast_list *mcast_list); 14948c2ecf20Sopenharmony_ciint mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist, 14958c2ecf20Sopenharmony_ci struct net_device *dev); 14968c2ecf20Sopenharmony_ciint mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter, 14978c2ecf20Sopenharmony_ci struct cmd_ctrl_node *cmd_queued); 14988c2ecf20Sopenharmony_ciint mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, 14998c2ecf20Sopenharmony_ci struct cfg80211_ssid *req_ssid); 15008c2ecf20Sopenharmony_ciint mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type); 15018c2ecf20Sopenharmony_ciint mwifiex_enable_hs(struct mwifiex_adapter *adapter); 15028c2ecf20Sopenharmony_ciint mwifiex_disable_auto_ds(struct mwifiex_private *priv); 15038c2ecf20Sopenharmony_ciint mwifiex_drv_get_data_rate(struct mwifiex_private *priv, u32 *rate); 15048c2ecf20Sopenharmony_ciint mwifiex_request_scan(struct mwifiex_private *priv, 15058c2ecf20Sopenharmony_ci struct cfg80211_ssid *req_ssid); 15068c2ecf20Sopenharmony_ciint mwifiex_scan_networks(struct mwifiex_private *priv, 15078c2ecf20Sopenharmony_ci const struct mwifiex_user_scan_cfg *user_scan_in); 15088c2ecf20Sopenharmony_ciint mwifiex_set_radio(struct mwifiex_private *priv, u8 option); 15098c2ecf20Sopenharmony_ci 15108c2ecf20Sopenharmony_ciint mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp, 15118c2ecf20Sopenharmony_ci const u8 *key, int key_len, u8 key_index, 15128c2ecf20Sopenharmony_ci const u8 *mac_addr, int disable); 15138c2ecf20Sopenharmony_ci 15148c2ecf20Sopenharmony_ciint mwifiex_set_gen_ie(struct mwifiex_private *priv, const u8 *ie, int ie_len); 15158c2ecf20Sopenharmony_ci 15168c2ecf20Sopenharmony_ciint mwifiex_get_ver_ext(struct mwifiex_private *priv, u32 version_str_sel); 15178c2ecf20Sopenharmony_ci 15188c2ecf20Sopenharmony_ciint mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action, 15198c2ecf20Sopenharmony_ci struct ieee80211_channel *chan, 15208c2ecf20Sopenharmony_ci unsigned int duration); 15218c2ecf20Sopenharmony_ci 15228c2ecf20Sopenharmony_ciint mwifiex_get_stats_info(struct mwifiex_private *priv, 15238c2ecf20Sopenharmony_ci struct mwifiex_ds_get_stats *log); 15248c2ecf20Sopenharmony_ci 15258c2ecf20Sopenharmony_ciint mwifiex_reg_write(struct mwifiex_private *priv, u32 reg_type, 15268c2ecf20Sopenharmony_ci u32 reg_offset, u32 reg_value); 15278c2ecf20Sopenharmony_ci 15288c2ecf20Sopenharmony_ciint mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type, 15298c2ecf20Sopenharmony_ci u32 reg_offset, u32 *value); 15308c2ecf20Sopenharmony_ci 15318c2ecf20Sopenharmony_ciint mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes, 15328c2ecf20Sopenharmony_ci u8 *value); 15338c2ecf20Sopenharmony_ci 15348c2ecf20Sopenharmony_ciint mwifiex_set_11n_httx_cfg(struct mwifiex_private *priv, int data); 15358c2ecf20Sopenharmony_ci 15368c2ecf20Sopenharmony_ciint mwifiex_get_11n_httx_cfg(struct mwifiex_private *priv, int *data); 15378c2ecf20Sopenharmony_ci 15388c2ecf20Sopenharmony_ciint mwifiex_set_tx_rate_cfg(struct mwifiex_private *priv, int tx_rate_index); 15398c2ecf20Sopenharmony_ci 15408c2ecf20Sopenharmony_ciint mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_index); 15418c2ecf20Sopenharmony_ci 15428c2ecf20Sopenharmony_ciint mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode); 15438c2ecf20Sopenharmony_ci 15448c2ecf20Sopenharmony_ciint mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter, 15458c2ecf20Sopenharmony_ci char *version, int max_len); 15468c2ecf20Sopenharmony_ci 15478c2ecf20Sopenharmony_ciint mwifiex_set_tx_power(struct mwifiex_private *priv, 15488c2ecf20Sopenharmony_ci struct mwifiex_power_cfg *power_cfg); 15498c2ecf20Sopenharmony_ci 15508c2ecf20Sopenharmony_ciint mwifiex_main_process(struct mwifiex_adapter *); 15518c2ecf20Sopenharmony_ci 15528c2ecf20Sopenharmony_ciint mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb); 15538c2ecf20Sopenharmony_ci 15548c2ecf20Sopenharmony_ciint mwifiex_get_bss_info(struct mwifiex_private *, 15558c2ecf20Sopenharmony_ci struct mwifiex_bss_info *); 15568c2ecf20Sopenharmony_ciint mwifiex_fill_new_bss_desc(struct mwifiex_private *priv, 15578c2ecf20Sopenharmony_ci struct cfg80211_bss *bss, 15588c2ecf20Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 15598c2ecf20Sopenharmony_ciint mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, 15608c2ecf20Sopenharmony_ci struct mwifiex_bssdescriptor *bss_entry); 15618c2ecf20Sopenharmony_ciint mwifiex_check_network_compatibility(struct mwifiex_private *priv, 15628c2ecf20Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 15638c2ecf20Sopenharmony_ci 15648c2ecf20Sopenharmony_ciu8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type); 15658c2ecf20Sopenharmony_ciu8 mwifiex_get_chan_type(struct mwifiex_private *priv); 15668c2ecf20Sopenharmony_ci 15678c2ecf20Sopenharmony_cistruct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, 15688c2ecf20Sopenharmony_ci const char *name, 15698c2ecf20Sopenharmony_ci unsigned char name_assign_type, 15708c2ecf20Sopenharmony_ci enum nl80211_iftype type, 15718c2ecf20Sopenharmony_ci struct vif_params *params); 15728c2ecf20Sopenharmony_ciint mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev); 15738c2ecf20Sopenharmony_ci 15748c2ecf20Sopenharmony_civoid mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config); 15758c2ecf20Sopenharmony_ci 15768c2ecf20Sopenharmony_ciint mwifiex_add_wowlan_magic_pkt_filter(struct mwifiex_adapter *adapter); 15778c2ecf20Sopenharmony_ci 15788c2ecf20Sopenharmony_ciint mwifiex_set_mgmt_ies(struct mwifiex_private *priv, 15798c2ecf20Sopenharmony_ci struct cfg80211_beacon_data *data); 15808c2ecf20Sopenharmony_ciint mwifiex_del_mgmt_ies(struct mwifiex_private *priv); 15818c2ecf20Sopenharmony_ciu8 *mwifiex_11d_code_2_region(u8 code); 15828c2ecf20Sopenharmony_civoid mwifiex_uap_set_channel(struct mwifiex_private *priv, 15838c2ecf20Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg, 15848c2ecf20Sopenharmony_ci struct cfg80211_chan_def chandef); 15858c2ecf20Sopenharmony_ciint mwifiex_config_start_uap(struct mwifiex_private *priv, 15868c2ecf20Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg); 15878c2ecf20Sopenharmony_civoid mwifiex_uap_del_sta_data(struct mwifiex_private *priv, 15888c2ecf20Sopenharmony_ci struct mwifiex_sta_node *node); 15898c2ecf20Sopenharmony_ci 15908c2ecf20Sopenharmony_civoid mwifiex_config_uap_11d(struct mwifiex_private *priv, 15918c2ecf20Sopenharmony_ci struct cfg80211_beacon_data *beacon_data); 15928c2ecf20Sopenharmony_ci 15938c2ecf20Sopenharmony_civoid mwifiex_init_11h_params(struct mwifiex_private *priv); 15948c2ecf20Sopenharmony_ciint mwifiex_is_11h_active(struct mwifiex_private *priv); 15958c2ecf20Sopenharmony_ciint mwifiex_11h_activate(struct mwifiex_private *priv, bool flag); 15968c2ecf20Sopenharmony_ci 15978c2ecf20Sopenharmony_civoid mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer, 15988c2ecf20Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 15998c2ecf20Sopenharmony_ciint mwifiex_11h_handle_event_chanswann(struct mwifiex_private *priv); 16008c2ecf20Sopenharmony_ciint mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv, 16018c2ecf20Sopenharmony_ci struct device_node *node, const char *prefix); 16028c2ecf20Sopenharmony_civoid mwifiex_dnld_txpwr_table(struct mwifiex_private *priv); 16038c2ecf20Sopenharmony_ci 16048c2ecf20Sopenharmony_ciextern const struct ethtool_ops mwifiex_ethtool_ops; 16058c2ecf20Sopenharmony_ci 16068c2ecf20Sopenharmony_civoid mwifiex_del_all_sta_list(struct mwifiex_private *priv); 16078c2ecf20Sopenharmony_civoid mwifiex_del_sta_entry(struct mwifiex_private *priv, const u8 *mac); 16088c2ecf20Sopenharmony_civoid 16098c2ecf20Sopenharmony_cimwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies, 16108c2ecf20Sopenharmony_ci int ies_len, struct mwifiex_sta_node *node); 16118c2ecf20Sopenharmony_cistruct mwifiex_sta_node * 16128c2ecf20Sopenharmony_cimwifiex_add_sta_entry(struct mwifiex_private *priv, const u8 *mac); 16138c2ecf20Sopenharmony_cistruct mwifiex_sta_node * 16148c2ecf20Sopenharmony_cimwifiex_get_sta_entry(struct mwifiex_private *priv, const u8 *mac); 16158c2ecf20Sopenharmony_ciu8 mwifiex_is_tdls_chan_switching(struct mwifiex_private *priv); 16168c2ecf20Sopenharmony_ciu8 mwifiex_is_tdls_off_chan(struct mwifiex_private *priv); 16178c2ecf20Sopenharmony_ciu8 mwifiex_is_send_cmd_allowed(struct mwifiex_private *priv); 16188c2ecf20Sopenharmony_ciint mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer, 16198c2ecf20Sopenharmony_ci u8 action_code, u8 dialog_token, 16208c2ecf20Sopenharmony_ci u16 status_code, const u8 *extra_ies, 16218c2ecf20Sopenharmony_ci size_t extra_ies_len); 16228c2ecf20Sopenharmony_ciint mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer, 16238c2ecf20Sopenharmony_ci u8 action_code, u8 dialog_token, 16248c2ecf20Sopenharmony_ci u16 status_code, const u8 *extra_ies, 16258c2ecf20Sopenharmony_ci size_t extra_ies_len); 16268c2ecf20Sopenharmony_civoid mwifiex_process_tdls_action_frame(struct mwifiex_private *priv, 16278c2ecf20Sopenharmony_ci u8 *buf, int len); 16288c2ecf20Sopenharmony_ciint mwifiex_tdls_oper(struct mwifiex_private *priv, const u8 *peer, u8 action); 16298c2ecf20Sopenharmony_ciint mwifiex_get_tdls_link_status(struct mwifiex_private *priv, const u8 *mac); 16308c2ecf20Sopenharmony_ciint mwifiex_get_tdls_list(struct mwifiex_private *priv, 16318c2ecf20Sopenharmony_ci struct tdls_peer_info *buf); 16328c2ecf20Sopenharmony_civoid mwifiex_disable_all_tdls_links(struct mwifiex_private *priv); 16338c2ecf20Sopenharmony_cibool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private *priv); 16348c2ecf20Sopenharmony_ciu8 mwifiex_get_center_freq_index(struct mwifiex_private *priv, u8 band, 16358c2ecf20Sopenharmony_ci u32 pri_chan, u8 chan_bw); 16368c2ecf20Sopenharmony_ciint mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter); 16378c2ecf20Sopenharmony_ci 16388c2ecf20Sopenharmony_ciint mwifiex_tdls_check_tx(struct mwifiex_private *priv, struct sk_buff *skb); 16398c2ecf20Sopenharmony_civoid mwifiex_flush_auto_tdls_list(struct mwifiex_private *priv); 16408c2ecf20Sopenharmony_civoid mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv, 16418c2ecf20Sopenharmony_ci const u8 *mac, u8 link_status); 16428c2ecf20Sopenharmony_civoid mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private *priv, 16438c2ecf20Sopenharmony_ci u8 *mac, s8 snr, s8 nflr); 16448c2ecf20Sopenharmony_civoid mwifiex_check_auto_tdls(struct timer_list *t); 16458c2ecf20Sopenharmony_civoid mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv, const u8 *mac); 16468c2ecf20Sopenharmony_civoid mwifiex_setup_auto_tdls_timer(struct mwifiex_private *priv); 16478c2ecf20Sopenharmony_civoid mwifiex_clean_auto_tdls(struct mwifiex_private *priv); 16488c2ecf20Sopenharmony_ciint mwifiex_config_tdls_enable(struct mwifiex_private *priv); 16498c2ecf20Sopenharmony_ciint mwifiex_config_tdls_disable(struct mwifiex_private *priv); 16508c2ecf20Sopenharmony_ciint mwifiex_config_tdls_cs_params(struct mwifiex_private *priv); 16518c2ecf20Sopenharmony_ciint mwifiex_stop_tdls_cs(struct mwifiex_private *priv, const u8 *peer_mac); 16528c2ecf20Sopenharmony_ciint mwifiex_start_tdls_cs(struct mwifiex_private *priv, const u8 *peer_mac, 16538c2ecf20Sopenharmony_ci u8 primary_chan, u8 second_chan_offset, u8 band); 16548c2ecf20Sopenharmony_ci 16558c2ecf20Sopenharmony_ciint mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv, 16568c2ecf20Sopenharmony_ci struct host_cmd_ds_command *cmd, 16578c2ecf20Sopenharmony_ci void *data_buf); 16588c2ecf20Sopenharmony_ciint mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv, 16598c2ecf20Sopenharmony_ci struct sk_buff *skb); 16608c2ecf20Sopenharmony_ci 16618c2ecf20Sopenharmony_civoid mwifiex_parse_tx_status_event(struct mwifiex_private *priv, 16628c2ecf20Sopenharmony_ci void *event_body); 16638c2ecf20Sopenharmony_ci 16648c2ecf20Sopenharmony_cistruct sk_buff * 16658c2ecf20Sopenharmony_cimwifiex_clone_skb_for_tx_status(struct mwifiex_private *priv, 16668c2ecf20Sopenharmony_ci struct sk_buff *skb, u8 flag, u64 *cookie); 16678c2ecf20Sopenharmony_civoid mwifiex_dfs_cac_work_queue(struct work_struct *work); 16688c2ecf20Sopenharmony_civoid mwifiex_dfs_chan_sw_work_queue(struct work_struct *work); 16698c2ecf20Sopenharmony_civoid mwifiex_abort_cac(struct mwifiex_private *priv); 16708c2ecf20Sopenharmony_ciint mwifiex_stop_radar_detection(struct mwifiex_private *priv, 16718c2ecf20Sopenharmony_ci struct cfg80211_chan_def *chandef); 16728c2ecf20Sopenharmony_ciint mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv, 16738c2ecf20Sopenharmony_ci struct sk_buff *skb); 16748c2ecf20Sopenharmony_ci 16758c2ecf20Sopenharmony_civoid mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr, 16768c2ecf20Sopenharmony_ci s8 nflr); 16778c2ecf20Sopenharmony_civoid mwifiex_hist_data_reset(struct mwifiex_private *priv); 16788c2ecf20Sopenharmony_civoid mwifiex_hist_data_add(struct mwifiex_private *priv, 16798c2ecf20Sopenharmony_ci u8 rx_rate, s8 snr, s8 nflr); 16808c2ecf20Sopenharmony_ciu8 mwifiex_adjust_data_rate(struct mwifiex_private *priv, 16818c2ecf20Sopenharmony_ci u8 rx_rate, u8 ht_info); 16828c2ecf20Sopenharmony_ci 16838c2ecf20Sopenharmony_civoid mwifiex_drv_info_dump(struct mwifiex_adapter *adapter); 16848c2ecf20Sopenharmony_civoid mwifiex_prepare_fw_dump_info(struct mwifiex_adapter *adapter); 16858c2ecf20Sopenharmony_civoid mwifiex_upload_device_dump(struct mwifiex_adapter *adapter); 16868c2ecf20Sopenharmony_civoid *mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags); 16878c2ecf20Sopenharmony_civoid mwifiex_fw_dump_event(struct mwifiex_private *priv); 16888c2ecf20Sopenharmony_civoid mwifiex_queue_main_work(struct mwifiex_adapter *adapter); 16898c2ecf20Sopenharmony_ciint mwifiex_get_wakeup_reason(struct mwifiex_private *priv, u16 action, 16908c2ecf20Sopenharmony_ci int cmd_type, 16918c2ecf20Sopenharmony_ci struct mwifiex_ds_wakeup_reason *wakeup_reason); 16928c2ecf20Sopenharmony_ciint mwifiex_get_chan_info(struct mwifiex_private *priv, 16938c2ecf20Sopenharmony_ci struct mwifiex_channel_band *channel_band); 16948c2ecf20Sopenharmony_ciint mwifiex_ret_wakeup_reason(struct mwifiex_private *priv, 16958c2ecf20Sopenharmony_ci struct host_cmd_ds_command *resp, 16968c2ecf20Sopenharmony_ci struct host_cmd_ds_wakeup_reason *wakeup_reason); 16978c2ecf20Sopenharmony_civoid mwifiex_coex_ampdu_rxwinsize(struct mwifiex_adapter *adapter); 16988c2ecf20Sopenharmony_civoid mwifiex_11n_delba(struct mwifiex_private *priv, int tid); 16998c2ecf20Sopenharmony_ciint mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy); 17008c2ecf20Sopenharmony_civoid mwifiex_process_tx_pause_event(struct mwifiex_private *priv, 17018c2ecf20Sopenharmony_ci struct sk_buff *event); 17028c2ecf20Sopenharmony_civoid mwifiex_process_multi_chan_event(struct mwifiex_private *priv, 17038c2ecf20Sopenharmony_ci struct sk_buff *event_skb); 17048c2ecf20Sopenharmony_civoid mwifiex_multi_chan_resync(struct mwifiex_adapter *adapter); 17058c2ecf20Sopenharmony_ciint mwifiex_set_mac_address(struct mwifiex_private *priv, 17068c2ecf20Sopenharmony_ci struct net_device *dev, 17078c2ecf20Sopenharmony_ci bool external, u8 *new_mac); 17088c2ecf20Sopenharmony_civoid mwifiex_devdump_tmo_func(unsigned long function_context); 17098c2ecf20Sopenharmony_ci 17108c2ecf20Sopenharmony_ci#ifdef CONFIG_DEBUG_FS 17118c2ecf20Sopenharmony_civoid mwifiex_debugfs_init(void); 17128c2ecf20Sopenharmony_civoid mwifiex_debugfs_remove(void); 17138c2ecf20Sopenharmony_ci 17148c2ecf20Sopenharmony_civoid mwifiex_dev_debugfs_init(struct mwifiex_private *priv); 17158c2ecf20Sopenharmony_civoid mwifiex_dev_debugfs_remove(struct mwifiex_private *priv); 17168c2ecf20Sopenharmony_ci#endif 17178c2ecf20Sopenharmony_ciint mwifiex_reinit_sw(struct mwifiex_adapter *adapter); 17188c2ecf20Sopenharmony_ciint mwifiex_shutdown_sw(struct mwifiex_adapter *adapter); 17198c2ecf20Sopenharmony_ci#endif /* !_MWIFIEX_MAIN_H_ */ 1720