162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * NXP Wireless LAN device driver: major data structures and prototypes 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright 2011-2020 NXP 662306a36Sopenharmony_ci */ 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci#ifndef _MWIFIEX_MAIN_H_ 962306a36Sopenharmony_ci#define _MWIFIEX_MAIN_H_ 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci#include <linux/completion.h> 1262306a36Sopenharmony_ci#include <linux/kernel.h> 1362306a36Sopenharmony_ci#include <linux/kstrtox.h> 1462306a36Sopenharmony_ci#include <linux/module.h> 1562306a36Sopenharmony_ci#include <linux/sched.h> 1662306a36Sopenharmony_ci#include <linux/semaphore.h> 1762306a36Sopenharmony_ci#include <linux/ip.h> 1862306a36Sopenharmony_ci#include <linux/skbuff.h> 1962306a36Sopenharmony_ci#include <linux/if_arp.h> 2062306a36Sopenharmony_ci#include <linux/etherdevice.h> 2162306a36Sopenharmony_ci#include <net/sock.h> 2262306a36Sopenharmony_ci#include <net/lib80211.h> 2362306a36Sopenharmony_ci#include <linux/vmalloc.h> 2462306a36Sopenharmony_ci#include <linux/firmware.h> 2562306a36Sopenharmony_ci#include <linux/ctype.h> 2662306a36Sopenharmony_ci#include <linux/of.h> 2762306a36Sopenharmony_ci#include <linux/idr.h> 2862306a36Sopenharmony_ci#include <linux/inetdevice.h> 2962306a36Sopenharmony_ci#include <linux/devcoredump.h> 3062306a36Sopenharmony_ci#include <linux/err.h> 3162306a36Sopenharmony_ci#include <linux/gpio.h> 3262306a36Sopenharmony_ci#include <linux/gfp.h> 3362306a36Sopenharmony_ci#include <linux/interrupt.h> 3462306a36Sopenharmony_ci#include <linux/io.h> 3562306a36Sopenharmony_ci#include <linux/of_gpio.h> 3662306a36Sopenharmony_ci#include <linux/of_platform.h> 3762306a36Sopenharmony_ci#include <linux/platform_device.h> 3862306a36Sopenharmony_ci#include <linux/pm_runtime.h> 3962306a36Sopenharmony_ci#include <linux/slab.h> 4062306a36Sopenharmony_ci#include <linux/of_irq.h> 4162306a36Sopenharmony_ci#include <linux/workqueue.h> 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ci#include "decl.h" 4462306a36Sopenharmony_ci#include "ioctl.h" 4562306a36Sopenharmony_ci#include "util.h" 4662306a36Sopenharmony_ci#include "fw.h" 4762306a36Sopenharmony_ci#include "pcie.h" 4862306a36Sopenharmony_ci#include "usb.h" 4962306a36Sopenharmony_ci#include "sdio.h" 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ciextern const char driver_version[]; 5262306a36Sopenharmony_ciextern bool mfg_mode; 5362306a36Sopenharmony_ciextern bool aggr_ctrl; 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_cistruct mwifiex_adapter; 5662306a36Sopenharmony_cistruct mwifiex_private; 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_cienum { 5962306a36Sopenharmony_ci MWIFIEX_ASYNC_CMD, 6062306a36Sopenharmony_ci MWIFIEX_SYNC_CMD 6162306a36Sopenharmony_ci}; 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ci#define MWIFIEX_DRIVER_MODE_STA BIT(0) 6462306a36Sopenharmony_ci#define MWIFIEX_DRIVER_MODE_UAP BIT(1) 6562306a36Sopenharmony_ci#define MWIFIEX_DRIVER_MODE_P2P BIT(2) 6662306a36Sopenharmony_ci#define MWIFIEX_DRIVER_MODE_BITMASK (BIT(0) | BIT(1) | BIT(2)) 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ci#define MWIFIEX_MAX_AP 64 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ci#define MWIFIEX_MAX_PKTS_TXQ 16 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_ci#define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ) 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ci#define MWIFIEX_TIMER_10S 10000 7562306a36Sopenharmony_ci#define MWIFIEX_TIMER_1S 1000 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ci#define MAX_TX_PENDING 400 7862306a36Sopenharmony_ci#define LOW_TX_PENDING 380 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_ci#define HIGH_RX_PENDING 50 8162306a36Sopenharmony_ci#define LOW_RX_PENDING 20 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci#define MWIFIEX_UPLD_SIZE (2312) 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ci#define MAX_EVENT_SIZE 2048 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci#define MWIFIEX_FW_DUMP_SIZE (2 * 1024 * 1024) 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci#define ARP_FILTER_MAX_BUF_SIZE 68 9062306a36Sopenharmony_ci 9162306a36Sopenharmony_ci#define MWIFIEX_KEY_BUFFER_SIZE 16 9262306a36Sopenharmony_ci#define MWIFIEX_DEFAULT_LISTEN_INTERVAL 10 9362306a36Sopenharmony_ci#define MWIFIEX_MAX_REGION_CODE 9 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci#define DEFAULT_BCN_AVG_FACTOR 8 9662306a36Sopenharmony_ci#define DEFAULT_DATA_AVG_FACTOR 8 9762306a36Sopenharmony_ci 9862306a36Sopenharmony_ci#define FIRST_VALID_CHANNEL 0xff 9962306a36Sopenharmony_ci#define DEFAULT_AD_HOC_CHANNEL 6 10062306a36Sopenharmony_ci#define DEFAULT_AD_HOC_CHANNEL_A 36 10162306a36Sopenharmony_ci 10262306a36Sopenharmony_ci#define DEFAULT_BCN_MISS_TIMEOUT 5 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci#define MAX_SCAN_BEACON_BUFFER 8000 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci#define SCAN_BEACON_ENTRY_PAD 6 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci#define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 110 10962306a36Sopenharmony_ci#define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 40 11062306a36Sopenharmony_ci#define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME 40 11162306a36Sopenharmony_ci#define MWIFIEX_DEF_SCAN_CHAN_GAP_TIME 50 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci#define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI))) 11462306a36Sopenharmony_ci 11562306a36Sopenharmony_ci#define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S) 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci#define WPA_GTK_OUI_OFFSET 2 11862306a36Sopenharmony_ci#define RSN_GTK_OUI_OFFSET 2 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_ci#define MWIFIEX_OUI_NOT_PRESENT 0 12162306a36Sopenharmony_ci#define MWIFIEX_OUI_PRESENT 1 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ci#define PKT_TYPE_MGMT 0xE5 12462306a36Sopenharmony_ci 12562306a36Sopenharmony_ci/* 12662306a36Sopenharmony_ci * Do not check for data_received for USB, as data_received 12762306a36Sopenharmony_ci * is handled in mwifiex_usb_recv for USB 12862306a36Sopenharmony_ci */ 12962306a36Sopenharmony_ci#define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \ 13062306a36Sopenharmony_ci adapter->event_received || \ 13162306a36Sopenharmony_ci adapter->data_received) 13262306a36Sopenharmony_ci 13362306a36Sopenharmony_ci#define MWIFIEX_TYPE_CMD 1 13462306a36Sopenharmony_ci#define MWIFIEX_TYPE_DATA 0 13562306a36Sopenharmony_ci#define MWIFIEX_TYPE_AGGR_DATA 10 13662306a36Sopenharmony_ci#define MWIFIEX_TYPE_EVENT 3 13762306a36Sopenharmony_ci 13862306a36Sopenharmony_ci#define MAX_BITMAP_RATES_SIZE 18 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci#define MAX_CHANNEL_BAND_BG 14 14162306a36Sopenharmony_ci#define MAX_CHANNEL_BAND_A 165 14262306a36Sopenharmony_ci 14362306a36Sopenharmony_ci#define MAX_FREQUENCY_BAND_BG 2484 14462306a36Sopenharmony_ci 14562306a36Sopenharmony_ci#define MWIFIEX_EVENT_HEADER_LEN 4 14662306a36Sopenharmony_ci#define MWIFIEX_UAP_EVENT_EXTRA_HEADER 2 14762306a36Sopenharmony_ci 14862306a36Sopenharmony_ci#define MWIFIEX_TYPE_LEN 4 14962306a36Sopenharmony_ci#define MWIFIEX_USB_TYPE_CMD 0xF00DFACE 15062306a36Sopenharmony_ci#define MWIFIEX_USB_TYPE_DATA 0xBEADC0DE 15162306a36Sopenharmony_ci#define MWIFIEX_USB_TYPE_EVENT 0xBEEFFACE 15262306a36Sopenharmony_ci 15362306a36Sopenharmony_ci/* Threshold for tx_timeout_cnt before we trigger a card reset */ 15462306a36Sopenharmony_ci#define TX_TIMEOUT_THRESHOLD 6 15562306a36Sopenharmony_ci 15662306a36Sopenharmony_ci#define MWIFIEX_DRV_INFO_SIZE_MAX 0x40000 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_ci/* Address alignment */ 15962306a36Sopenharmony_ci#define MWIFIEX_ALIGN_ADDR(p, a) (((long)(p) + (a) - 1) & ~((a) - 1)) 16062306a36Sopenharmony_ci 16162306a36Sopenharmony_ci#define MWIFIEX_MAC_LOCAL_ADMIN_BIT 41 16262306a36Sopenharmony_ci 16362306a36Sopenharmony_ci/** 16462306a36Sopenharmony_ci *enum mwifiex_debug_level - marvell wifi debug level 16562306a36Sopenharmony_ci */ 16662306a36Sopenharmony_cienum MWIFIEX_DEBUG_LEVEL { 16762306a36Sopenharmony_ci MWIFIEX_DBG_MSG = 0x00000001, 16862306a36Sopenharmony_ci MWIFIEX_DBG_FATAL = 0x00000002, 16962306a36Sopenharmony_ci MWIFIEX_DBG_ERROR = 0x00000004, 17062306a36Sopenharmony_ci MWIFIEX_DBG_DATA = 0x00000008, 17162306a36Sopenharmony_ci MWIFIEX_DBG_CMD = 0x00000010, 17262306a36Sopenharmony_ci MWIFIEX_DBG_EVENT = 0x00000020, 17362306a36Sopenharmony_ci MWIFIEX_DBG_INTR = 0x00000040, 17462306a36Sopenharmony_ci MWIFIEX_DBG_IOCTL = 0x00000080, 17562306a36Sopenharmony_ci 17662306a36Sopenharmony_ci MWIFIEX_DBG_MPA_D = 0x00008000, 17762306a36Sopenharmony_ci MWIFIEX_DBG_DAT_D = 0x00010000, 17862306a36Sopenharmony_ci MWIFIEX_DBG_CMD_D = 0x00020000, 17962306a36Sopenharmony_ci MWIFIEX_DBG_EVT_D = 0x00040000, 18062306a36Sopenharmony_ci MWIFIEX_DBG_FW_D = 0x00080000, 18162306a36Sopenharmony_ci MWIFIEX_DBG_IF_D = 0x00100000, 18262306a36Sopenharmony_ci 18362306a36Sopenharmony_ci MWIFIEX_DBG_ENTRY = 0x10000000, 18462306a36Sopenharmony_ci MWIFIEX_DBG_WARN = 0x20000000, 18562306a36Sopenharmony_ci MWIFIEX_DBG_INFO = 0x40000000, 18662306a36Sopenharmony_ci MWIFIEX_DBG_DUMP = 0x80000000, 18762306a36Sopenharmony_ci 18862306a36Sopenharmony_ci MWIFIEX_DBG_ANY = 0xffffffff 18962306a36Sopenharmony_ci}; 19062306a36Sopenharmony_ci 19162306a36Sopenharmony_ci#define MWIFIEX_DEFAULT_DEBUG_MASK (MWIFIEX_DBG_MSG | \ 19262306a36Sopenharmony_ci MWIFIEX_DBG_FATAL | \ 19362306a36Sopenharmony_ci MWIFIEX_DBG_ERROR) 19462306a36Sopenharmony_ci 19562306a36Sopenharmony_ci__printf(3, 4) 19662306a36Sopenharmony_civoid _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask, 19762306a36Sopenharmony_ci const char *fmt, ...); 19862306a36Sopenharmony_ci#define mwifiex_dbg(adapter, mask, fmt, ...) \ 19962306a36Sopenharmony_ci _mwifiex_dbg(adapter, MWIFIEX_DBG_##mask, fmt, ##__VA_ARGS__) 20062306a36Sopenharmony_ci 20162306a36Sopenharmony_ci#define DEBUG_DUMP_DATA_MAX_LEN 128 20262306a36Sopenharmony_ci#define mwifiex_dbg_dump(adapter, dbg_mask, str, buf, len) \ 20362306a36Sopenharmony_cido { \ 20462306a36Sopenharmony_ci if ((adapter)->debug_mask & MWIFIEX_DBG_##dbg_mask) \ 20562306a36Sopenharmony_ci print_hex_dump(KERN_DEBUG, str, \ 20662306a36Sopenharmony_ci DUMP_PREFIX_OFFSET, 16, 1, \ 20762306a36Sopenharmony_ci buf, len, false); \ 20862306a36Sopenharmony_ci} while (0) 20962306a36Sopenharmony_ci 21062306a36Sopenharmony_ci/** Min BGSCAN interval 15 second */ 21162306a36Sopenharmony_ci#define MWIFIEX_BGSCAN_INTERVAL 15000 21262306a36Sopenharmony_ci/** default repeat count */ 21362306a36Sopenharmony_ci#define MWIFIEX_BGSCAN_REPEAT_COUNT 6 21462306a36Sopenharmony_ci 21562306a36Sopenharmony_cistruct mwifiex_dbg { 21662306a36Sopenharmony_ci u32 num_cmd_host_to_card_failure; 21762306a36Sopenharmony_ci u32 num_cmd_sleep_cfm_host_to_card_failure; 21862306a36Sopenharmony_ci u32 num_tx_host_to_card_failure; 21962306a36Sopenharmony_ci u32 num_event_deauth; 22062306a36Sopenharmony_ci u32 num_event_disassoc; 22162306a36Sopenharmony_ci u32 num_event_link_lost; 22262306a36Sopenharmony_ci u32 num_cmd_deauth; 22362306a36Sopenharmony_ci u32 num_cmd_assoc_success; 22462306a36Sopenharmony_ci u32 num_cmd_assoc_failure; 22562306a36Sopenharmony_ci u32 num_tx_timeout; 22662306a36Sopenharmony_ci u16 timeout_cmd_id; 22762306a36Sopenharmony_ci u16 timeout_cmd_act; 22862306a36Sopenharmony_ci u16 last_cmd_id[DBG_CMD_NUM]; 22962306a36Sopenharmony_ci u16 last_cmd_act[DBG_CMD_NUM]; 23062306a36Sopenharmony_ci u16 last_cmd_index; 23162306a36Sopenharmony_ci u16 last_cmd_resp_id[DBG_CMD_NUM]; 23262306a36Sopenharmony_ci u16 last_cmd_resp_index; 23362306a36Sopenharmony_ci u16 last_event[DBG_CMD_NUM]; 23462306a36Sopenharmony_ci u16 last_event_index; 23562306a36Sopenharmony_ci u32 last_mp_wr_bitmap[MWIFIEX_DBG_SDIO_MP_NUM]; 23662306a36Sopenharmony_ci u32 last_mp_wr_ports[MWIFIEX_DBG_SDIO_MP_NUM]; 23762306a36Sopenharmony_ci u32 last_mp_wr_len[MWIFIEX_DBG_SDIO_MP_NUM]; 23862306a36Sopenharmony_ci u32 last_mp_curr_wr_port[MWIFIEX_DBG_SDIO_MP_NUM]; 23962306a36Sopenharmony_ci u8 last_sdio_mp_index; 24062306a36Sopenharmony_ci}; 24162306a36Sopenharmony_ci 24262306a36Sopenharmony_cienum MWIFIEX_HARDWARE_STATUS { 24362306a36Sopenharmony_ci MWIFIEX_HW_STATUS_READY, 24462306a36Sopenharmony_ci MWIFIEX_HW_STATUS_INITIALIZING, 24562306a36Sopenharmony_ci MWIFIEX_HW_STATUS_INIT_DONE, 24662306a36Sopenharmony_ci MWIFIEX_HW_STATUS_RESET, 24762306a36Sopenharmony_ci MWIFIEX_HW_STATUS_NOT_READY 24862306a36Sopenharmony_ci}; 24962306a36Sopenharmony_ci 25062306a36Sopenharmony_cienum MWIFIEX_802_11_POWER_MODE { 25162306a36Sopenharmony_ci MWIFIEX_802_11_POWER_MODE_CAM, 25262306a36Sopenharmony_ci MWIFIEX_802_11_POWER_MODE_PSP 25362306a36Sopenharmony_ci}; 25462306a36Sopenharmony_ci 25562306a36Sopenharmony_cistruct mwifiex_tx_param { 25662306a36Sopenharmony_ci u32 next_pkt_len; 25762306a36Sopenharmony_ci}; 25862306a36Sopenharmony_ci 25962306a36Sopenharmony_cienum MWIFIEX_PS_STATE { 26062306a36Sopenharmony_ci PS_STATE_AWAKE, 26162306a36Sopenharmony_ci PS_STATE_PRE_SLEEP, 26262306a36Sopenharmony_ci PS_STATE_SLEEP_CFM, 26362306a36Sopenharmony_ci PS_STATE_SLEEP 26462306a36Sopenharmony_ci}; 26562306a36Sopenharmony_ci 26662306a36Sopenharmony_cienum mwifiex_iface_type { 26762306a36Sopenharmony_ci MWIFIEX_SDIO, 26862306a36Sopenharmony_ci MWIFIEX_PCIE, 26962306a36Sopenharmony_ci MWIFIEX_USB 27062306a36Sopenharmony_ci}; 27162306a36Sopenharmony_ci 27262306a36Sopenharmony_cistruct mwifiex_add_ba_param { 27362306a36Sopenharmony_ci u32 tx_win_size; 27462306a36Sopenharmony_ci u32 rx_win_size; 27562306a36Sopenharmony_ci u32 timeout; 27662306a36Sopenharmony_ci u8 tx_amsdu; 27762306a36Sopenharmony_ci u8 rx_amsdu; 27862306a36Sopenharmony_ci}; 27962306a36Sopenharmony_ci 28062306a36Sopenharmony_cistruct mwifiex_tx_aggr { 28162306a36Sopenharmony_ci u8 ampdu_user; 28262306a36Sopenharmony_ci u8 ampdu_ap; 28362306a36Sopenharmony_ci u8 amsdu; 28462306a36Sopenharmony_ci}; 28562306a36Sopenharmony_ci 28662306a36Sopenharmony_cienum mwifiex_ba_status { 28762306a36Sopenharmony_ci BA_SETUP_NONE = 0, 28862306a36Sopenharmony_ci BA_SETUP_INPROGRESS, 28962306a36Sopenharmony_ci BA_SETUP_COMPLETE 29062306a36Sopenharmony_ci}; 29162306a36Sopenharmony_ci 29262306a36Sopenharmony_cistruct mwifiex_ra_list_tbl { 29362306a36Sopenharmony_ci struct list_head list; 29462306a36Sopenharmony_ci struct sk_buff_head skb_head; 29562306a36Sopenharmony_ci u8 ra[ETH_ALEN]; 29662306a36Sopenharmony_ci u32 is_11n_enabled; 29762306a36Sopenharmony_ci u16 max_amsdu; 29862306a36Sopenharmony_ci u16 ba_pkt_count; 29962306a36Sopenharmony_ci u8 ba_packet_thr; 30062306a36Sopenharmony_ci enum mwifiex_ba_status ba_status; 30162306a36Sopenharmony_ci u8 amsdu_in_ampdu; 30262306a36Sopenharmony_ci u16 total_pkt_count; 30362306a36Sopenharmony_ci bool tdls_link; 30462306a36Sopenharmony_ci bool tx_paused; 30562306a36Sopenharmony_ci}; 30662306a36Sopenharmony_ci 30762306a36Sopenharmony_cistruct mwifiex_tid_tbl { 30862306a36Sopenharmony_ci struct list_head ra_list; 30962306a36Sopenharmony_ci}; 31062306a36Sopenharmony_ci 31162306a36Sopenharmony_ci#define WMM_HIGHEST_PRIORITY 7 31262306a36Sopenharmony_ci#define HIGH_PRIO_TID 7 31362306a36Sopenharmony_ci#define LOW_PRIO_TID 0 31462306a36Sopenharmony_ci#define NO_PKT_PRIO_TID -1 31562306a36Sopenharmony_ci#define MWIFIEX_WMM_DRV_DELAY_MAX 510 31662306a36Sopenharmony_ci 31762306a36Sopenharmony_cistruct mwifiex_wmm_desc { 31862306a36Sopenharmony_ci struct mwifiex_tid_tbl tid_tbl_ptr[MAX_NUM_TID]; 31962306a36Sopenharmony_ci u32 packets_out[MAX_NUM_TID]; 32062306a36Sopenharmony_ci u32 pkts_paused[MAX_NUM_TID]; 32162306a36Sopenharmony_ci /* spin lock to protect ra_list */ 32262306a36Sopenharmony_ci spinlock_t ra_list_spinlock; 32362306a36Sopenharmony_ci struct mwifiex_wmm_ac_status ac_status[IEEE80211_NUM_ACS]; 32462306a36Sopenharmony_ci enum mwifiex_wmm_ac_e ac_down_graded_vals[IEEE80211_NUM_ACS]; 32562306a36Sopenharmony_ci u32 drv_pkt_delay_max; 32662306a36Sopenharmony_ci u8 queue_priority[IEEE80211_NUM_ACS]; 32762306a36Sopenharmony_ci u32 user_pri_pkt_tx_ctrl[WMM_HIGHEST_PRIORITY + 1]; /* UP: 0 to 7 */ 32862306a36Sopenharmony_ci /* Number of transmit packets queued */ 32962306a36Sopenharmony_ci atomic_t tx_pkts_queued; 33062306a36Sopenharmony_ci /* Tracks highest priority with a packet queued */ 33162306a36Sopenharmony_ci atomic_t highest_queued_prio; 33262306a36Sopenharmony_ci}; 33362306a36Sopenharmony_ci 33462306a36Sopenharmony_cistruct mwifiex_802_11_security { 33562306a36Sopenharmony_ci u8 wpa_enabled; 33662306a36Sopenharmony_ci u8 wpa2_enabled; 33762306a36Sopenharmony_ci u8 wapi_enabled; 33862306a36Sopenharmony_ci u8 wapi_key_on; 33962306a36Sopenharmony_ci u8 wep_enabled; 34062306a36Sopenharmony_ci u32 authentication_mode; 34162306a36Sopenharmony_ci u8 is_authtype_auto; 34262306a36Sopenharmony_ci u32 encryption_mode; 34362306a36Sopenharmony_ci}; 34462306a36Sopenharmony_ci 34562306a36Sopenharmony_cistruct ieee_types_header { 34662306a36Sopenharmony_ci u8 element_id; 34762306a36Sopenharmony_ci u8 len; 34862306a36Sopenharmony_ci} __packed; 34962306a36Sopenharmony_ci 35062306a36Sopenharmony_cistruct ieee_types_vendor_specific { 35162306a36Sopenharmony_ci struct ieee_types_vendor_header vend_hdr; 35262306a36Sopenharmony_ci u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)]; 35362306a36Sopenharmony_ci} __packed; 35462306a36Sopenharmony_ci 35562306a36Sopenharmony_cistruct ieee_types_generic { 35662306a36Sopenharmony_ci struct ieee_types_header ieee_hdr; 35762306a36Sopenharmony_ci u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_header)]; 35862306a36Sopenharmony_ci} __packed; 35962306a36Sopenharmony_ci 36062306a36Sopenharmony_cistruct ieee_types_bss_co_2040 { 36162306a36Sopenharmony_ci struct ieee_types_header ieee_hdr; 36262306a36Sopenharmony_ci u8 bss_2040co; 36362306a36Sopenharmony_ci} __packed; 36462306a36Sopenharmony_ci 36562306a36Sopenharmony_cistruct ieee_types_extcap { 36662306a36Sopenharmony_ci struct ieee_types_header ieee_hdr; 36762306a36Sopenharmony_ci u8 ext_capab[8]; 36862306a36Sopenharmony_ci} __packed; 36962306a36Sopenharmony_ci 37062306a36Sopenharmony_cistruct ieee_types_vht_cap { 37162306a36Sopenharmony_ci struct ieee_types_header ieee_hdr; 37262306a36Sopenharmony_ci struct ieee80211_vht_cap vhtcap; 37362306a36Sopenharmony_ci} __packed; 37462306a36Sopenharmony_ci 37562306a36Sopenharmony_cistruct ieee_types_vht_oper { 37662306a36Sopenharmony_ci struct ieee_types_header ieee_hdr; 37762306a36Sopenharmony_ci struct ieee80211_vht_operation vhtoper; 37862306a36Sopenharmony_ci} __packed; 37962306a36Sopenharmony_ci 38062306a36Sopenharmony_cistruct ieee_types_aid { 38162306a36Sopenharmony_ci struct ieee_types_header ieee_hdr; 38262306a36Sopenharmony_ci u16 aid; 38362306a36Sopenharmony_ci} __packed; 38462306a36Sopenharmony_ci 38562306a36Sopenharmony_cistruct mwifiex_bssdescriptor { 38662306a36Sopenharmony_ci u8 mac_address[ETH_ALEN]; 38762306a36Sopenharmony_ci struct cfg80211_ssid ssid; 38862306a36Sopenharmony_ci u32 privacy; 38962306a36Sopenharmony_ci s32 rssi; 39062306a36Sopenharmony_ci u32 channel; 39162306a36Sopenharmony_ci u32 freq; 39262306a36Sopenharmony_ci u16 beacon_period; 39362306a36Sopenharmony_ci u8 erp_flags; 39462306a36Sopenharmony_ci u32 bss_mode; 39562306a36Sopenharmony_ci u8 supported_rates[MWIFIEX_SUPPORTED_RATES]; 39662306a36Sopenharmony_ci u8 data_rates[MWIFIEX_SUPPORTED_RATES]; 39762306a36Sopenharmony_ci /* Network band. 39862306a36Sopenharmony_ci * BAND_B(0x01): 'b' band 39962306a36Sopenharmony_ci * BAND_G(0x02): 'g' band 40062306a36Sopenharmony_ci * BAND_A(0X04): 'a' band 40162306a36Sopenharmony_ci */ 40262306a36Sopenharmony_ci u16 bss_band; 40362306a36Sopenharmony_ci u64 fw_tsf; 40462306a36Sopenharmony_ci u64 timestamp; 40562306a36Sopenharmony_ci union ieee_types_phy_param_set phy_param_set; 40662306a36Sopenharmony_ci union ieee_types_ss_param_set ss_param_set; 40762306a36Sopenharmony_ci u16 cap_info_bitmap; 40862306a36Sopenharmony_ci struct ieee_types_wmm_parameter wmm_ie; 40962306a36Sopenharmony_ci u8 disable_11n; 41062306a36Sopenharmony_ci struct ieee80211_ht_cap *bcn_ht_cap; 41162306a36Sopenharmony_ci u16 ht_cap_offset; 41262306a36Sopenharmony_ci struct ieee80211_ht_operation *bcn_ht_oper; 41362306a36Sopenharmony_ci u16 ht_info_offset; 41462306a36Sopenharmony_ci u8 *bcn_bss_co_2040; 41562306a36Sopenharmony_ci u16 bss_co_2040_offset; 41662306a36Sopenharmony_ci u8 *bcn_ext_cap; 41762306a36Sopenharmony_ci u16 ext_cap_offset; 41862306a36Sopenharmony_ci struct ieee80211_vht_cap *bcn_vht_cap; 41962306a36Sopenharmony_ci u16 vht_cap_offset; 42062306a36Sopenharmony_ci struct ieee80211_vht_operation *bcn_vht_oper; 42162306a36Sopenharmony_ci u16 vht_info_offset; 42262306a36Sopenharmony_ci struct ieee_types_oper_mode_ntf *oper_mode; 42362306a36Sopenharmony_ci u16 oper_mode_offset; 42462306a36Sopenharmony_ci u8 disable_11ac; 42562306a36Sopenharmony_ci struct ieee_types_vendor_specific *bcn_wpa_ie; 42662306a36Sopenharmony_ci u16 wpa_offset; 42762306a36Sopenharmony_ci struct ieee_types_generic *bcn_rsn_ie; 42862306a36Sopenharmony_ci u16 rsn_offset; 42962306a36Sopenharmony_ci struct ieee_types_generic *bcn_wapi_ie; 43062306a36Sopenharmony_ci u16 wapi_offset; 43162306a36Sopenharmony_ci u8 *beacon_buf; 43262306a36Sopenharmony_ci u32 beacon_buf_size; 43362306a36Sopenharmony_ci u8 sensed_11h; 43462306a36Sopenharmony_ci u8 local_constraint; 43562306a36Sopenharmony_ci u8 chan_sw_ie_present; 43662306a36Sopenharmony_ci}; 43762306a36Sopenharmony_ci 43862306a36Sopenharmony_cistruct mwifiex_current_bss_params { 43962306a36Sopenharmony_ci struct mwifiex_bssdescriptor bss_descriptor; 44062306a36Sopenharmony_ci u8 wmm_enabled; 44162306a36Sopenharmony_ci u8 wmm_uapsd_enabled; 44262306a36Sopenharmony_ci u8 band; 44362306a36Sopenharmony_ci u32 num_of_rates; 44462306a36Sopenharmony_ci u8 data_rates[MWIFIEX_SUPPORTED_RATES]; 44562306a36Sopenharmony_ci}; 44662306a36Sopenharmony_ci 44762306a36Sopenharmony_cistruct mwifiex_sleep_period { 44862306a36Sopenharmony_ci u16 period; 44962306a36Sopenharmony_ci u16 reserved; 45062306a36Sopenharmony_ci}; 45162306a36Sopenharmony_ci 45262306a36Sopenharmony_cistruct mwifiex_wep_key { 45362306a36Sopenharmony_ci u32 length; 45462306a36Sopenharmony_ci u32 key_index; 45562306a36Sopenharmony_ci u32 key_length; 45662306a36Sopenharmony_ci u8 key_material[MWIFIEX_KEY_BUFFER_SIZE]; 45762306a36Sopenharmony_ci}; 45862306a36Sopenharmony_ci 45962306a36Sopenharmony_ci#define MAX_REGION_CHANNEL_NUM 2 46062306a36Sopenharmony_ci 46162306a36Sopenharmony_cistruct mwifiex_chan_freq_power { 46262306a36Sopenharmony_ci u16 channel; 46362306a36Sopenharmony_ci u32 freq; 46462306a36Sopenharmony_ci u16 max_tx_power; 46562306a36Sopenharmony_ci u8 unsupported; 46662306a36Sopenharmony_ci}; 46762306a36Sopenharmony_ci 46862306a36Sopenharmony_cienum state_11d_t { 46962306a36Sopenharmony_ci DISABLE_11D = 0, 47062306a36Sopenharmony_ci ENABLE_11D = 1, 47162306a36Sopenharmony_ci}; 47262306a36Sopenharmony_ci 47362306a36Sopenharmony_ci#define MWIFIEX_MAX_TRIPLET_802_11D 83 47462306a36Sopenharmony_ci 47562306a36Sopenharmony_cistruct mwifiex_802_11d_domain_reg { 47662306a36Sopenharmony_ci u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; 47762306a36Sopenharmony_ci u8 no_of_triplet; 47862306a36Sopenharmony_ci struct ieee80211_country_ie_triplet 47962306a36Sopenharmony_ci triplet[MWIFIEX_MAX_TRIPLET_802_11D]; 48062306a36Sopenharmony_ci}; 48162306a36Sopenharmony_ci 48262306a36Sopenharmony_cistruct mwifiex_vendor_spec_cfg_ie { 48362306a36Sopenharmony_ci u16 mask; 48462306a36Sopenharmony_ci u16 flag; 48562306a36Sopenharmony_ci u8 ie[MWIFIEX_MAX_VSIE_LEN]; 48662306a36Sopenharmony_ci}; 48762306a36Sopenharmony_ci 48862306a36Sopenharmony_cistruct wps { 48962306a36Sopenharmony_ci u8 session_enable; 49062306a36Sopenharmony_ci}; 49162306a36Sopenharmony_ci 49262306a36Sopenharmony_cistruct mwifiex_roc_cfg { 49362306a36Sopenharmony_ci u64 cookie; 49462306a36Sopenharmony_ci struct ieee80211_channel chan; 49562306a36Sopenharmony_ci}; 49662306a36Sopenharmony_ci 49762306a36Sopenharmony_cienum mwifiex_iface_work_flags { 49862306a36Sopenharmony_ci MWIFIEX_IFACE_WORK_DEVICE_DUMP, 49962306a36Sopenharmony_ci MWIFIEX_IFACE_WORK_CARD_RESET, 50062306a36Sopenharmony_ci}; 50162306a36Sopenharmony_ci 50262306a36Sopenharmony_cienum mwifiex_adapter_work_flags { 50362306a36Sopenharmony_ci MWIFIEX_SURPRISE_REMOVED, 50462306a36Sopenharmony_ci MWIFIEX_IS_CMD_TIMEDOUT, 50562306a36Sopenharmony_ci MWIFIEX_IS_SUSPENDED, 50662306a36Sopenharmony_ci MWIFIEX_IS_HS_CONFIGURED, 50762306a36Sopenharmony_ci MWIFIEX_IS_HS_ENABLING, 50862306a36Sopenharmony_ci MWIFIEX_IS_REQUESTING_FW_VEREXT, 50962306a36Sopenharmony_ci}; 51062306a36Sopenharmony_ci 51162306a36Sopenharmony_cistruct mwifiex_band_config { 51262306a36Sopenharmony_ci u8 chan_band:2; 51362306a36Sopenharmony_ci u8 chan_width:2; 51462306a36Sopenharmony_ci u8 chan2_offset:2; 51562306a36Sopenharmony_ci u8 scan_mode:2; 51662306a36Sopenharmony_ci} __packed; 51762306a36Sopenharmony_ci 51862306a36Sopenharmony_cistruct mwifiex_channel_band { 51962306a36Sopenharmony_ci struct mwifiex_band_config band_config; 52062306a36Sopenharmony_ci u8 channel; 52162306a36Sopenharmony_ci}; 52262306a36Sopenharmony_ci 52362306a36Sopenharmony_cistruct mwifiex_private { 52462306a36Sopenharmony_ci struct mwifiex_adapter *adapter; 52562306a36Sopenharmony_ci u8 bss_type; 52662306a36Sopenharmony_ci u8 bss_role; 52762306a36Sopenharmony_ci u8 bss_priority; 52862306a36Sopenharmony_ci u8 bss_num; 52962306a36Sopenharmony_ci u8 bss_started; 53062306a36Sopenharmony_ci u8 frame_type; 53162306a36Sopenharmony_ci u8 curr_addr[ETH_ALEN]; 53262306a36Sopenharmony_ci u8 media_connected; 53362306a36Sopenharmony_ci u8 port_open; 53462306a36Sopenharmony_ci u8 usb_port; 53562306a36Sopenharmony_ci u32 num_tx_timeout; 53662306a36Sopenharmony_ci /* track consecutive timeout */ 53762306a36Sopenharmony_ci u8 tx_timeout_cnt; 53862306a36Sopenharmony_ci struct net_device *netdev; 53962306a36Sopenharmony_ci struct net_device_stats stats; 54062306a36Sopenharmony_ci u32 curr_pkt_filter; 54162306a36Sopenharmony_ci u32 bss_mode; 54262306a36Sopenharmony_ci u32 pkt_tx_ctrl; 54362306a36Sopenharmony_ci u16 tx_power_level; 54462306a36Sopenharmony_ci u8 max_tx_power_level; 54562306a36Sopenharmony_ci u8 min_tx_power_level; 54662306a36Sopenharmony_ci u32 tx_ant; 54762306a36Sopenharmony_ci u32 rx_ant; 54862306a36Sopenharmony_ci u8 tx_rate; 54962306a36Sopenharmony_ci u8 tx_htinfo; 55062306a36Sopenharmony_ci u8 rxpd_htinfo; 55162306a36Sopenharmony_ci u8 rxpd_rate; 55262306a36Sopenharmony_ci u16 rate_bitmap; 55362306a36Sopenharmony_ci u16 bitmap_rates[MAX_BITMAP_RATES_SIZE]; 55462306a36Sopenharmony_ci u32 data_rate; 55562306a36Sopenharmony_ci u8 is_data_rate_auto; 55662306a36Sopenharmony_ci u16 bcn_avg_factor; 55762306a36Sopenharmony_ci u16 data_avg_factor; 55862306a36Sopenharmony_ci s16 data_rssi_last; 55962306a36Sopenharmony_ci s16 data_nf_last; 56062306a36Sopenharmony_ci s16 data_rssi_avg; 56162306a36Sopenharmony_ci s16 data_nf_avg; 56262306a36Sopenharmony_ci s16 bcn_rssi_last; 56362306a36Sopenharmony_ci s16 bcn_nf_last; 56462306a36Sopenharmony_ci s16 bcn_rssi_avg; 56562306a36Sopenharmony_ci s16 bcn_nf_avg; 56662306a36Sopenharmony_ci struct mwifiex_bssdescriptor *attempted_bss_desc; 56762306a36Sopenharmony_ci struct cfg80211_ssid prev_ssid; 56862306a36Sopenharmony_ci u8 prev_bssid[ETH_ALEN]; 56962306a36Sopenharmony_ci struct mwifiex_current_bss_params curr_bss_params; 57062306a36Sopenharmony_ci u16 beacon_period; 57162306a36Sopenharmony_ci u8 dtim_period; 57262306a36Sopenharmony_ci u16 listen_interval; 57362306a36Sopenharmony_ci u16 atim_window; 57462306a36Sopenharmony_ci u8 adhoc_channel; 57562306a36Sopenharmony_ci u8 adhoc_is_link_sensed; 57662306a36Sopenharmony_ci u8 adhoc_state; 57762306a36Sopenharmony_ci struct mwifiex_802_11_security sec_info; 57862306a36Sopenharmony_ci struct mwifiex_wep_key wep_key[NUM_WEP_KEYS]; 57962306a36Sopenharmony_ci u16 wep_key_curr_index; 58062306a36Sopenharmony_ci u8 wpa_ie[256]; 58162306a36Sopenharmony_ci u16 wpa_ie_len; 58262306a36Sopenharmony_ci u8 wpa_is_gtk_set; 58362306a36Sopenharmony_ci struct host_cmd_ds_802_11_key_material aes_key; 58462306a36Sopenharmony_ci struct host_cmd_ds_802_11_key_material_v2 aes_key_v2; 58562306a36Sopenharmony_ci u8 wapi_ie[256]; 58662306a36Sopenharmony_ci u16 wapi_ie_len; 58762306a36Sopenharmony_ci u8 *wps_ie; 58862306a36Sopenharmony_ci u16 wps_ie_len; 58962306a36Sopenharmony_ci u8 wmm_required; 59062306a36Sopenharmony_ci u8 wmm_enabled; 59162306a36Sopenharmony_ci u8 wmm_qosinfo; 59262306a36Sopenharmony_ci struct mwifiex_wmm_desc wmm; 59362306a36Sopenharmony_ci atomic_t wmm_tx_pending[IEEE80211_NUM_ACS]; 59462306a36Sopenharmony_ci struct list_head sta_list; 59562306a36Sopenharmony_ci /* spin lock for associated station/TDLS peers list */ 59662306a36Sopenharmony_ci spinlock_t sta_list_spinlock; 59762306a36Sopenharmony_ci struct list_head auto_tdls_list; 59862306a36Sopenharmony_ci /* spin lock for auto TDLS peer list */ 59962306a36Sopenharmony_ci spinlock_t auto_tdls_lock; 60062306a36Sopenharmony_ci struct list_head tx_ba_stream_tbl_ptr; 60162306a36Sopenharmony_ci /* spin lock for tx_ba_stream_tbl_ptr queue */ 60262306a36Sopenharmony_ci spinlock_t tx_ba_stream_tbl_lock; 60362306a36Sopenharmony_ci struct mwifiex_tx_aggr aggr_prio_tbl[MAX_NUM_TID]; 60462306a36Sopenharmony_ci struct mwifiex_add_ba_param add_ba_param; 60562306a36Sopenharmony_ci u16 rx_seq[MAX_NUM_TID]; 60662306a36Sopenharmony_ci u8 tos_to_tid_inv[MAX_NUM_TID]; 60762306a36Sopenharmony_ci struct list_head rx_reorder_tbl_ptr; 60862306a36Sopenharmony_ci /* spin lock for rx_reorder_tbl_ptr queue */ 60962306a36Sopenharmony_ci spinlock_t rx_reorder_tbl_lock; 61062306a36Sopenharmony_ci#define MWIFIEX_ASSOC_RSP_BUF_SIZE 500 61162306a36Sopenharmony_ci u8 assoc_rsp_buf[MWIFIEX_ASSOC_RSP_BUF_SIZE]; 61262306a36Sopenharmony_ci u32 assoc_rsp_size; 61362306a36Sopenharmony_ci 61462306a36Sopenharmony_ci#define MWIFIEX_GENIE_BUF_SIZE 256 61562306a36Sopenharmony_ci u8 gen_ie_buf[MWIFIEX_GENIE_BUF_SIZE]; 61662306a36Sopenharmony_ci u8 gen_ie_buf_len; 61762306a36Sopenharmony_ci 61862306a36Sopenharmony_ci struct mwifiex_vendor_spec_cfg_ie vs_ie[MWIFIEX_MAX_VSIE_NUM]; 61962306a36Sopenharmony_ci 62062306a36Sopenharmony_ci#define MWIFIEX_ASSOC_TLV_BUF_SIZE 256 62162306a36Sopenharmony_ci u8 assoc_tlv_buf[MWIFIEX_ASSOC_TLV_BUF_SIZE]; 62262306a36Sopenharmony_ci u8 assoc_tlv_buf_len; 62362306a36Sopenharmony_ci 62462306a36Sopenharmony_ci u8 *curr_bcn_buf; 62562306a36Sopenharmony_ci u32 curr_bcn_size; 62662306a36Sopenharmony_ci /* spin lock for beacon buffer */ 62762306a36Sopenharmony_ci spinlock_t curr_bcn_buf_lock; 62862306a36Sopenharmony_ci struct wireless_dev wdev; 62962306a36Sopenharmony_ci struct mwifiex_chan_freq_power cfp; 63062306a36Sopenharmony_ci u32 versionstrsel; 63162306a36Sopenharmony_ci char version_str[MWIFIEX_VERSION_STR_LENGTH]; 63262306a36Sopenharmony_ci#ifdef CONFIG_DEBUG_FS 63362306a36Sopenharmony_ci struct dentry *dfs_dev_dir; 63462306a36Sopenharmony_ci#endif 63562306a36Sopenharmony_ci u16 current_key_index; 63662306a36Sopenharmony_ci struct mutex async_mutex; 63762306a36Sopenharmony_ci struct cfg80211_scan_request *scan_request; 63862306a36Sopenharmony_ci u8 cfg_bssid[6]; 63962306a36Sopenharmony_ci struct wps wps; 64062306a36Sopenharmony_ci u8 scan_block; 64162306a36Sopenharmony_ci s32 cqm_rssi_thold; 64262306a36Sopenharmony_ci u32 cqm_rssi_hyst; 64362306a36Sopenharmony_ci u8 subsc_evt_rssi_state; 64462306a36Sopenharmony_ci struct mwifiex_ds_misc_subsc_evt async_subsc_evt_storage; 64562306a36Sopenharmony_ci struct mwifiex_ie mgmt_ie[MAX_MGMT_IE_INDEX]; 64662306a36Sopenharmony_ci u16 beacon_idx; 64762306a36Sopenharmony_ci u16 proberesp_idx; 64862306a36Sopenharmony_ci u16 assocresp_idx; 64962306a36Sopenharmony_ci u16 gen_idx; 65062306a36Sopenharmony_ci u8 ap_11n_enabled; 65162306a36Sopenharmony_ci u8 ap_11ac_enabled; 65262306a36Sopenharmony_ci u32 mgmt_frame_mask; 65362306a36Sopenharmony_ci struct mwifiex_roc_cfg roc_cfg; 65462306a36Sopenharmony_ci bool scan_aborting; 65562306a36Sopenharmony_ci u8 sched_scanning; 65662306a36Sopenharmony_ci u8 csa_chan; 65762306a36Sopenharmony_ci unsigned long csa_expire_time; 65862306a36Sopenharmony_ci u8 del_list_idx; 65962306a36Sopenharmony_ci bool hs2_enabled; 66062306a36Sopenharmony_ci struct mwifiex_uap_bss_param bss_cfg; 66162306a36Sopenharmony_ci struct cfg80211_chan_def bss_chandef; 66262306a36Sopenharmony_ci struct station_parameters *sta_params; 66362306a36Sopenharmony_ci struct sk_buff_head tdls_txq; 66462306a36Sopenharmony_ci u8 check_tdls_tx; 66562306a36Sopenharmony_ci struct timer_list auto_tdls_timer; 66662306a36Sopenharmony_ci bool auto_tdls_timer_active; 66762306a36Sopenharmony_ci struct idr ack_status_frames; 66862306a36Sopenharmony_ci /* spin lock for ack status */ 66962306a36Sopenharmony_ci spinlock_t ack_status_lock; 67062306a36Sopenharmony_ci /** rx histogram data */ 67162306a36Sopenharmony_ci struct mwifiex_histogram_data *hist_data; 67262306a36Sopenharmony_ci struct cfg80211_chan_def dfs_chandef; 67362306a36Sopenharmony_ci struct workqueue_struct *dfs_cac_workqueue; 67462306a36Sopenharmony_ci struct delayed_work dfs_cac_work; 67562306a36Sopenharmony_ci struct workqueue_struct *dfs_chan_sw_workqueue; 67662306a36Sopenharmony_ci struct delayed_work dfs_chan_sw_work; 67762306a36Sopenharmony_ci struct cfg80211_beacon_data beacon_after; 67862306a36Sopenharmony_ci struct mwifiex_11h_intf_state state_11h; 67962306a36Sopenharmony_ci struct mwifiex_ds_mem_rw mem_rw; 68062306a36Sopenharmony_ci struct sk_buff_head bypass_txq; 68162306a36Sopenharmony_ci struct mwifiex_user_scan_chan hidden_chan[MWIFIEX_USER_SCAN_CHAN_MAX]; 68262306a36Sopenharmony_ci u8 assoc_resp_ht_param; 68362306a36Sopenharmony_ci bool ht_param_present; 68462306a36Sopenharmony_ci}; 68562306a36Sopenharmony_ci 68662306a36Sopenharmony_ci 68762306a36Sopenharmony_cistruct mwifiex_tx_ba_stream_tbl { 68862306a36Sopenharmony_ci struct list_head list; 68962306a36Sopenharmony_ci int tid; 69062306a36Sopenharmony_ci u8 ra[ETH_ALEN]; 69162306a36Sopenharmony_ci enum mwifiex_ba_status ba_status; 69262306a36Sopenharmony_ci u8 amsdu; 69362306a36Sopenharmony_ci}; 69462306a36Sopenharmony_ci 69562306a36Sopenharmony_cistruct mwifiex_rx_reorder_tbl; 69662306a36Sopenharmony_ci 69762306a36Sopenharmony_cistruct reorder_tmr_cnxt { 69862306a36Sopenharmony_ci struct timer_list timer; 69962306a36Sopenharmony_ci struct mwifiex_rx_reorder_tbl *ptr; 70062306a36Sopenharmony_ci struct mwifiex_private *priv; 70162306a36Sopenharmony_ci u8 timer_is_set; 70262306a36Sopenharmony_ci}; 70362306a36Sopenharmony_ci 70462306a36Sopenharmony_cistruct mwifiex_rx_reorder_tbl { 70562306a36Sopenharmony_ci struct list_head list; 70662306a36Sopenharmony_ci int tid; 70762306a36Sopenharmony_ci u8 ta[ETH_ALEN]; 70862306a36Sopenharmony_ci int init_win; 70962306a36Sopenharmony_ci int start_win; 71062306a36Sopenharmony_ci int win_size; 71162306a36Sopenharmony_ci void **rx_reorder_ptr; 71262306a36Sopenharmony_ci struct reorder_tmr_cnxt timer_context; 71362306a36Sopenharmony_ci u8 amsdu; 71462306a36Sopenharmony_ci u8 flags; 71562306a36Sopenharmony_ci}; 71662306a36Sopenharmony_ci 71762306a36Sopenharmony_cistruct mwifiex_bss_prio_node { 71862306a36Sopenharmony_ci struct list_head list; 71962306a36Sopenharmony_ci struct mwifiex_private *priv; 72062306a36Sopenharmony_ci}; 72162306a36Sopenharmony_ci 72262306a36Sopenharmony_cistruct mwifiex_bss_prio_tbl { 72362306a36Sopenharmony_ci struct list_head bss_prio_head; 72462306a36Sopenharmony_ci /* spin lock for bss priority */ 72562306a36Sopenharmony_ci spinlock_t bss_prio_lock; 72662306a36Sopenharmony_ci struct mwifiex_bss_prio_node *bss_prio_cur; 72762306a36Sopenharmony_ci}; 72862306a36Sopenharmony_ci 72962306a36Sopenharmony_cistruct cmd_ctrl_node { 73062306a36Sopenharmony_ci struct list_head list; 73162306a36Sopenharmony_ci struct mwifiex_private *priv; 73262306a36Sopenharmony_ci u32 cmd_no; 73362306a36Sopenharmony_ci u32 cmd_flag; 73462306a36Sopenharmony_ci struct sk_buff *cmd_skb; 73562306a36Sopenharmony_ci struct sk_buff *resp_skb; 73662306a36Sopenharmony_ci void *data_buf; 73762306a36Sopenharmony_ci u32 wait_q_enabled; 73862306a36Sopenharmony_ci struct sk_buff *skb; 73962306a36Sopenharmony_ci u8 *condition; 74062306a36Sopenharmony_ci u8 cmd_wait_q_woken; 74162306a36Sopenharmony_ci}; 74262306a36Sopenharmony_ci 74362306a36Sopenharmony_cistruct mwifiex_bss_priv { 74462306a36Sopenharmony_ci u8 band; 74562306a36Sopenharmony_ci u64 fw_tsf; 74662306a36Sopenharmony_ci}; 74762306a36Sopenharmony_ci 74862306a36Sopenharmony_cistruct mwifiex_tdls_capab { 74962306a36Sopenharmony_ci __le16 capab; 75062306a36Sopenharmony_ci u8 rates[32]; 75162306a36Sopenharmony_ci u8 rates_len; 75262306a36Sopenharmony_ci u8 qos_info; 75362306a36Sopenharmony_ci u8 coex_2040; 75462306a36Sopenharmony_ci u16 aid; 75562306a36Sopenharmony_ci struct ieee80211_ht_cap ht_capb; 75662306a36Sopenharmony_ci struct ieee80211_ht_operation ht_oper; 75762306a36Sopenharmony_ci struct ieee_types_extcap extcap; 75862306a36Sopenharmony_ci struct ieee_types_generic rsn_ie; 75962306a36Sopenharmony_ci struct ieee80211_vht_cap vhtcap; 76062306a36Sopenharmony_ci struct ieee80211_vht_operation vhtoper; 76162306a36Sopenharmony_ci}; 76262306a36Sopenharmony_ci 76362306a36Sopenharmony_cistruct mwifiex_station_stats { 76462306a36Sopenharmony_ci u64 last_rx; 76562306a36Sopenharmony_ci s8 rssi; 76662306a36Sopenharmony_ci u64 rx_bytes; 76762306a36Sopenharmony_ci u64 tx_bytes; 76862306a36Sopenharmony_ci u32 rx_packets; 76962306a36Sopenharmony_ci u32 tx_packets; 77062306a36Sopenharmony_ci u32 tx_failed; 77162306a36Sopenharmony_ci u8 last_tx_rate; 77262306a36Sopenharmony_ci u8 last_tx_htinfo; 77362306a36Sopenharmony_ci}; 77462306a36Sopenharmony_ci 77562306a36Sopenharmony_ci/* This is AP/TDLS specific structure which stores information 77662306a36Sopenharmony_ci * about associated/peer STA 77762306a36Sopenharmony_ci */ 77862306a36Sopenharmony_cistruct mwifiex_sta_node { 77962306a36Sopenharmony_ci struct list_head list; 78062306a36Sopenharmony_ci u8 mac_addr[ETH_ALEN]; 78162306a36Sopenharmony_ci u8 is_wmm_enabled; 78262306a36Sopenharmony_ci u8 is_11n_enabled; 78362306a36Sopenharmony_ci u8 is_11ac_enabled; 78462306a36Sopenharmony_ci u8 ampdu_sta[MAX_NUM_TID]; 78562306a36Sopenharmony_ci u16 rx_seq[MAX_NUM_TID]; 78662306a36Sopenharmony_ci u16 max_amsdu; 78762306a36Sopenharmony_ci u8 tdls_status; 78862306a36Sopenharmony_ci struct mwifiex_tdls_capab tdls_cap; 78962306a36Sopenharmony_ci struct mwifiex_station_stats stats; 79062306a36Sopenharmony_ci u8 tx_pause; 79162306a36Sopenharmony_ci}; 79262306a36Sopenharmony_ci 79362306a36Sopenharmony_cistruct mwifiex_auto_tdls_peer { 79462306a36Sopenharmony_ci struct list_head list; 79562306a36Sopenharmony_ci u8 mac_addr[ETH_ALEN]; 79662306a36Sopenharmony_ci u8 tdls_status; 79762306a36Sopenharmony_ci int rssi; 79862306a36Sopenharmony_ci long rssi_jiffies; 79962306a36Sopenharmony_ci u8 failure_count; 80062306a36Sopenharmony_ci u8 do_discover; 80162306a36Sopenharmony_ci u8 do_setup; 80262306a36Sopenharmony_ci}; 80362306a36Sopenharmony_ci 80462306a36Sopenharmony_ci#define MWIFIEX_TYPE_AGGR_DATA_V2 11 80562306a36Sopenharmony_ci#define MWIFIEX_BUS_AGGR_MODE_LEN_V2 (2) 80662306a36Sopenharmony_ci#define MWIFIEX_BUS_AGGR_MAX_LEN 16000 80762306a36Sopenharmony_ci#define MWIFIEX_BUS_AGGR_MAX_NUM 10 80862306a36Sopenharmony_cistruct bus_aggr_params { 80962306a36Sopenharmony_ci u16 enable; 81062306a36Sopenharmony_ci u16 mode; 81162306a36Sopenharmony_ci u16 tx_aggr_max_size; 81262306a36Sopenharmony_ci u16 tx_aggr_max_num; 81362306a36Sopenharmony_ci u16 tx_aggr_align; 81462306a36Sopenharmony_ci}; 81562306a36Sopenharmony_ci 81662306a36Sopenharmony_cistruct mwifiex_if_ops { 81762306a36Sopenharmony_ci int (*init_if) (struct mwifiex_adapter *); 81862306a36Sopenharmony_ci void (*cleanup_if) (struct mwifiex_adapter *); 81962306a36Sopenharmony_ci int (*check_fw_status) (struct mwifiex_adapter *, u32); 82062306a36Sopenharmony_ci int (*check_winner_status)(struct mwifiex_adapter *); 82162306a36Sopenharmony_ci int (*prog_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *); 82262306a36Sopenharmony_ci int (*register_dev) (struct mwifiex_adapter *); 82362306a36Sopenharmony_ci void (*unregister_dev) (struct mwifiex_adapter *); 82462306a36Sopenharmony_ci int (*enable_int) (struct mwifiex_adapter *); 82562306a36Sopenharmony_ci void (*disable_int) (struct mwifiex_adapter *); 82662306a36Sopenharmony_ci int (*process_int_status) (struct mwifiex_adapter *); 82762306a36Sopenharmony_ci int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *, 82862306a36Sopenharmony_ci struct mwifiex_tx_param *); 82962306a36Sopenharmony_ci int (*wakeup) (struct mwifiex_adapter *); 83062306a36Sopenharmony_ci int (*wakeup_complete) (struct mwifiex_adapter *); 83162306a36Sopenharmony_ci 83262306a36Sopenharmony_ci /* Interface specific functions */ 83362306a36Sopenharmony_ci void (*update_mp_end_port) (struct mwifiex_adapter *, u16); 83462306a36Sopenharmony_ci void (*cleanup_mpa_buf) (struct mwifiex_adapter *); 83562306a36Sopenharmony_ci int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *); 83662306a36Sopenharmony_ci int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *); 83762306a36Sopenharmony_ci int (*init_fw_port) (struct mwifiex_adapter *); 83862306a36Sopenharmony_ci int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *); 83962306a36Sopenharmony_ci void (*card_reset) (struct mwifiex_adapter *); 84062306a36Sopenharmony_ci int (*reg_dump)(struct mwifiex_adapter *, char *); 84162306a36Sopenharmony_ci void (*device_dump)(struct mwifiex_adapter *); 84262306a36Sopenharmony_ci int (*clean_pcie_ring) (struct mwifiex_adapter *adapter); 84362306a36Sopenharmony_ci void (*iface_work)(struct work_struct *work); 84462306a36Sopenharmony_ci void (*submit_rem_rx_urbs)(struct mwifiex_adapter *adapter); 84562306a36Sopenharmony_ci void (*deaggr_pkt)(struct mwifiex_adapter *, struct sk_buff *); 84662306a36Sopenharmony_ci void (*multi_port_resync)(struct mwifiex_adapter *); 84762306a36Sopenharmony_ci bool (*is_port_ready)(struct mwifiex_private *); 84862306a36Sopenharmony_ci void (*down_dev)(struct mwifiex_adapter *); 84962306a36Sopenharmony_ci void (*up_dev)(struct mwifiex_adapter *); 85062306a36Sopenharmony_ci}; 85162306a36Sopenharmony_ci 85262306a36Sopenharmony_cistruct mwifiex_adapter { 85362306a36Sopenharmony_ci u8 iface_type; 85462306a36Sopenharmony_ci unsigned int debug_mask; 85562306a36Sopenharmony_ci struct mwifiex_iface_comb iface_limit; 85662306a36Sopenharmony_ci struct mwifiex_iface_comb curr_iface_comb; 85762306a36Sopenharmony_ci struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM]; 85862306a36Sopenharmony_ci u8 priv_num; 85962306a36Sopenharmony_ci const struct firmware *firmware; 86062306a36Sopenharmony_ci char fw_name[32]; 86162306a36Sopenharmony_ci int winner; 86262306a36Sopenharmony_ci struct device *dev; 86362306a36Sopenharmony_ci struct wiphy *wiphy; 86462306a36Sopenharmony_ci u8 perm_addr[ETH_ALEN]; 86562306a36Sopenharmony_ci unsigned long work_flags; 86662306a36Sopenharmony_ci u32 fw_release_number; 86762306a36Sopenharmony_ci u8 intf_hdr_len; 86862306a36Sopenharmony_ci u16 init_wait_q_woken; 86962306a36Sopenharmony_ci wait_queue_head_t init_wait_q; 87062306a36Sopenharmony_ci void *card; 87162306a36Sopenharmony_ci struct mwifiex_if_ops if_ops; 87262306a36Sopenharmony_ci atomic_t bypass_tx_pending; 87362306a36Sopenharmony_ci atomic_t rx_pending; 87462306a36Sopenharmony_ci atomic_t tx_pending; 87562306a36Sopenharmony_ci atomic_t cmd_pending; 87662306a36Sopenharmony_ci atomic_t tx_hw_pending; 87762306a36Sopenharmony_ci struct workqueue_struct *workqueue; 87862306a36Sopenharmony_ci struct work_struct main_work; 87962306a36Sopenharmony_ci struct workqueue_struct *rx_workqueue; 88062306a36Sopenharmony_ci struct work_struct rx_work; 88162306a36Sopenharmony_ci bool rx_work_enabled; 88262306a36Sopenharmony_ci bool rx_processing; 88362306a36Sopenharmony_ci bool delay_main_work; 88462306a36Sopenharmony_ci bool rx_locked; 88562306a36Sopenharmony_ci bool main_locked; 88662306a36Sopenharmony_ci struct mwifiex_bss_prio_tbl bss_prio_tbl[MWIFIEX_MAX_BSS_NUM]; 88762306a36Sopenharmony_ci /* spin lock for main process */ 88862306a36Sopenharmony_ci spinlock_t main_proc_lock; 88962306a36Sopenharmony_ci u32 mwifiex_processing; 89062306a36Sopenharmony_ci u8 more_task_flag; 89162306a36Sopenharmony_ci u16 tx_buf_size; 89262306a36Sopenharmony_ci u16 curr_tx_buf_size; 89362306a36Sopenharmony_ci /* sdio single port rx aggregation capability */ 89462306a36Sopenharmony_ci bool host_disable_sdio_rx_aggr; 89562306a36Sopenharmony_ci bool sdio_rx_aggr_enable; 89662306a36Sopenharmony_ci u16 sdio_rx_block_size; 89762306a36Sopenharmony_ci u32 ioport; 89862306a36Sopenharmony_ci enum MWIFIEX_HARDWARE_STATUS hw_status; 89962306a36Sopenharmony_ci u16 number_of_antenna; 90062306a36Sopenharmony_ci u32 fw_cap_info; 90162306a36Sopenharmony_ci /* spin lock for interrupt handling */ 90262306a36Sopenharmony_ci spinlock_t int_lock; 90362306a36Sopenharmony_ci u8 int_status; 90462306a36Sopenharmony_ci u32 event_cause; 90562306a36Sopenharmony_ci struct sk_buff *event_skb; 90662306a36Sopenharmony_ci u8 upld_buf[MWIFIEX_UPLD_SIZE]; 90762306a36Sopenharmony_ci u8 data_sent; 90862306a36Sopenharmony_ci u8 cmd_sent; 90962306a36Sopenharmony_ci u8 cmd_resp_received; 91062306a36Sopenharmony_ci u8 event_received; 91162306a36Sopenharmony_ci u8 data_received; 91262306a36Sopenharmony_ci u16 seq_num; 91362306a36Sopenharmony_ci struct cmd_ctrl_node *cmd_pool; 91462306a36Sopenharmony_ci struct cmd_ctrl_node *curr_cmd; 91562306a36Sopenharmony_ci /* spin lock for command */ 91662306a36Sopenharmony_ci spinlock_t mwifiex_cmd_lock; 91762306a36Sopenharmony_ci u16 last_init_cmd; 91862306a36Sopenharmony_ci struct timer_list cmd_timer; 91962306a36Sopenharmony_ci struct list_head cmd_free_q; 92062306a36Sopenharmony_ci /* spin lock for cmd_free_q */ 92162306a36Sopenharmony_ci spinlock_t cmd_free_q_lock; 92262306a36Sopenharmony_ci struct list_head cmd_pending_q; 92362306a36Sopenharmony_ci /* spin lock for cmd_pending_q */ 92462306a36Sopenharmony_ci spinlock_t cmd_pending_q_lock; 92562306a36Sopenharmony_ci struct list_head scan_pending_q; 92662306a36Sopenharmony_ci /* spin lock for scan_pending_q */ 92762306a36Sopenharmony_ci spinlock_t scan_pending_q_lock; 92862306a36Sopenharmony_ci /* spin lock for RX processing routine */ 92962306a36Sopenharmony_ci spinlock_t rx_proc_lock; 93062306a36Sopenharmony_ci struct sk_buff_head tx_data_q; 93162306a36Sopenharmony_ci atomic_t tx_queued; 93262306a36Sopenharmony_ci u32 scan_processing; 93362306a36Sopenharmony_ci u16 region_code; 93462306a36Sopenharmony_ci struct mwifiex_802_11d_domain_reg domain_reg; 93562306a36Sopenharmony_ci u16 scan_probes; 93662306a36Sopenharmony_ci u32 scan_mode; 93762306a36Sopenharmony_ci u16 specific_scan_time; 93862306a36Sopenharmony_ci u16 active_scan_time; 93962306a36Sopenharmony_ci u16 passive_scan_time; 94062306a36Sopenharmony_ci u16 scan_chan_gap_time; 94162306a36Sopenharmony_ci u8 fw_bands; 94262306a36Sopenharmony_ci u8 adhoc_start_band; 94362306a36Sopenharmony_ci u8 config_bands; 94462306a36Sopenharmony_ci u8 tx_lock_flag; 94562306a36Sopenharmony_ci struct mwifiex_sleep_period sleep_period; 94662306a36Sopenharmony_ci u16 ps_mode; 94762306a36Sopenharmony_ci u32 ps_state; 94862306a36Sopenharmony_ci u8 need_to_wakeup; 94962306a36Sopenharmony_ci u16 multiple_dtim; 95062306a36Sopenharmony_ci u16 local_listen_interval; 95162306a36Sopenharmony_ci u16 null_pkt_interval; 95262306a36Sopenharmony_ci struct sk_buff *sleep_cfm; 95362306a36Sopenharmony_ci u16 bcn_miss_time_out; 95462306a36Sopenharmony_ci u16 adhoc_awake_period; 95562306a36Sopenharmony_ci u8 is_deep_sleep; 95662306a36Sopenharmony_ci u8 delay_null_pkt; 95762306a36Sopenharmony_ci u16 delay_to_ps; 95862306a36Sopenharmony_ci u16 enhanced_ps_mode; 95962306a36Sopenharmony_ci u8 pm_wakeup_card_req; 96062306a36Sopenharmony_ci u16 gen_null_pkt; 96162306a36Sopenharmony_ci u16 pps_uapsd_mode; 96262306a36Sopenharmony_ci u32 pm_wakeup_fw_try; 96362306a36Sopenharmony_ci struct timer_list wakeup_timer; 96462306a36Sopenharmony_ci struct mwifiex_hs_config_param hs_cfg; 96562306a36Sopenharmony_ci u8 hs_activated; 96662306a36Sopenharmony_ci u8 hs_activated_manually; 96762306a36Sopenharmony_ci u16 hs_activate_wait_q_woken; 96862306a36Sopenharmony_ci wait_queue_head_t hs_activate_wait_q; 96962306a36Sopenharmony_ci u8 event_body[MAX_EVENT_SIZE]; 97062306a36Sopenharmony_ci u32 hw_dot_11n_dev_cap; 97162306a36Sopenharmony_ci u8 hw_dev_mcs_support; 97262306a36Sopenharmony_ci u8 user_dev_mcs_support; 97362306a36Sopenharmony_ci u8 adhoc_11n_enabled; 97462306a36Sopenharmony_ci u8 sec_chan_offset; 97562306a36Sopenharmony_ci struct mwifiex_dbg dbg; 97662306a36Sopenharmony_ci u8 arp_filter[ARP_FILTER_MAX_BUF_SIZE]; 97762306a36Sopenharmony_ci u32 arp_filter_size; 97862306a36Sopenharmony_ci struct mwifiex_wait_queue cmd_wait_q; 97962306a36Sopenharmony_ci u8 scan_wait_q_woken; 98062306a36Sopenharmony_ci spinlock_t queue_lock; /* lock for tx queues */ 98162306a36Sopenharmony_ci u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; 98262306a36Sopenharmony_ci u16 max_mgmt_ie_index; 98362306a36Sopenharmony_ci const struct firmware *cal_data; 98462306a36Sopenharmony_ci struct device_node *dt_node; 98562306a36Sopenharmony_ci 98662306a36Sopenharmony_ci /* 11AC */ 98762306a36Sopenharmony_ci u32 is_hw_11ac_capable; 98862306a36Sopenharmony_ci u32 hw_dot_11ac_dev_cap; 98962306a36Sopenharmony_ci u32 hw_dot_11ac_mcs_support; 99062306a36Sopenharmony_ci u32 usr_dot_11ac_dev_cap_bg; 99162306a36Sopenharmony_ci u32 usr_dot_11ac_dev_cap_a; 99262306a36Sopenharmony_ci u32 usr_dot_11ac_mcs_support; 99362306a36Sopenharmony_ci 99462306a36Sopenharmony_ci atomic_t pending_bridged_pkts; 99562306a36Sopenharmony_ci 99662306a36Sopenharmony_ci /* For synchronizing FW initialization with device lifecycle. */ 99762306a36Sopenharmony_ci struct completion *fw_done; 99862306a36Sopenharmony_ci bool is_up; 99962306a36Sopenharmony_ci 100062306a36Sopenharmony_ci bool ext_scan; 100162306a36Sopenharmony_ci u8 fw_api_ver; 100262306a36Sopenharmony_ci u8 key_api_major_ver, key_api_minor_ver; 100362306a36Sopenharmony_ci u8 max_p2p_conn, max_sta_conn; 100462306a36Sopenharmony_ci struct memory_type_mapping *mem_type_mapping_tbl; 100562306a36Sopenharmony_ci u8 num_mem_types; 100662306a36Sopenharmony_ci bool scan_chan_gap_enabled; 100762306a36Sopenharmony_ci struct sk_buff_head rx_data_q; 100862306a36Sopenharmony_ci bool mfg_mode; 100962306a36Sopenharmony_ci struct mwifiex_chan_stats *chan_stats; 101062306a36Sopenharmony_ci u32 num_in_chan_stats; 101162306a36Sopenharmony_ci int survey_idx; 101262306a36Sopenharmony_ci bool auto_tdls; 101362306a36Sopenharmony_ci u8 coex_scan; 101462306a36Sopenharmony_ci u8 coex_min_scan_time; 101562306a36Sopenharmony_ci u8 coex_max_scan_time; 101662306a36Sopenharmony_ci u8 coex_win_size; 101762306a36Sopenharmony_ci u8 coex_tx_win_size; 101862306a36Sopenharmony_ci u8 coex_rx_win_size; 101962306a36Sopenharmony_ci bool drcs_enabled; 102062306a36Sopenharmony_ci u8 active_scan_triggered; 102162306a36Sopenharmony_ci bool usb_mc_status; 102262306a36Sopenharmony_ci bool usb_mc_setup; 102362306a36Sopenharmony_ci struct cfg80211_wowlan_nd_info *nd_info; 102462306a36Sopenharmony_ci struct ieee80211_regdomain *regd; 102562306a36Sopenharmony_ci 102662306a36Sopenharmony_ci /* Wake-on-WLAN (WoWLAN) */ 102762306a36Sopenharmony_ci int irq_wakeup; 102862306a36Sopenharmony_ci bool wake_by_wifi; 102962306a36Sopenharmony_ci /* Aggregation parameters*/ 103062306a36Sopenharmony_ci struct bus_aggr_params bus_aggr; 103162306a36Sopenharmony_ci /* Device dump data/length */ 103262306a36Sopenharmony_ci void *devdump_data; 103362306a36Sopenharmony_ci int devdump_len; 103462306a36Sopenharmony_ci struct delayed_work devdump_work; 103562306a36Sopenharmony_ci 103662306a36Sopenharmony_ci bool ignore_btcoex_events; 103762306a36Sopenharmony_ci}; 103862306a36Sopenharmony_ci 103962306a36Sopenharmony_civoid mwifiex_process_tx_queue(struct mwifiex_adapter *adapter); 104062306a36Sopenharmony_ci 104162306a36Sopenharmony_ciint mwifiex_init_lock_list(struct mwifiex_adapter *adapter); 104262306a36Sopenharmony_ci 104362306a36Sopenharmony_civoid mwifiex_set_trans_start(struct net_device *dev); 104462306a36Sopenharmony_ci 104562306a36Sopenharmony_civoid mwifiex_stop_net_dev_queue(struct net_device *netdev, 104662306a36Sopenharmony_ci struct mwifiex_adapter *adapter); 104762306a36Sopenharmony_ci 104862306a36Sopenharmony_civoid mwifiex_wake_up_net_dev_queue(struct net_device *netdev, 104962306a36Sopenharmony_ci struct mwifiex_adapter *adapter); 105062306a36Sopenharmony_ci 105162306a36Sopenharmony_ciint mwifiex_init_priv(struct mwifiex_private *priv); 105262306a36Sopenharmony_civoid mwifiex_free_priv(struct mwifiex_private *priv); 105362306a36Sopenharmony_ci 105462306a36Sopenharmony_ciint mwifiex_init_fw(struct mwifiex_adapter *adapter); 105562306a36Sopenharmony_ci 105662306a36Sopenharmony_ciint mwifiex_init_fw_complete(struct mwifiex_adapter *adapter); 105762306a36Sopenharmony_ci 105862306a36Sopenharmony_civoid mwifiex_shutdown_drv(struct mwifiex_adapter *adapter); 105962306a36Sopenharmony_ci 106062306a36Sopenharmony_ciint mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *); 106162306a36Sopenharmony_ci 106262306a36Sopenharmony_ciint mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb); 106362306a36Sopenharmony_ciint mwifiex_uap_recv_packet(struct mwifiex_private *priv, 106462306a36Sopenharmony_ci struct sk_buff *skb); 106562306a36Sopenharmony_ci 106662306a36Sopenharmony_ciint mwifiex_process_mgmt_packet(struct mwifiex_private *priv, 106762306a36Sopenharmony_ci struct sk_buff *skb); 106862306a36Sopenharmony_ci 106962306a36Sopenharmony_ciint mwifiex_process_event(struct mwifiex_adapter *adapter); 107062306a36Sopenharmony_ci 107162306a36Sopenharmony_ciint mwifiex_complete_cmd(struct mwifiex_adapter *adapter, 107262306a36Sopenharmony_ci struct cmd_ctrl_node *cmd_node); 107362306a36Sopenharmony_ci 107462306a36Sopenharmony_ciint mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no, 107562306a36Sopenharmony_ci u16 cmd_action, u32 cmd_oid, void *data_buf, bool sync); 107662306a36Sopenharmony_ci 107762306a36Sopenharmony_civoid mwifiex_cmd_timeout_func(struct timer_list *t); 107862306a36Sopenharmony_ci 107962306a36Sopenharmony_ciint mwifiex_get_debug_info(struct mwifiex_private *, 108062306a36Sopenharmony_ci struct mwifiex_debug_info *); 108162306a36Sopenharmony_ci 108262306a36Sopenharmony_ciint mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter); 108362306a36Sopenharmony_civoid mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter); 108462306a36Sopenharmony_civoid mwifiex_free_cmd_buffers(struct mwifiex_adapter *adapter); 108562306a36Sopenharmony_civoid mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter); 108662306a36Sopenharmony_civoid mwifiex_cancel_pending_scan_cmd(struct mwifiex_adapter *adapter); 108762306a36Sopenharmony_civoid mwifiex_cancel_scan(struct mwifiex_adapter *adapter); 108862306a36Sopenharmony_ci 108962306a36Sopenharmony_civoid mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter, 109062306a36Sopenharmony_ci struct cmd_ctrl_node *cmd_node); 109162306a36Sopenharmony_ci 109262306a36Sopenharmony_civoid mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter, 109362306a36Sopenharmony_ci struct cmd_ctrl_node *cmd_node); 109462306a36Sopenharmony_ci 109562306a36Sopenharmony_ciint mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter); 109662306a36Sopenharmony_ciint mwifiex_process_cmdresp(struct mwifiex_adapter *adapter); 109762306a36Sopenharmony_ciint mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter, 109862306a36Sopenharmony_ci struct sk_buff *skb); 109962306a36Sopenharmony_ciint mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, 110062306a36Sopenharmony_ci struct mwifiex_tx_param *tx_param); 110162306a36Sopenharmony_ciint mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags); 110262306a36Sopenharmony_ciint mwifiex_write_data_complete(struct mwifiex_adapter *adapter, 110362306a36Sopenharmony_ci struct sk_buff *skb, int aggr, int status); 110462306a36Sopenharmony_civoid mwifiex_clean_txrx(struct mwifiex_private *priv); 110562306a36Sopenharmony_ciu8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv); 110662306a36Sopenharmony_civoid mwifiex_check_ps_cond(struct mwifiex_adapter *adapter); 110762306a36Sopenharmony_civoid mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *, u8 *, 110862306a36Sopenharmony_ci u32); 110962306a36Sopenharmony_ciint mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv, 111062306a36Sopenharmony_ci struct host_cmd_ds_command *cmd, 111162306a36Sopenharmony_ci u16 cmd_action, uint16_t ps_bitmap, 111262306a36Sopenharmony_ci struct mwifiex_ds_auto_ds *auto_ds); 111362306a36Sopenharmony_ciint mwifiex_ret_enh_power_mode(struct mwifiex_private *priv, 111462306a36Sopenharmony_ci struct host_cmd_ds_command *resp, 111562306a36Sopenharmony_ci struct mwifiex_ds_pm_cfg *pm_cfg); 111662306a36Sopenharmony_civoid mwifiex_process_hs_config(struct mwifiex_adapter *adapter); 111762306a36Sopenharmony_civoid mwifiex_hs_activated_event(struct mwifiex_private *priv, 111862306a36Sopenharmony_ci u8 activated); 111962306a36Sopenharmony_ciint mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, 112062306a36Sopenharmony_ci int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg); 112162306a36Sopenharmony_ciint mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, 112262306a36Sopenharmony_ci struct host_cmd_ds_command *resp); 112362306a36Sopenharmony_ciint mwifiex_process_rx_packet(struct mwifiex_private *priv, 112462306a36Sopenharmony_ci struct sk_buff *skb); 112562306a36Sopenharmony_ciint mwifiex_sta_prepare_cmd(struct mwifiex_private *, uint16_t cmd_no, 112662306a36Sopenharmony_ci u16 cmd_action, u32 cmd_oid, 112762306a36Sopenharmony_ci void *data_buf, void *cmd_buf); 112862306a36Sopenharmony_ciint mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, 112962306a36Sopenharmony_ci u16 cmd_action, u32 cmd_oid, 113062306a36Sopenharmony_ci void *data_buf, void *cmd_buf); 113162306a36Sopenharmony_ciint mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no, 113262306a36Sopenharmony_ci struct host_cmd_ds_command *resp); 113362306a36Sopenharmony_ciint mwifiex_process_sta_rx_packet(struct mwifiex_private *, 113462306a36Sopenharmony_ci struct sk_buff *skb); 113562306a36Sopenharmony_ciint mwifiex_process_uap_rx_packet(struct mwifiex_private *priv, 113662306a36Sopenharmony_ci struct sk_buff *skb); 113762306a36Sopenharmony_ciint mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv, 113862306a36Sopenharmony_ci struct sk_buff *skb); 113962306a36Sopenharmony_ciint mwifiex_process_sta_event(struct mwifiex_private *); 114062306a36Sopenharmony_ciint mwifiex_process_uap_event(struct mwifiex_private *); 114162306a36Sopenharmony_civoid mwifiex_delete_all_station_list(struct mwifiex_private *priv); 114262306a36Sopenharmony_civoid mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv, 114362306a36Sopenharmony_ci const u8 *ra_addr); 114462306a36Sopenharmony_civoid mwifiex_process_sta_txpd(struct mwifiex_private *priv, 114562306a36Sopenharmony_ci struct sk_buff *skb); 114662306a36Sopenharmony_civoid mwifiex_process_uap_txpd(struct mwifiex_private *priv, 114762306a36Sopenharmony_ci struct sk_buff *skb); 114862306a36Sopenharmony_ciint mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta, bool init); 114962306a36Sopenharmony_ciint mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd, 115062306a36Sopenharmony_ci struct mwifiex_scan_cmd_config *scan_cfg); 115162306a36Sopenharmony_civoid mwifiex_queue_scan_cmd(struct mwifiex_private *priv, 115262306a36Sopenharmony_ci struct cmd_ctrl_node *cmd_node); 115362306a36Sopenharmony_ciint mwifiex_ret_802_11_scan(struct mwifiex_private *priv, 115462306a36Sopenharmony_ci struct host_cmd_ds_command *resp); 115562306a36Sopenharmony_cis32 mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2); 115662306a36Sopenharmony_ciint mwifiex_associate(struct mwifiex_private *priv, 115762306a36Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 115862306a36Sopenharmony_ciint mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, 115962306a36Sopenharmony_ci struct host_cmd_ds_command *cmd, 116062306a36Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 116162306a36Sopenharmony_ciint mwifiex_ret_802_11_associate(struct mwifiex_private *priv, 116262306a36Sopenharmony_ci struct host_cmd_ds_command *resp); 116362306a36Sopenharmony_civoid mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason, 116462306a36Sopenharmony_ci bool from_ap); 116562306a36Sopenharmony_ciu8 mwifiex_band_to_radio_type(u8 band); 116662306a36Sopenharmony_ciint mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac); 116762306a36Sopenharmony_civoid mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter); 116862306a36Sopenharmony_ciint mwifiex_adhoc_start(struct mwifiex_private *priv, 116962306a36Sopenharmony_ci struct cfg80211_ssid *adhoc_ssid); 117062306a36Sopenharmony_ciint mwifiex_adhoc_join(struct mwifiex_private *priv, 117162306a36Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 117262306a36Sopenharmony_ciint mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, 117362306a36Sopenharmony_ci struct host_cmd_ds_command *cmd, 117462306a36Sopenharmony_ci struct cfg80211_ssid *req_ssid); 117562306a36Sopenharmony_ciint mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, 117662306a36Sopenharmony_ci struct host_cmd_ds_command *cmd, 117762306a36Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 117862306a36Sopenharmony_ciint mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv, 117962306a36Sopenharmony_ci struct host_cmd_ds_command *resp); 118062306a36Sopenharmony_ciint mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command *cmd); 118162306a36Sopenharmony_cistruct mwifiex_chan_freq_power *mwifiex_get_cfp(struct mwifiex_private *priv, 118262306a36Sopenharmony_ci u8 band, u16 channel, u32 freq); 118362306a36Sopenharmony_ciu32 mwifiex_index_to_data_rate(struct mwifiex_private *priv, 118462306a36Sopenharmony_ci u8 index, u8 ht_info); 118562306a36Sopenharmony_ciu32 mwifiex_index_to_acs_data_rate(struct mwifiex_private *priv, 118662306a36Sopenharmony_ci u8 index, u8 ht_info); 118762306a36Sopenharmony_ciu32 mwifiex_find_freq_from_band_chan(u8, u8); 118862306a36Sopenharmony_ciint mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv, u16 vsie_mask, 118962306a36Sopenharmony_ci u8 **buffer); 119062306a36Sopenharmony_ciu32 mwifiex_get_active_data_rates(struct mwifiex_private *priv, 119162306a36Sopenharmony_ci u8 *rates); 119262306a36Sopenharmony_ciu32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates); 119362306a36Sopenharmony_ciu32 mwifiex_get_rates_from_cfg80211(struct mwifiex_private *priv, 119462306a36Sopenharmony_ci u8 *rates, u8 radio_type); 119562306a36Sopenharmony_ciu8 mwifiex_is_rate_auto(struct mwifiex_private *priv); 119662306a36Sopenharmony_ciextern u16 region_code_index[MWIFIEX_MAX_REGION_CODE]; 119762306a36Sopenharmony_civoid mwifiex_save_curr_bcn(struct mwifiex_private *priv); 119862306a36Sopenharmony_civoid mwifiex_free_curr_bcn(struct mwifiex_private *priv); 119962306a36Sopenharmony_ciint mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv, 120062306a36Sopenharmony_ci struct host_cmd_ds_command *cmd); 120162306a36Sopenharmony_ciint mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, 120262306a36Sopenharmony_ci struct host_cmd_ds_command *resp); 120362306a36Sopenharmony_ciint is_command_pending(struct mwifiex_adapter *adapter); 120462306a36Sopenharmony_civoid mwifiex_init_priv_params(struct mwifiex_private *priv, 120562306a36Sopenharmony_ci struct net_device *dev); 120662306a36Sopenharmony_ciint mwifiex_set_secure_params(struct mwifiex_private *priv, 120762306a36Sopenharmony_ci struct mwifiex_uap_bss_param *bss_config, 120862306a36Sopenharmony_ci struct cfg80211_ap_settings *params); 120962306a36Sopenharmony_civoid mwifiex_set_ht_params(struct mwifiex_private *priv, 121062306a36Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg, 121162306a36Sopenharmony_ci struct cfg80211_ap_settings *params); 121262306a36Sopenharmony_civoid mwifiex_set_vht_params(struct mwifiex_private *priv, 121362306a36Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg, 121462306a36Sopenharmony_ci struct cfg80211_ap_settings *params); 121562306a36Sopenharmony_civoid mwifiex_set_tpc_params(struct mwifiex_private *priv, 121662306a36Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg, 121762306a36Sopenharmony_ci struct cfg80211_ap_settings *params); 121862306a36Sopenharmony_civoid mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg, 121962306a36Sopenharmony_ci struct cfg80211_ap_settings *params); 122062306a36Sopenharmony_civoid mwifiex_set_vht_width(struct mwifiex_private *priv, 122162306a36Sopenharmony_ci enum nl80211_chan_width width, 122262306a36Sopenharmony_ci bool ap_11ac_disable); 122362306a36Sopenharmony_civoid 122462306a36Sopenharmony_cimwifiex_set_wmm_params(struct mwifiex_private *priv, 122562306a36Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg, 122662306a36Sopenharmony_ci struct cfg80211_ap_settings *params); 122762306a36Sopenharmony_civoid mwifiex_set_ba_params(struct mwifiex_private *priv); 122862306a36Sopenharmony_ci 122962306a36Sopenharmony_civoid mwifiex_update_ampdu_txwinsize(struct mwifiex_adapter *pmadapter); 123062306a36Sopenharmony_civoid mwifiex_bt_coex_wlan_param_update_event(struct mwifiex_private *priv, 123162306a36Sopenharmony_ci struct sk_buff *event_skb); 123262306a36Sopenharmony_ci 123362306a36Sopenharmony_civoid mwifiex_set_11ac_ba_params(struct mwifiex_private *priv); 123462306a36Sopenharmony_ciint mwifiex_cmd_802_11_scan_ext(struct mwifiex_private *priv, 123562306a36Sopenharmony_ci struct host_cmd_ds_command *cmd, 123662306a36Sopenharmony_ci void *data_buf); 123762306a36Sopenharmony_ciint mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv, 123862306a36Sopenharmony_ci struct host_cmd_ds_command *resp); 123962306a36Sopenharmony_ciint mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv, 124062306a36Sopenharmony_ci void *buf); 124162306a36Sopenharmony_ciint mwifiex_cmd_802_11_bg_scan_config(struct mwifiex_private *priv, 124262306a36Sopenharmony_ci struct host_cmd_ds_command *cmd, 124362306a36Sopenharmony_ci void *data_buf); 124462306a36Sopenharmony_ciint mwifiex_stop_bg_scan(struct mwifiex_private *priv); 124562306a36Sopenharmony_ci 124662306a36Sopenharmony_ci/* 124762306a36Sopenharmony_ci * This function checks if the queuing is RA based or not. 124862306a36Sopenharmony_ci */ 124962306a36Sopenharmony_cistatic inline u8 125062306a36Sopenharmony_cimwifiex_queuing_ra_based(struct mwifiex_private *priv) 125162306a36Sopenharmony_ci{ 125262306a36Sopenharmony_ci /* 125362306a36Sopenharmony_ci * Currently we assume if we are in Infra, then DA=RA. This might not be 125462306a36Sopenharmony_ci * true in the future 125562306a36Sopenharmony_ci */ 125662306a36Sopenharmony_ci if ((priv->bss_mode == NL80211_IFTYPE_STATION || 125762306a36Sopenharmony_ci priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) && 125862306a36Sopenharmony_ci (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA)) 125962306a36Sopenharmony_ci return false; 126062306a36Sopenharmony_ci 126162306a36Sopenharmony_ci return true; 126262306a36Sopenharmony_ci} 126362306a36Sopenharmony_ci 126462306a36Sopenharmony_ci/* 126562306a36Sopenharmony_ci * This function copies rates. 126662306a36Sopenharmony_ci */ 126762306a36Sopenharmony_cistatic inline u32 126862306a36Sopenharmony_cimwifiex_copy_rates(u8 *dest, u32 pos, u8 *src, int len) 126962306a36Sopenharmony_ci{ 127062306a36Sopenharmony_ci int i; 127162306a36Sopenharmony_ci 127262306a36Sopenharmony_ci for (i = 0; i < len && src[i]; i++, pos++) { 127362306a36Sopenharmony_ci if (pos >= MWIFIEX_SUPPORTED_RATES) 127462306a36Sopenharmony_ci break; 127562306a36Sopenharmony_ci dest[pos] = src[i]; 127662306a36Sopenharmony_ci } 127762306a36Sopenharmony_ci 127862306a36Sopenharmony_ci return pos; 127962306a36Sopenharmony_ci} 128062306a36Sopenharmony_ci 128162306a36Sopenharmony_ci/* 128262306a36Sopenharmony_ci * This function returns the correct private structure pointer based 128362306a36Sopenharmony_ci * upon the BSS type and BSS number. 128462306a36Sopenharmony_ci */ 128562306a36Sopenharmony_cistatic inline struct mwifiex_private * 128662306a36Sopenharmony_cimwifiex_get_priv_by_id(struct mwifiex_adapter *adapter, 128762306a36Sopenharmony_ci u8 bss_num, u8 bss_type) 128862306a36Sopenharmony_ci{ 128962306a36Sopenharmony_ci int i; 129062306a36Sopenharmony_ci 129162306a36Sopenharmony_ci for (i = 0; i < adapter->priv_num; i++) { 129262306a36Sopenharmony_ci if (adapter->priv[i]) { 129362306a36Sopenharmony_ci if ((adapter->priv[i]->bss_num == bss_num) && 129462306a36Sopenharmony_ci (adapter->priv[i]->bss_type == bss_type)) 129562306a36Sopenharmony_ci break; 129662306a36Sopenharmony_ci } 129762306a36Sopenharmony_ci } 129862306a36Sopenharmony_ci return ((i < adapter->priv_num) ? adapter->priv[i] : NULL); 129962306a36Sopenharmony_ci} 130062306a36Sopenharmony_ci 130162306a36Sopenharmony_ci/* 130262306a36Sopenharmony_ci * This function returns the first available private structure pointer 130362306a36Sopenharmony_ci * based upon the BSS role. 130462306a36Sopenharmony_ci */ 130562306a36Sopenharmony_cistatic inline struct mwifiex_private * 130662306a36Sopenharmony_cimwifiex_get_priv(struct mwifiex_adapter *adapter, 130762306a36Sopenharmony_ci enum mwifiex_bss_role bss_role) 130862306a36Sopenharmony_ci{ 130962306a36Sopenharmony_ci int i; 131062306a36Sopenharmony_ci 131162306a36Sopenharmony_ci for (i = 0; i < adapter->priv_num; i++) { 131262306a36Sopenharmony_ci if (adapter->priv[i]) { 131362306a36Sopenharmony_ci if (bss_role == MWIFIEX_BSS_ROLE_ANY || 131462306a36Sopenharmony_ci GET_BSS_ROLE(adapter->priv[i]) == bss_role) 131562306a36Sopenharmony_ci break; 131662306a36Sopenharmony_ci } 131762306a36Sopenharmony_ci } 131862306a36Sopenharmony_ci 131962306a36Sopenharmony_ci return ((i < adapter->priv_num) ? adapter->priv[i] : NULL); 132062306a36Sopenharmony_ci} 132162306a36Sopenharmony_ci 132262306a36Sopenharmony_ci/* 132362306a36Sopenharmony_ci * This function checks available bss_num when adding new interface or 132462306a36Sopenharmony_ci * changing interface type. 132562306a36Sopenharmony_ci */ 132662306a36Sopenharmony_cistatic inline u8 132762306a36Sopenharmony_cimwifiex_get_unused_bss_num(struct mwifiex_adapter *adapter, u8 bss_type) 132862306a36Sopenharmony_ci{ 132962306a36Sopenharmony_ci u8 i, j; 133062306a36Sopenharmony_ci int index[MWIFIEX_MAX_BSS_NUM]; 133162306a36Sopenharmony_ci 133262306a36Sopenharmony_ci memset(index, 0, sizeof(index)); 133362306a36Sopenharmony_ci for (i = 0; i < adapter->priv_num; i++) 133462306a36Sopenharmony_ci if (adapter->priv[i]) { 133562306a36Sopenharmony_ci if (adapter->priv[i]->bss_type == bss_type && 133662306a36Sopenharmony_ci !(adapter->priv[i]->bss_mode == 133762306a36Sopenharmony_ci NL80211_IFTYPE_UNSPECIFIED)) { 133862306a36Sopenharmony_ci index[adapter->priv[i]->bss_num] = 1; 133962306a36Sopenharmony_ci } 134062306a36Sopenharmony_ci } 134162306a36Sopenharmony_ci for (j = 0; j < MWIFIEX_MAX_BSS_NUM; j++) 134262306a36Sopenharmony_ci if (!index[j]) 134362306a36Sopenharmony_ci return j; 134462306a36Sopenharmony_ci return -1; 134562306a36Sopenharmony_ci} 134662306a36Sopenharmony_ci 134762306a36Sopenharmony_ci/* 134862306a36Sopenharmony_ci * This function returns the first available unused private structure pointer. 134962306a36Sopenharmony_ci */ 135062306a36Sopenharmony_cistatic inline struct mwifiex_private * 135162306a36Sopenharmony_cimwifiex_get_unused_priv_by_bss_type(struct mwifiex_adapter *adapter, 135262306a36Sopenharmony_ci u8 bss_type) 135362306a36Sopenharmony_ci{ 135462306a36Sopenharmony_ci u8 i; 135562306a36Sopenharmony_ci 135662306a36Sopenharmony_ci for (i = 0; i < adapter->priv_num; i++) 135762306a36Sopenharmony_ci if (adapter->priv[i]->bss_mode == 135862306a36Sopenharmony_ci NL80211_IFTYPE_UNSPECIFIED) { 135962306a36Sopenharmony_ci adapter->priv[i]->bss_num = 136062306a36Sopenharmony_ci mwifiex_get_unused_bss_num(adapter, bss_type); 136162306a36Sopenharmony_ci break; 136262306a36Sopenharmony_ci } 136362306a36Sopenharmony_ci 136462306a36Sopenharmony_ci return ((i < adapter->priv_num) ? adapter->priv[i] : NULL); 136562306a36Sopenharmony_ci} 136662306a36Sopenharmony_ci 136762306a36Sopenharmony_ci/* 136862306a36Sopenharmony_ci * This function returns the driver private structure of a network device. 136962306a36Sopenharmony_ci */ 137062306a36Sopenharmony_cistatic inline struct mwifiex_private * 137162306a36Sopenharmony_cimwifiex_netdev_get_priv(struct net_device *dev) 137262306a36Sopenharmony_ci{ 137362306a36Sopenharmony_ci return (struct mwifiex_private *) (*(unsigned long *) netdev_priv(dev)); 137462306a36Sopenharmony_ci} 137562306a36Sopenharmony_ci 137662306a36Sopenharmony_ci/* 137762306a36Sopenharmony_ci * This function checks if a skb holds a management frame. 137862306a36Sopenharmony_ci */ 137962306a36Sopenharmony_cistatic inline bool mwifiex_is_skb_mgmt_frame(struct sk_buff *skb) 138062306a36Sopenharmony_ci{ 138162306a36Sopenharmony_ci return (get_unaligned_le32(skb->data) == PKT_TYPE_MGMT); 138262306a36Sopenharmony_ci} 138362306a36Sopenharmony_ci 138462306a36Sopenharmony_ci/* This function retrieves channel closed for operation by Channel 138562306a36Sopenharmony_ci * Switch Announcement. 138662306a36Sopenharmony_ci */ 138762306a36Sopenharmony_cistatic inline u8 138862306a36Sopenharmony_cimwifiex_11h_get_csa_closed_channel(struct mwifiex_private *priv) 138962306a36Sopenharmony_ci{ 139062306a36Sopenharmony_ci if (!priv->csa_chan) 139162306a36Sopenharmony_ci return 0; 139262306a36Sopenharmony_ci 139362306a36Sopenharmony_ci /* Clear csa channel, if DFS channel move time has passed */ 139462306a36Sopenharmony_ci if (time_after(jiffies, priv->csa_expire_time)) { 139562306a36Sopenharmony_ci priv->csa_chan = 0; 139662306a36Sopenharmony_ci priv->csa_expire_time = 0; 139762306a36Sopenharmony_ci } 139862306a36Sopenharmony_ci 139962306a36Sopenharmony_ci return priv->csa_chan; 140062306a36Sopenharmony_ci} 140162306a36Sopenharmony_ci 140262306a36Sopenharmony_cistatic inline u8 mwifiex_is_any_intf_active(struct mwifiex_private *priv) 140362306a36Sopenharmony_ci{ 140462306a36Sopenharmony_ci struct mwifiex_private *priv_num; 140562306a36Sopenharmony_ci int i; 140662306a36Sopenharmony_ci 140762306a36Sopenharmony_ci for (i = 0; i < priv->adapter->priv_num; i++) { 140862306a36Sopenharmony_ci priv_num = priv->adapter->priv[i]; 140962306a36Sopenharmony_ci if (priv_num) { 141062306a36Sopenharmony_ci if ((GET_BSS_ROLE(priv_num) == MWIFIEX_BSS_ROLE_UAP && 141162306a36Sopenharmony_ci priv_num->bss_started) || 141262306a36Sopenharmony_ci (GET_BSS_ROLE(priv_num) == MWIFIEX_BSS_ROLE_STA && 141362306a36Sopenharmony_ci priv_num->media_connected)) 141462306a36Sopenharmony_ci return 1; 141562306a36Sopenharmony_ci } 141662306a36Sopenharmony_ci } 141762306a36Sopenharmony_ci 141862306a36Sopenharmony_ci return 0; 141962306a36Sopenharmony_ci} 142062306a36Sopenharmony_ci 142162306a36Sopenharmony_cistatic inline u8 mwifiex_is_tdls_link_setup(u8 status) 142262306a36Sopenharmony_ci{ 142362306a36Sopenharmony_ci switch (status) { 142462306a36Sopenharmony_ci case TDLS_SETUP_COMPLETE: 142562306a36Sopenharmony_ci case TDLS_CHAN_SWITCHING: 142662306a36Sopenharmony_ci case TDLS_IN_BASE_CHAN: 142762306a36Sopenharmony_ci case TDLS_IN_OFF_CHAN: 142862306a36Sopenharmony_ci return true; 142962306a36Sopenharmony_ci default: 143062306a36Sopenharmony_ci break; 143162306a36Sopenharmony_ci } 143262306a36Sopenharmony_ci 143362306a36Sopenharmony_ci return false; 143462306a36Sopenharmony_ci} 143562306a36Sopenharmony_ci 143662306a36Sopenharmony_ci/* Disable platform specific wakeup interrupt */ 143762306a36Sopenharmony_cistatic inline void mwifiex_disable_wake(struct mwifiex_adapter *adapter) 143862306a36Sopenharmony_ci{ 143962306a36Sopenharmony_ci if (adapter->irq_wakeup >= 0) { 144062306a36Sopenharmony_ci disable_irq_wake(adapter->irq_wakeup); 144162306a36Sopenharmony_ci disable_irq(adapter->irq_wakeup); 144262306a36Sopenharmony_ci if (adapter->wake_by_wifi) 144362306a36Sopenharmony_ci /* Undo our disable, since interrupt handler already 144462306a36Sopenharmony_ci * did this. 144562306a36Sopenharmony_ci */ 144662306a36Sopenharmony_ci enable_irq(adapter->irq_wakeup); 144762306a36Sopenharmony_ci 144862306a36Sopenharmony_ci } 144962306a36Sopenharmony_ci} 145062306a36Sopenharmony_ci 145162306a36Sopenharmony_ci/* Enable platform specific wakeup interrupt */ 145262306a36Sopenharmony_cistatic inline void mwifiex_enable_wake(struct mwifiex_adapter *adapter) 145362306a36Sopenharmony_ci{ 145462306a36Sopenharmony_ci /* Enable platform specific wakeup interrupt */ 145562306a36Sopenharmony_ci if (adapter->irq_wakeup >= 0) { 145662306a36Sopenharmony_ci adapter->wake_by_wifi = false; 145762306a36Sopenharmony_ci enable_irq(adapter->irq_wakeup); 145862306a36Sopenharmony_ci enable_irq_wake(adapter->irq_wakeup); 145962306a36Sopenharmony_ci } 146062306a36Sopenharmony_ci} 146162306a36Sopenharmony_ci 146262306a36Sopenharmony_ciint mwifiex_init_shutdown_fw(struct mwifiex_private *priv, 146362306a36Sopenharmony_ci u32 func_init_shutdown); 146462306a36Sopenharmony_ci 146562306a36Sopenharmony_ciint mwifiex_add_card(void *card, struct completion *fw_done, 146662306a36Sopenharmony_ci struct mwifiex_if_ops *if_ops, u8 iface_type, 146762306a36Sopenharmony_ci struct device *dev); 146862306a36Sopenharmony_ciint mwifiex_remove_card(struct mwifiex_adapter *adapter); 146962306a36Sopenharmony_ci 147062306a36Sopenharmony_civoid mwifiex_get_version(struct mwifiex_adapter *adapter, char *version, 147162306a36Sopenharmony_ci int maxlen); 147262306a36Sopenharmony_ciint mwifiex_request_set_multicast_list(struct mwifiex_private *priv, 147362306a36Sopenharmony_ci struct mwifiex_multicast_list *mcast_list); 147462306a36Sopenharmony_ciint mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist, 147562306a36Sopenharmony_ci struct net_device *dev); 147662306a36Sopenharmony_ciint mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter, 147762306a36Sopenharmony_ci struct cmd_ctrl_node *cmd_queued); 147862306a36Sopenharmony_ciint mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, 147962306a36Sopenharmony_ci struct cfg80211_ssid *req_ssid); 148062306a36Sopenharmony_ciint mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type); 148162306a36Sopenharmony_ciint mwifiex_enable_hs(struct mwifiex_adapter *adapter); 148262306a36Sopenharmony_ciint mwifiex_disable_auto_ds(struct mwifiex_private *priv); 148362306a36Sopenharmony_ciint mwifiex_drv_get_data_rate(struct mwifiex_private *priv, u32 *rate); 148462306a36Sopenharmony_ciint mwifiex_request_scan(struct mwifiex_private *priv, 148562306a36Sopenharmony_ci struct cfg80211_ssid *req_ssid); 148662306a36Sopenharmony_ciint mwifiex_scan_networks(struct mwifiex_private *priv, 148762306a36Sopenharmony_ci const struct mwifiex_user_scan_cfg *user_scan_in); 148862306a36Sopenharmony_ciint mwifiex_set_radio(struct mwifiex_private *priv, u8 option); 148962306a36Sopenharmony_ci 149062306a36Sopenharmony_ciint mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp, 149162306a36Sopenharmony_ci const u8 *key, int key_len, u8 key_index, 149262306a36Sopenharmony_ci const u8 *mac_addr, int disable); 149362306a36Sopenharmony_ci 149462306a36Sopenharmony_ciint mwifiex_set_gen_ie(struct mwifiex_private *priv, const u8 *ie, int ie_len); 149562306a36Sopenharmony_ci 149662306a36Sopenharmony_ciint mwifiex_get_ver_ext(struct mwifiex_private *priv, u32 version_str_sel); 149762306a36Sopenharmony_ci 149862306a36Sopenharmony_ciint mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action, 149962306a36Sopenharmony_ci struct ieee80211_channel *chan, 150062306a36Sopenharmony_ci unsigned int duration); 150162306a36Sopenharmony_ci 150262306a36Sopenharmony_ciint mwifiex_get_stats_info(struct mwifiex_private *priv, 150362306a36Sopenharmony_ci struct mwifiex_ds_get_stats *log); 150462306a36Sopenharmony_ci 150562306a36Sopenharmony_ciint mwifiex_reg_write(struct mwifiex_private *priv, u32 reg_type, 150662306a36Sopenharmony_ci u32 reg_offset, u32 reg_value); 150762306a36Sopenharmony_ci 150862306a36Sopenharmony_ciint mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type, 150962306a36Sopenharmony_ci u32 reg_offset, u32 *value); 151062306a36Sopenharmony_ci 151162306a36Sopenharmony_ciint mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes, 151262306a36Sopenharmony_ci u8 *value); 151362306a36Sopenharmony_ci 151462306a36Sopenharmony_ciint mwifiex_set_11n_httx_cfg(struct mwifiex_private *priv, int data); 151562306a36Sopenharmony_ci 151662306a36Sopenharmony_ciint mwifiex_get_11n_httx_cfg(struct mwifiex_private *priv, int *data); 151762306a36Sopenharmony_ci 151862306a36Sopenharmony_ciint mwifiex_set_tx_rate_cfg(struct mwifiex_private *priv, int tx_rate_index); 151962306a36Sopenharmony_ci 152062306a36Sopenharmony_ciint mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_index); 152162306a36Sopenharmony_ci 152262306a36Sopenharmony_ciint mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode); 152362306a36Sopenharmony_ci 152462306a36Sopenharmony_ciint mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter, 152562306a36Sopenharmony_ci char *version, int max_len); 152662306a36Sopenharmony_ci 152762306a36Sopenharmony_ciint mwifiex_set_tx_power(struct mwifiex_private *priv, 152862306a36Sopenharmony_ci struct mwifiex_power_cfg *power_cfg); 152962306a36Sopenharmony_ci 153062306a36Sopenharmony_ciint mwifiex_main_process(struct mwifiex_adapter *); 153162306a36Sopenharmony_ci 153262306a36Sopenharmony_ciint mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb); 153362306a36Sopenharmony_ci 153462306a36Sopenharmony_ciint mwifiex_get_bss_info(struct mwifiex_private *, 153562306a36Sopenharmony_ci struct mwifiex_bss_info *); 153662306a36Sopenharmony_ciint mwifiex_fill_new_bss_desc(struct mwifiex_private *priv, 153762306a36Sopenharmony_ci struct cfg80211_bss *bss, 153862306a36Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 153962306a36Sopenharmony_ciint mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, 154062306a36Sopenharmony_ci struct mwifiex_bssdescriptor *bss_entry); 154162306a36Sopenharmony_ciint mwifiex_check_network_compatibility(struct mwifiex_private *priv, 154262306a36Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 154362306a36Sopenharmony_ci 154462306a36Sopenharmony_ciu8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type); 154562306a36Sopenharmony_ciu8 mwifiex_get_chan_type(struct mwifiex_private *priv); 154662306a36Sopenharmony_ci 154762306a36Sopenharmony_cistruct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, 154862306a36Sopenharmony_ci const char *name, 154962306a36Sopenharmony_ci unsigned char name_assign_type, 155062306a36Sopenharmony_ci enum nl80211_iftype type, 155162306a36Sopenharmony_ci struct vif_params *params); 155262306a36Sopenharmony_ciint mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev); 155362306a36Sopenharmony_ci 155462306a36Sopenharmony_civoid mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config); 155562306a36Sopenharmony_ci 155662306a36Sopenharmony_ciint mwifiex_add_wowlan_magic_pkt_filter(struct mwifiex_adapter *adapter); 155762306a36Sopenharmony_ci 155862306a36Sopenharmony_ciint mwifiex_set_mgmt_ies(struct mwifiex_private *priv, 155962306a36Sopenharmony_ci struct cfg80211_beacon_data *data); 156062306a36Sopenharmony_ciint mwifiex_del_mgmt_ies(struct mwifiex_private *priv); 156162306a36Sopenharmony_ciu8 *mwifiex_11d_code_2_region(u8 code); 156262306a36Sopenharmony_civoid mwifiex_uap_set_channel(struct mwifiex_private *priv, 156362306a36Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg, 156462306a36Sopenharmony_ci struct cfg80211_chan_def chandef); 156562306a36Sopenharmony_ciint mwifiex_config_start_uap(struct mwifiex_private *priv, 156662306a36Sopenharmony_ci struct mwifiex_uap_bss_param *bss_cfg); 156762306a36Sopenharmony_civoid mwifiex_uap_del_sta_data(struct mwifiex_private *priv, 156862306a36Sopenharmony_ci struct mwifiex_sta_node *node); 156962306a36Sopenharmony_ci 157062306a36Sopenharmony_civoid mwifiex_config_uap_11d(struct mwifiex_private *priv, 157162306a36Sopenharmony_ci struct cfg80211_beacon_data *beacon_data); 157262306a36Sopenharmony_ci 157362306a36Sopenharmony_civoid mwifiex_init_11h_params(struct mwifiex_private *priv); 157462306a36Sopenharmony_ciint mwifiex_is_11h_active(struct mwifiex_private *priv); 157562306a36Sopenharmony_ciint mwifiex_11h_activate(struct mwifiex_private *priv, bool flag); 157662306a36Sopenharmony_ci 157762306a36Sopenharmony_civoid mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer, 157862306a36Sopenharmony_ci struct mwifiex_bssdescriptor *bss_desc); 157962306a36Sopenharmony_ciint mwifiex_11h_handle_event_chanswann(struct mwifiex_private *priv); 158062306a36Sopenharmony_ciint mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv, 158162306a36Sopenharmony_ci struct device_node *node, const char *prefix); 158262306a36Sopenharmony_civoid mwifiex_dnld_txpwr_table(struct mwifiex_private *priv); 158362306a36Sopenharmony_ci 158462306a36Sopenharmony_ciextern const struct ethtool_ops mwifiex_ethtool_ops; 158562306a36Sopenharmony_ci 158662306a36Sopenharmony_civoid mwifiex_del_all_sta_list(struct mwifiex_private *priv); 158762306a36Sopenharmony_civoid mwifiex_del_sta_entry(struct mwifiex_private *priv, const u8 *mac); 158862306a36Sopenharmony_civoid 158962306a36Sopenharmony_cimwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies, 159062306a36Sopenharmony_ci int ies_len, struct mwifiex_sta_node *node); 159162306a36Sopenharmony_cistruct mwifiex_sta_node * 159262306a36Sopenharmony_cimwifiex_add_sta_entry(struct mwifiex_private *priv, const u8 *mac); 159362306a36Sopenharmony_cistruct mwifiex_sta_node * 159462306a36Sopenharmony_cimwifiex_get_sta_entry(struct mwifiex_private *priv, const u8 *mac); 159562306a36Sopenharmony_ciu8 mwifiex_is_tdls_chan_switching(struct mwifiex_private *priv); 159662306a36Sopenharmony_ciu8 mwifiex_is_tdls_off_chan(struct mwifiex_private *priv); 159762306a36Sopenharmony_ciu8 mwifiex_is_send_cmd_allowed(struct mwifiex_private *priv); 159862306a36Sopenharmony_ciint mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer, 159962306a36Sopenharmony_ci u8 action_code, u8 dialog_token, 160062306a36Sopenharmony_ci u16 status_code, const u8 *extra_ies, 160162306a36Sopenharmony_ci size_t extra_ies_len); 160262306a36Sopenharmony_ciint mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer, 160362306a36Sopenharmony_ci u8 action_code, u8 dialog_token, 160462306a36Sopenharmony_ci u16 status_code, const u8 *extra_ies, 160562306a36Sopenharmony_ci size_t extra_ies_len); 160662306a36Sopenharmony_civoid mwifiex_process_tdls_action_frame(struct mwifiex_private *priv, 160762306a36Sopenharmony_ci u8 *buf, int len); 160862306a36Sopenharmony_ciint mwifiex_tdls_oper(struct mwifiex_private *priv, const u8 *peer, u8 action); 160962306a36Sopenharmony_ciint mwifiex_get_tdls_link_status(struct mwifiex_private *priv, const u8 *mac); 161062306a36Sopenharmony_ciint mwifiex_get_tdls_list(struct mwifiex_private *priv, 161162306a36Sopenharmony_ci struct tdls_peer_info *buf); 161262306a36Sopenharmony_civoid mwifiex_disable_all_tdls_links(struct mwifiex_private *priv); 161362306a36Sopenharmony_cibool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private *priv); 161462306a36Sopenharmony_ciu8 mwifiex_get_center_freq_index(struct mwifiex_private *priv, u8 band, 161562306a36Sopenharmony_ci u32 pri_chan, u8 chan_bw); 161662306a36Sopenharmony_ciint mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter); 161762306a36Sopenharmony_ci 161862306a36Sopenharmony_ciint mwifiex_tdls_check_tx(struct mwifiex_private *priv, struct sk_buff *skb); 161962306a36Sopenharmony_civoid mwifiex_flush_auto_tdls_list(struct mwifiex_private *priv); 162062306a36Sopenharmony_civoid mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv, 162162306a36Sopenharmony_ci const u8 *mac, u8 link_status); 162262306a36Sopenharmony_civoid mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private *priv, 162362306a36Sopenharmony_ci u8 *mac, s8 snr, s8 nflr); 162462306a36Sopenharmony_civoid mwifiex_check_auto_tdls(struct timer_list *t); 162562306a36Sopenharmony_civoid mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv, const u8 *mac); 162662306a36Sopenharmony_civoid mwifiex_setup_auto_tdls_timer(struct mwifiex_private *priv); 162762306a36Sopenharmony_civoid mwifiex_clean_auto_tdls(struct mwifiex_private *priv); 162862306a36Sopenharmony_ciint mwifiex_config_tdls_enable(struct mwifiex_private *priv); 162962306a36Sopenharmony_ciint mwifiex_config_tdls_disable(struct mwifiex_private *priv); 163062306a36Sopenharmony_ciint mwifiex_config_tdls_cs_params(struct mwifiex_private *priv); 163162306a36Sopenharmony_ciint mwifiex_stop_tdls_cs(struct mwifiex_private *priv, const u8 *peer_mac); 163262306a36Sopenharmony_ciint mwifiex_start_tdls_cs(struct mwifiex_private *priv, const u8 *peer_mac, 163362306a36Sopenharmony_ci u8 primary_chan, u8 second_chan_offset, u8 band); 163462306a36Sopenharmony_ci 163562306a36Sopenharmony_ciint mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv, 163662306a36Sopenharmony_ci struct host_cmd_ds_command *cmd, 163762306a36Sopenharmony_ci void *data_buf); 163862306a36Sopenharmony_ciint mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv, 163962306a36Sopenharmony_ci struct sk_buff *skb); 164062306a36Sopenharmony_ci 164162306a36Sopenharmony_civoid mwifiex_parse_tx_status_event(struct mwifiex_private *priv, 164262306a36Sopenharmony_ci void *event_body); 164362306a36Sopenharmony_ci 164462306a36Sopenharmony_cistruct sk_buff * 164562306a36Sopenharmony_cimwifiex_clone_skb_for_tx_status(struct mwifiex_private *priv, 164662306a36Sopenharmony_ci struct sk_buff *skb, u8 flag, u64 *cookie); 164762306a36Sopenharmony_civoid mwifiex_dfs_cac_work_queue(struct work_struct *work); 164862306a36Sopenharmony_civoid mwifiex_dfs_chan_sw_work_queue(struct work_struct *work); 164962306a36Sopenharmony_civoid mwifiex_abort_cac(struct mwifiex_private *priv); 165062306a36Sopenharmony_ciint mwifiex_stop_radar_detection(struct mwifiex_private *priv, 165162306a36Sopenharmony_ci struct cfg80211_chan_def *chandef); 165262306a36Sopenharmony_ciint mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv, 165362306a36Sopenharmony_ci struct sk_buff *skb); 165462306a36Sopenharmony_ci 165562306a36Sopenharmony_civoid mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr, 165662306a36Sopenharmony_ci s8 nflr); 165762306a36Sopenharmony_civoid mwifiex_hist_data_reset(struct mwifiex_private *priv); 165862306a36Sopenharmony_civoid mwifiex_hist_data_add(struct mwifiex_private *priv, 165962306a36Sopenharmony_ci u8 rx_rate, s8 snr, s8 nflr); 166062306a36Sopenharmony_ciu8 mwifiex_adjust_data_rate(struct mwifiex_private *priv, 166162306a36Sopenharmony_ci u8 rx_rate, u8 ht_info); 166262306a36Sopenharmony_ci 166362306a36Sopenharmony_civoid mwifiex_drv_info_dump(struct mwifiex_adapter *adapter); 166462306a36Sopenharmony_civoid mwifiex_prepare_fw_dump_info(struct mwifiex_adapter *adapter); 166562306a36Sopenharmony_civoid mwifiex_upload_device_dump(struct mwifiex_adapter *adapter); 166662306a36Sopenharmony_civoid *mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags); 166762306a36Sopenharmony_civoid mwifiex_fw_dump_event(struct mwifiex_private *priv); 166862306a36Sopenharmony_civoid mwifiex_queue_main_work(struct mwifiex_adapter *adapter); 166962306a36Sopenharmony_ciint mwifiex_get_wakeup_reason(struct mwifiex_private *priv, u16 action, 167062306a36Sopenharmony_ci int cmd_type, 167162306a36Sopenharmony_ci struct mwifiex_ds_wakeup_reason *wakeup_reason); 167262306a36Sopenharmony_ciint mwifiex_get_chan_info(struct mwifiex_private *priv, 167362306a36Sopenharmony_ci struct mwifiex_channel_band *channel_band); 167462306a36Sopenharmony_ciint mwifiex_ret_wakeup_reason(struct mwifiex_private *priv, 167562306a36Sopenharmony_ci struct host_cmd_ds_command *resp, 167662306a36Sopenharmony_ci struct host_cmd_ds_wakeup_reason *wakeup_reason); 167762306a36Sopenharmony_civoid mwifiex_coex_ampdu_rxwinsize(struct mwifiex_adapter *adapter); 167862306a36Sopenharmony_civoid mwifiex_11n_delba(struct mwifiex_private *priv, int tid); 167962306a36Sopenharmony_ciint mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy); 168062306a36Sopenharmony_civoid mwifiex_process_tx_pause_event(struct mwifiex_private *priv, 168162306a36Sopenharmony_ci struct sk_buff *event); 168262306a36Sopenharmony_civoid mwifiex_process_multi_chan_event(struct mwifiex_private *priv, 168362306a36Sopenharmony_ci struct sk_buff *event_skb); 168462306a36Sopenharmony_civoid mwifiex_multi_chan_resync(struct mwifiex_adapter *adapter); 168562306a36Sopenharmony_ciint mwifiex_set_mac_address(struct mwifiex_private *priv, 168662306a36Sopenharmony_ci struct net_device *dev, 168762306a36Sopenharmony_ci bool external, u8 *new_mac); 168862306a36Sopenharmony_civoid mwifiex_devdump_tmo_func(unsigned long function_context); 168962306a36Sopenharmony_ci 169062306a36Sopenharmony_ci#ifdef CONFIG_DEBUG_FS 169162306a36Sopenharmony_civoid mwifiex_debugfs_init(void); 169262306a36Sopenharmony_civoid mwifiex_debugfs_remove(void); 169362306a36Sopenharmony_ci 169462306a36Sopenharmony_civoid mwifiex_dev_debugfs_init(struct mwifiex_private *priv); 169562306a36Sopenharmony_civoid mwifiex_dev_debugfs_remove(struct mwifiex_private *priv); 169662306a36Sopenharmony_ci#endif 169762306a36Sopenharmony_ciint mwifiex_reinit_sw(struct mwifiex_adapter *adapter); 169862306a36Sopenharmony_ciint mwifiex_shutdown_sw(struct mwifiex_adapter *adapter); 169962306a36Sopenharmony_ci#endif /* !_MWIFIEX_MAIN_H_ */ 1700