main.h 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636
  1. /*
  2. * Marvell Wireless LAN device driver: major data structures and prototypes
  3. *
  4. * Copyright (C) 2011-2014, Marvell International Ltd.
  5. *
  6. * This software file (the "File") is distributed by Marvell International
  7. * Ltd. under the terms of the GNU General Public License Version 2, June 1991
  8. * (the "License"). You may use, redistribute and/or modify this File in
  9. * accordance with the terms and conditions of the License, a copy of which
  10. * is available by writing to the Free Software Foundation, Inc.,
  11. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
  12. * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
  13. *
  14. * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
  16. * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
  17. * this warranty disclaimer.
  18. */
  19. #ifndef _MWIFIEX_MAIN_H_
  20. #define _MWIFIEX_MAIN_H_
  21. #include <linux/kernel.h>
  22. #include <linux/module.h>
  23. #include <linux/sched.h>
  24. #include <linux/semaphore.h>
  25. #include <linux/ip.h>
  26. #include <linux/skbuff.h>
  27. #include <linux/if_arp.h>
  28. #include <linux/etherdevice.h>
  29. #include <net/sock.h>
  30. #include <net/lib80211.h>
  31. #include <linux/vmalloc.h>
  32. #include <linux/firmware.h>
  33. #include <linux/ctype.h>
  34. #include <linux/of.h>
  35. #include <linux/idr.h>
  36. #include <linux/inetdevice.h>
  37. #include <linux/devcoredump.h>
  38. #include <linux/err.h>
  39. #include <linux/gpio.h>
  40. #include <linux/gfp.h>
  41. #include <linux/interrupt.h>
  42. #include <linux/io.h>
  43. #include <linux/of_gpio.h>
  44. #include <linux/of_platform.h>
  45. #include <linux/platform_device.h>
  46. #include <linux/pm_runtime.h>
  47. #include <linux/slab.h>
  48. #include <linux/of_irq.h>
  49. #include "decl.h"
  50. #include "ioctl.h"
  51. #include "util.h"
  52. #include "fw.h"
  53. #include "pcie.h"
  54. #include "usb.h"
  55. #include "sdio.h"
  56. extern const char driver_version[];
  57. extern bool mfg_mode;
  58. struct mwifiex_adapter;
  59. struct mwifiex_private;
  60. enum {
  61. MWIFIEX_ASYNC_CMD,
  62. MWIFIEX_SYNC_CMD
  63. };
  64. #define MWIFIEX_DRIVER_MODE_STA BIT(0)
  65. #define MWIFIEX_DRIVER_MODE_UAP BIT(1)
  66. #define MWIFIEX_DRIVER_MODE_P2P BIT(2)
  67. #define MWIFIEX_DRIVER_MODE_BITMASK (BIT(0) | BIT(1) | BIT(2))
  68. #define MWIFIEX_MAX_AP 64
  69. #define MWIFIEX_MAX_PKTS_TXQ 16
  70. #define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ)
  71. #define MWIFIEX_TIMER_10S 10000
  72. #define MWIFIEX_TIMER_1S 1000
  73. #define MAX_TX_PENDING 100
  74. #define LOW_TX_PENDING 80
  75. #define HIGH_RX_PENDING 50
  76. #define LOW_RX_PENDING 20
  77. #define MWIFIEX_UPLD_SIZE (2312)
  78. #define MAX_EVENT_SIZE 2048
  79. #define ARP_FILTER_MAX_BUF_SIZE 68
  80. #define MWIFIEX_KEY_BUFFER_SIZE 16
  81. #define MWIFIEX_DEFAULT_LISTEN_INTERVAL 10
  82. #define MWIFIEX_MAX_REGION_CODE 9
  83. #define DEFAULT_BCN_AVG_FACTOR 8
  84. #define DEFAULT_DATA_AVG_FACTOR 8
  85. #define FIRST_VALID_CHANNEL 0xff
  86. #define DEFAULT_AD_HOC_CHANNEL 6
  87. #define DEFAULT_AD_HOC_CHANNEL_A 36
  88. #define DEFAULT_BCN_MISS_TIMEOUT 5
  89. #define MAX_SCAN_BEACON_BUFFER 8000
  90. #define SCAN_BEACON_ENTRY_PAD 6
  91. #define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 110
  92. #define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 40
  93. #define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME 40
  94. #define MWIFIEX_DEF_SCAN_CHAN_GAP_TIME 50
  95. #define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI)))
  96. #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S)
  97. #define RSN_GTK_OUI_OFFSET 2
  98. #define MWIFIEX_OUI_NOT_PRESENT 0
  99. #define MWIFIEX_OUI_PRESENT 1
  100. #define PKT_TYPE_MGMT 0xE5
  101. /*
  102. * Do not check for data_received for USB, as data_received
  103. * is handled in mwifiex_usb_recv for USB
  104. */
  105. #define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \
  106. adapter->event_received || \
  107. adapter->data_received)
  108. #define MWIFIEX_TYPE_CMD 1
  109. #define MWIFIEX_TYPE_DATA 0
  110. #define MWIFIEX_TYPE_AGGR_DATA 10
  111. #define MWIFIEX_TYPE_EVENT 3
  112. #define MAX_BITMAP_RATES_SIZE 18
  113. #define MAX_CHANNEL_BAND_BG 14
  114. #define MAX_CHANNEL_BAND_A 165
  115. #define MAX_FREQUENCY_BAND_BG 2484
  116. #define MWIFIEX_EVENT_HEADER_LEN 4
  117. #define MWIFIEX_UAP_EVENT_EXTRA_HEADER 2
  118. #define MWIFIEX_TYPE_LEN 4
  119. #define MWIFIEX_USB_TYPE_CMD 0xF00DFACE
  120. #define MWIFIEX_USB_TYPE_DATA 0xBEADC0DE
  121. #define MWIFIEX_USB_TYPE_EVENT 0xBEEFFACE
  122. /* Threshold for tx_timeout_cnt before we trigger a card reset */
  123. #define TX_TIMEOUT_THRESHOLD 6
  124. #define MWIFIEX_DRV_INFO_SIZE_MAX 0x40000
  125. /* Address alignment */
  126. #define MWIFIEX_ALIGN_ADDR(p, a) (((long)(p) + (a) - 1) & ~((a) - 1))
  127. /**
  128. *enum mwifiex_debug_level - marvell wifi debug level
  129. */
  130. enum MWIFIEX_DEBUG_LEVEL {
  131. MWIFIEX_DBG_MSG = 0x00000001,
  132. MWIFIEX_DBG_FATAL = 0x00000002,
  133. MWIFIEX_DBG_ERROR = 0x00000004,
  134. MWIFIEX_DBG_DATA = 0x00000008,
  135. MWIFIEX_DBG_CMD = 0x00000010,
  136. MWIFIEX_DBG_EVENT = 0x00000020,
  137. MWIFIEX_DBG_INTR = 0x00000040,
  138. MWIFIEX_DBG_IOCTL = 0x00000080,
  139. MWIFIEX_DBG_MPA_D = 0x00008000,
  140. MWIFIEX_DBG_DAT_D = 0x00010000,
  141. MWIFIEX_DBG_CMD_D = 0x00020000,
  142. MWIFIEX_DBG_EVT_D = 0x00040000,
  143. MWIFIEX_DBG_FW_D = 0x00080000,
  144. MWIFIEX_DBG_IF_D = 0x00100000,
  145. MWIFIEX_DBG_ENTRY = 0x10000000,
  146. MWIFIEX_DBG_WARN = 0x20000000,
  147. MWIFIEX_DBG_INFO = 0x40000000,
  148. MWIFIEX_DBG_DUMP = 0x80000000,
  149. MWIFIEX_DBG_ANY = 0xffffffff
  150. };
  151. #define MWIFIEX_DEFAULT_DEBUG_MASK (MWIFIEX_DBG_MSG | \
  152. MWIFIEX_DBG_FATAL | \
  153. MWIFIEX_DBG_ERROR)
  154. __printf(3, 4)
  155. void _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask,
  156. const char *fmt, ...);
  157. #define mwifiex_dbg(adapter, mask, fmt, ...) \
  158. _mwifiex_dbg(adapter, MWIFIEX_DBG_##mask, fmt, ##__VA_ARGS__)
  159. #define DEBUG_DUMP_DATA_MAX_LEN 128
  160. #define mwifiex_dbg_dump(adapter, dbg_mask, str, buf, len) \
  161. do { \
  162. if ((adapter)->debug_mask & MWIFIEX_DBG_##dbg_mask) \
  163. print_hex_dump(KERN_DEBUG, str, \
  164. DUMP_PREFIX_OFFSET, 16, 1, \
  165. buf, len, false); \
  166. } while (0)
  167. /** Min BGSCAN interval 15 second */
  168. #define MWIFIEX_BGSCAN_INTERVAL 15000
  169. /** default repeat count */
  170. #define MWIFIEX_BGSCAN_REPEAT_COUNT 6
  171. struct mwifiex_dbg {
  172. u32 num_cmd_host_to_card_failure;
  173. u32 num_cmd_sleep_cfm_host_to_card_failure;
  174. u32 num_tx_host_to_card_failure;
  175. u32 num_event_deauth;
  176. u32 num_event_disassoc;
  177. u32 num_event_link_lost;
  178. u32 num_cmd_deauth;
  179. u32 num_cmd_assoc_success;
  180. u32 num_cmd_assoc_failure;
  181. u32 num_tx_timeout;
  182. u16 timeout_cmd_id;
  183. u16 timeout_cmd_act;
  184. u16 last_cmd_id[DBG_CMD_NUM];
  185. u16 last_cmd_act[DBG_CMD_NUM];
  186. u16 last_cmd_index;
  187. u16 last_cmd_resp_id[DBG_CMD_NUM];
  188. u16 last_cmd_resp_index;
  189. u16 last_event[DBG_CMD_NUM];
  190. u16 last_event_index;
  191. u32 last_mp_wr_bitmap[MWIFIEX_DBG_SDIO_MP_NUM];
  192. u32 last_mp_wr_ports[MWIFIEX_DBG_SDIO_MP_NUM];
  193. u32 last_mp_wr_len[MWIFIEX_DBG_SDIO_MP_NUM];
  194. u32 last_mp_curr_wr_port[MWIFIEX_DBG_SDIO_MP_NUM];
  195. u8 last_sdio_mp_index;
  196. };
  197. enum MWIFIEX_HARDWARE_STATUS {
  198. MWIFIEX_HW_STATUS_READY,
  199. MWIFIEX_HW_STATUS_INITIALIZING,
  200. MWIFIEX_HW_STATUS_INIT_DONE,
  201. MWIFIEX_HW_STATUS_RESET,
  202. MWIFIEX_HW_STATUS_CLOSING,
  203. MWIFIEX_HW_STATUS_NOT_READY
  204. };
  205. enum MWIFIEX_802_11_POWER_MODE {
  206. MWIFIEX_802_11_POWER_MODE_CAM,
  207. MWIFIEX_802_11_POWER_MODE_PSP
  208. };
  209. struct mwifiex_tx_param {
  210. u32 next_pkt_len;
  211. };
  212. enum MWIFIEX_PS_STATE {
  213. PS_STATE_AWAKE,
  214. PS_STATE_PRE_SLEEP,
  215. PS_STATE_SLEEP_CFM,
  216. PS_STATE_SLEEP
  217. };
  218. enum mwifiex_iface_type {
  219. MWIFIEX_SDIO,
  220. MWIFIEX_PCIE,
  221. MWIFIEX_USB
  222. };
  223. struct mwifiex_add_ba_param {
  224. u32 tx_win_size;
  225. u32 rx_win_size;
  226. u32 timeout;
  227. u8 tx_amsdu;
  228. u8 rx_amsdu;
  229. };
  230. struct mwifiex_tx_aggr {
  231. u8 ampdu_user;
  232. u8 ampdu_ap;
  233. u8 amsdu;
  234. };
  235. enum mwifiex_ba_status {
  236. BA_SETUP_NONE = 0,
  237. BA_SETUP_INPROGRESS,
  238. BA_SETUP_COMPLETE
  239. };
  240. struct mwifiex_ra_list_tbl {
  241. struct list_head list;
  242. struct sk_buff_head skb_head;
  243. u8 ra[ETH_ALEN];
  244. u32 is_11n_enabled;
  245. u16 max_amsdu;
  246. u16 ba_pkt_count;
  247. u8 ba_packet_thr;
  248. enum mwifiex_ba_status ba_status;
  249. u8 amsdu_in_ampdu;
  250. u16 total_pkt_count;
  251. bool tdls_link;
  252. bool tx_paused;
  253. };
  254. struct mwifiex_tid_tbl {
  255. struct list_head ra_list;
  256. };
  257. #define WMM_HIGHEST_PRIORITY 7
  258. #define HIGH_PRIO_TID 7
  259. #define LOW_PRIO_TID 0
  260. #define MWIFIEX_WMM_DRV_DELAY_MAX 510
  261. struct mwifiex_wmm_desc {
  262. struct mwifiex_tid_tbl tid_tbl_ptr[MAX_NUM_TID];
  263. u32 packets_out[MAX_NUM_TID];
  264. u32 pkts_paused[MAX_NUM_TID];
  265. /* spin lock to protect ra_list */
  266. spinlock_t ra_list_spinlock;
  267. struct mwifiex_wmm_ac_status ac_status[IEEE80211_NUM_ACS];
  268. enum mwifiex_wmm_ac_e ac_down_graded_vals[IEEE80211_NUM_ACS];
  269. u32 drv_pkt_delay_max;
  270. u8 queue_priority[IEEE80211_NUM_ACS];
  271. u32 user_pri_pkt_tx_ctrl[WMM_HIGHEST_PRIORITY + 1]; /* UP: 0 to 7 */
  272. /* Number of transmit packets queued */
  273. atomic_t tx_pkts_queued;
  274. /* Tracks highest priority with a packet queued */
  275. atomic_t highest_queued_prio;
  276. };
  277. struct mwifiex_802_11_security {
  278. u8 wpa_enabled;
  279. u8 wpa2_enabled;
  280. u8 wapi_enabled;
  281. u8 wapi_key_on;
  282. u8 wep_enabled;
  283. u32 authentication_mode;
  284. u8 is_authtype_auto;
  285. u32 encryption_mode;
  286. };
  287. struct ieee_types_header {
  288. u8 element_id;
  289. u8 len;
  290. } __packed;
  291. struct ieee_types_vendor_specific {
  292. struct ieee_types_vendor_header vend_hdr;
  293. u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)];
  294. } __packed;
  295. struct ieee_types_generic {
  296. struct ieee_types_header ieee_hdr;
  297. u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_header)];
  298. } __packed;
  299. struct ieee_types_bss_co_2040 {
  300. struct ieee_types_header ieee_hdr;
  301. u8 bss_2040co;
  302. } __packed;
  303. struct ieee_types_extcap {
  304. struct ieee_types_header ieee_hdr;
  305. u8 ext_capab[8];
  306. } __packed;
  307. struct ieee_types_vht_cap {
  308. struct ieee_types_header ieee_hdr;
  309. struct ieee80211_vht_cap vhtcap;
  310. } __packed;
  311. struct ieee_types_vht_oper {
  312. struct ieee_types_header ieee_hdr;
  313. struct ieee80211_vht_operation vhtoper;
  314. } __packed;
  315. struct ieee_types_aid {
  316. struct ieee_types_header ieee_hdr;
  317. u16 aid;
  318. } __packed;
  319. struct mwifiex_bssdescriptor {
  320. u8 mac_address[ETH_ALEN];
  321. struct cfg80211_ssid ssid;
  322. u32 privacy;
  323. s32 rssi;
  324. u32 channel;
  325. u32 freq;
  326. u16 beacon_period;
  327. u8 erp_flags;
  328. u32 bss_mode;
  329. u8 supported_rates[MWIFIEX_SUPPORTED_RATES];
  330. u8 data_rates[MWIFIEX_SUPPORTED_RATES];
  331. /* Network band.
  332. * BAND_B(0x01): 'b' band
  333. * BAND_G(0x02): 'g' band
  334. * BAND_A(0X04): 'a' band
  335. */
  336. u16 bss_band;
  337. u64 fw_tsf;
  338. u64 timestamp;
  339. union ieee_types_phy_param_set phy_param_set;
  340. union ieee_types_ss_param_set ss_param_set;
  341. u16 cap_info_bitmap;
  342. struct ieee_types_wmm_parameter wmm_ie;
  343. u8 disable_11n;
  344. struct ieee80211_ht_cap *bcn_ht_cap;
  345. u16 ht_cap_offset;
  346. struct ieee80211_ht_operation *bcn_ht_oper;
  347. u16 ht_info_offset;
  348. u8 *bcn_bss_co_2040;
  349. u16 bss_co_2040_offset;
  350. u8 *bcn_ext_cap;
  351. u16 ext_cap_offset;
  352. struct ieee80211_vht_cap *bcn_vht_cap;
  353. u16 vht_cap_offset;
  354. struct ieee80211_vht_operation *bcn_vht_oper;
  355. u16 vht_info_offset;
  356. struct ieee_types_oper_mode_ntf *oper_mode;
  357. u16 oper_mode_offset;
  358. u8 disable_11ac;
  359. struct ieee_types_vendor_specific *bcn_wpa_ie;
  360. u16 wpa_offset;
  361. struct ieee_types_generic *bcn_rsn_ie;
  362. u16 rsn_offset;
  363. struct ieee_types_generic *bcn_wapi_ie;
  364. u16 wapi_offset;
  365. u8 *beacon_buf;
  366. u32 beacon_buf_size;
  367. u8 sensed_11h;
  368. u8 local_constraint;
  369. u8 chan_sw_ie_present;
  370. };
  371. struct mwifiex_current_bss_params {
  372. struct mwifiex_bssdescriptor bss_descriptor;
  373. u8 wmm_enabled;
  374. u8 wmm_uapsd_enabled;
  375. u8 band;
  376. u32 num_of_rates;
  377. u8 data_rates[MWIFIEX_SUPPORTED_RATES];
  378. };
  379. struct mwifiex_sleep_params {
  380. u16 sp_error;
  381. u16 sp_offset;
  382. u16 sp_stable_time;
  383. u8 sp_cal_control;
  384. u8 sp_ext_sleep_clk;
  385. u16 sp_reserved;
  386. };
  387. struct mwifiex_sleep_period {
  388. u16 period;
  389. u16 reserved;
  390. };
  391. struct mwifiex_wep_key {
  392. u32 length;
  393. u32 key_index;
  394. u32 key_length;
  395. u8 key_material[MWIFIEX_KEY_BUFFER_SIZE];
  396. };
  397. #define MAX_REGION_CHANNEL_NUM 2
  398. struct mwifiex_chan_freq_power {
  399. u16 channel;
  400. u32 freq;
  401. u16 max_tx_power;
  402. u8 unsupported;
  403. };
  404. enum state_11d_t {
  405. DISABLE_11D = 0,
  406. ENABLE_11D = 1,
  407. };
  408. #define MWIFIEX_MAX_TRIPLET_802_11D 83
  409. struct mwifiex_802_11d_domain_reg {
  410. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  411. u8 no_of_triplet;
  412. struct ieee80211_country_ie_triplet
  413. triplet[MWIFIEX_MAX_TRIPLET_802_11D];
  414. };
  415. struct mwifiex_vendor_spec_cfg_ie {
  416. u16 mask;
  417. u16 flag;
  418. u8 ie[MWIFIEX_MAX_VSIE_LEN];
  419. };
  420. struct wps {
  421. u8 session_enable;
  422. };
  423. struct mwifiex_roc_cfg {
  424. u64 cookie;
  425. struct ieee80211_channel chan;
  426. };
  427. enum mwifiex_iface_work_flags {
  428. MWIFIEX_IFACE_WORK_DEVICE_DUMP,
  429. MWIFIEX_IFACE_WORK_CARD_RESET,
  430. };
  431. struct mwifiex_private {
  432. struct mwifiex_adapter *adapter;
  433. u8 bss_type;
  434. u8 bss_role;
  435. u8 bss_priority;
  436. u8 bss_num;
  437. u8 bss_started;
  438. u8 frame_type;
  439. u8 curr_addr[ETH_ALEN];
  440. u8 media_connected;
  441. u8 port_open;
  442. u8 usb_port;
  443. u32 num_tx_timeout;
  444. /* track consecutive timeout */
  445. u8 tx_timeout_cnt;
  446. struct net_device *netdev;
  447. struct net_device_stats stats;
  448. u16 curr_pkt_filter;
  449. u32 bss_mode;
  450. u32 pkt_tx_ctrl;
  451. u16 tx_power_level;
  452. u8 max_tx_power_level;
  453. u8 min_tx_power_level;
  454. u32 tx_ant;
  455. u32 rx_ant;
  456. u8 tx_rate;
  457. u8 tx_htinfo;
  458. u8 rxpd_htinfo;
  459. u8 rxpd_rate;
  460. u16 rate_bitmap;
  461. u16 bitmap_rates[MAX_BITMAP_RATES_SIZE];
  462. u32 data_rate;
  463. u8 is_data_rate_auto;
  464. u16 bcn_avg_factor;
  465. u16 data_avg_factor;
  466. s16 data_rssi_last;
  467. s16 data_nf_last;
  468. s16 data_rssi_avg;
  469. s16 data_nf_avg;
  470. s16 bcn_rssi_last;
  471. s16 bcn_nf_last;
  472. s16 bcn_rssi_avg;
  473. s16 bcn_nf_avg;
  474. struct mwifiex_bssdescriptor *attempted_bss_desc;
  475. struct cfg80211_ssid prev_ssid;
  476. u8 prev_bssid[ETH_ALEN];
  477. struct mwifiex_current_bss_params curr_bss_params;
  478. u16 beacon_period;
  479. u8 dtim_period;
  480. u16 listen_interval;
  481. u16 atim_window;
  482. u8 adhoc_channel;
  483. u8 adhoc_is_link_sensed;
  484. u8 adhoc_state;
  485. struct mwifiex_802_11_security sec_info;
  486. struct mwifiex_wep_key wep_key[NUM_WEP_KEYS];
  487. u16 wep_key_curr_index;
  488. u8 wpa_ie[256];
  489. u16 wpa_ie_len;
  490. u8 wpa_is_gtk_set;
  491. struct host_cmd_ds_802_11_key_material aes_key;
  492. struct host_cmd_ds_802_11_key_material_v2 aes_key_v2;
  493. u8 wapi_ie[256];
  494. u16 wapi_ie_len;
  495. u8 *wps_ie;
  496. u16 wps_ie_len;
  497. u8 wmm_required;
  498. u8 wmm_enabled;
  499. u8 wmm_qosinfo;
  500. struct mwifiex_wmm_desc wmm;
  501. atomic_t wmm_tx_pending[IEEE80211_NUM_ACS];
  502. struct list_head sta_list;
  503. /* spin lock for associated station/TDLS peers list */
  504. spinlock_t sta_list_spinlock;
  505. struct list_head auto_tdls_list;
  506. /* spin lock for auto TDLS peer list */
  507. spinlock_t auto_tdls_lock;
  508. struct list_head tx_ba_stream_tbl_ptr;
  509. /* spin lock for tx_ba_stream_tbl_ptr queue */
  510. spinlock_t tx_ba_stream_tbl_lock;
  511. struct mwifiex_tx_aggr aggr_prio_tbl[MAX_NUM_TID];
  512. struct mwifiex_add_ba_param add_ba_param;
  513. u16 rx_seq[MAX_NUM_TID];
  514. u8 tos_to_tid_inv[MAX_NUM_TID];
  515. struct list_head rx_reorder_tbl_ptr;
  516. /* spin lock for rx_reorder_tbl_ptr queue */
  517. spinlock_t rx_reorder_tbl_lock;
  518. /* spin lock for Rx packets */
  519. spinlock_t rx_pkt_lock;
  520. #define MWIFIEX_ASSOC_RSP_BUF_SIZE 500
  521. u8 assoc_rsp_buf[MWIFIEX_ASSOC_RSP_BUF_SIZE];
  522. u32 assoc_rsp_size;
  523. #define MWIFIEX_GENIE_BUF_SIZE 256
  524. u8 gen_ie_buf[MWIFIEX_GENIE_BUF_SIZE];
  525. u8 gen_ie_buf_len;
  526. struct mwifiex_vendor_spec_cfg_ie vs_ie[MWIFIEX_MAX_VSIE_NUM];
  527. #define MWIFIEX_ASSOC_TLV_BUF_SIZE 256
  528. u8 assoc_tlv_buf[MWIFIEX_ASSOC_TLV_BUF_SIZE];
  529. u8 assoc_tlv_buf_len;
  530. u8 *curr_bcn_buf;
  531. u32 curr_bcn_size;
  532. /* spin lock for beacon buffer */
  533. spinlock_t curr_bcn_buf_lock;
  534. struct wireless_dev wdev;
  535. struct mwifiex_chan_freq_power cfp;
  536. u32 versionstrsel;
  537. char version_str[128];
  538. #ifdef CONFIG_DEBUG_FS
  539. struct dentry *dfs_dev_dir;
  540. #endif
  541. u16 current_key_index;
  542. struct semaphore async_sem;
  543. struct cfg80211_scan_request *scan_request;
  544. u8 cfg_bssid[6];
  545. struct wps wps;
  546. u8 scan_block;
  547. s32 cqm_rssi_thold;
  548. u32 cqm_rssi_hyst;
  549. u8 subsc_evt_rssi_state;
  550. struct mwifiex_ds_misc_subsc_evt async_subsc_evt_storage;
  551. struct mwifiex_ie mgmt_ie[MAX_MGMT_IE_INDEX];
  552. u16 beacon_idx;
  553. u16 proberesp_idx;
  554. u16 assocresp_idx;
  555. u16 gen_idx;
  556. u8 ap_11n_enabled;
  557. u8 ap_11ac_enabled;
  558. u32 mgmt_frame_mask;
  559. struct mwifiex_roc_cfg roc_cfg;
  560. bool scan_aborting;
  561. u8 sched_scanning;
  562. u8 csa_chan;
  563. unsigned long csa_expire_time;
  564. u8 del_list_idx;
  565. bool hs2_enabled;
  566. struct mwifiex_uap_bss_param bss_cfg;
  567. struct cfg80211_chan_def bss_chandef;
  568. struct station_parameters *sta_params;
  569. struct sk_buff_head tdls_txq;
  570. u8 check_tdls_tx;
  571. struct timer_list auto_tdls_timer;
  572. bool auto_tdls_timer_active;
  573. struct idr ack_status_frames;
  574. /* spin lock for ack status */
  575. spinlock_t ack_status_lock;
  576. /** rx histogram data */
  577. struct mwifiex_histogram_data *hist_data;
  578. struct cfg80211_chan_def dfs_chandef;
  579. struct workqueue_struct *dfs_cac_workqueue;
  580. struct delayed_work dfs_cac_work;
  581. struct timer_list dfs_chan_switch_timer;
  582. struct workqueue_struct *dfs_chan_sw_workqueue;
  583. struct delayed_work dfs_chan_sw_work;
  584. struct cfg80211_beacon_data beacon_after;
  585. struct mwifiex_11h_intf_state state_11h;
  586. struct mwifiex_ds_mem_rw mem_rw;
  587. struct sk_buff_head bypass_txq;
  588. struct mwifiex_user_scan_chan hidden_chan[MWIFIEX_USER_SCAN_CHAN_MAX];
  589. u8 assoc_resp_ht_param;
  590. bool ht_param_present;
  591. u8 random_mac[ETH_ALEN];
  592. };
  593. struct mwifiex_tx_ba_stream_tbl {
  594. struct list_head list;
  595. int tid;
  596. u8 ra[ETH_ALEN];
  597. enum mwifiex_ba_status ba_status;
  598. u8 amsdu;
  599. };
  600. struct mwifiex_rx_reorder_tbl;
  601. struct reorder_tmr_cnxt {
  602. struct timer_list timer;
  603. struct mwifiex_rx_reorder_tbl *ptr;
  604. struct mwifiex_private *priv;
  605. u8 timer_is_set;
  606. };
  607. struct mwifiex_rx_reorder_tbl {
  608. struct list_head list;
  609. int tid;
  610. u8 ta[ETH_ALEN];
  611. int init_win;
  612. int start_win;
  613. int win_size;
  614. void **rx_reorder_ptr;
  615. struct reorder_tmr_cnxt timer_context;
  616. u8 amsdu;
  617. u8 flags;
  618. };
  619. struct mwifiex_bss_prio_node {
  620. struct list_head list;
  621. struct mwifiex_private *priv;
  622. };
  623. struct mwifiex_bss_prio_tbl {
  624. struct list_head bss_prio_head;
  625. /* spin lock for bss priority */
  626. spinlock_t bss_prio_lock;
  627. struct mwifiex_bss_prio_node *bss_prio_cur;
  628. };
  629. struct cmd_ctrl_node {
  630. struct list_head list;
  631. struct mwifiex_private *priv;
  632. u32 cmd_oid;
  633. u32 cmd_flag;
  634. struct sk_buff *cmd_skb;
  635. struct sk_buff *resp_skb;
  636. void *data_buf;
  637. u32 wait_q_enabled;
  638. struct sk_buff *skb;
  639. u8 *condition;
  640. u8 cmd_wait_q_woken;
  641. };
  642. struct mwifiex_bss_priv {
  643. u8 band;
  644. u64 fw_tsf;
  645. };
  646. struct mwifiex_tdls_capab {
  647. __le16 capab;
  648. u8 rates[32];
  649. u8 rates_len;
  650. u8 qos_info;
  651. u8 coex_2040;
  652. u16 aid;
  653. struct ieee80211_ht_cap ht_capb;
  654. struct ieee80211_ht_operation ht_oper;
  655. struct ieee_types_extcap extcap;
  656. struct ieee_types_generic rsn_ie;
  657. struct ieee80211_vht_cap vhtcap;
  658. struct ieee80211_vht_operation vhtoper;
  659. };
  660. struct mwifiex_station_stats {
  661. u64 last_rx;
  662. s8 rssi;
  663. u64 rx_bytes;
  664. u64 tx_bytes;
  665. u32 rx_packets;
  666. u32 tx_packets;
  667. u32 tx_failed;
  668. u8 last_tx_rate;
  669. u8 last_tx_htinfo;
  670. };
  671. /* This is AP/TDLS specific structure which stores information
  672. * about associated/peer STA
  673. */
  674. struct mwifiex_sta_node {
  675. struct list_head list;
  676. u8 mac_addr[ETH_ALEN];
  677. u8 is_wmm_enabled;
  678. u8 is_11n_enabled;
  679. u8 is_11ac_enabled;
  680. u8 ampdu_sta[MAX_NUM_TID];
  681. u16 rx_seq[MAX_NUM_TID];
  682. u16 max_amsdu;
  683. u8 tdls_status;
  684. struct mwifiex_tdls_capab tdls_cap;
  685. struct mwifiex_station_stats stats;
  686. u8 tx_pause;
  687. };
  688. struct mwifiex_auto_tdls_peer {
  689. struct list_head list;
  690. u8 mac_addr[ETH_ALEN];
  691. u8 tdls_status;
  692. int rssi;
  693. long rssi_jiffies;
  694. u8 failure_count;
  695. u8 do_discover;
  696. u8 do_setup;
  697. };
  698. struct mwifiex_if_ops {
  699. int (*init_if) (struct mwifiex_adapter *);
  700. void (*cleanup_if) (struct mwifiex_adapter *);
  701. int (*check_fw_status) (struct mwifiex_adapter *, u32);
  702. int (*check_winner_status)(struct mwifiex_adapter *);
  703. int (*prog_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
  704. int (*register_dev) (struct mwifiex_adapter *);
  705. void (*unregister_dev) (struct mwifiex_adapter *);
  706. int (*enable_int) (struct mwifiex_adapter *);
  707. void (*disable_int) (struct mwifiex_adapter *);
  708. int (*process_int_status) (struct mwifiex_adapter *);
  709. int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *,
  710. struct mwifiex_tx_param *);
  711. int (*wakeup) (struct mwifiex_adapter *);
  712. int (*wakeup_complete) (struct mwifiex_adapter *);
  713. /* Interface specific functions */
  714. void (*update_mp_end_port) (struct mwifiex_adapter *, u16);
  715. void (*cleanup_mpa_buf) (struct mwifiex_adapter *);
  716. int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *);
  717. int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *);
  718. int (*init_fw_port) (struct mwifiex_adapter *);
  719. int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
  720. void (*card_reset) (struct mwifiex_adapter *);
  721. int (*reg_dump)(struct mwifiex_adapter *, char *);
  722. void (*device_dump)(struct mwifiex_adapter *);
  723. int (*clean_pcie_ring) (struct mwifiex_adapter *adapter);
  724. void (*iface_work)(struct work_struct *work);
  725. void (*submit_rem_rx_urbs)(struct mwifiex_adapter *adapter);
  726. void (*deaggr_pkt)(struct mwifiex_adapter *, struct sk_buff *);
  727. void (*multi_port_resync)(struct mwifiex_adapter *);
  728. bool (*is_port_ready)(struct mwifiex_private *);
  729. void (*down_dev)(struct mwifiex_adapter *);
  730. void (*up_dev)(struct mwifiex_adapter *);
  731. };
  732. struct mwifiex_adapter {
  733. u8 iface_type;
  734. unsigned int debug_mask;
  735. struct mwifiex_iface_comb iface_limit;
  736. struct mwifiex_iface_comb curr_iface_comb;
  737. struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM];
  738. u8 priv_num;
  739. const struct firmware *firmware;
  740. char fw_name[32];
  741. int winner;
  742. struct device *dev;
  743. struct wiphy *wiphy;
  744. u8 perm_addr[ETH_ALEN];
  745. bool surprise_removed;
  746. u32 fw_release_number;
  747. u16 init_wait_q_woken;
  748. wait_queue_head_t init_wait_q;
  749. void *card;
  750. struct mwifiex_if_ops if_ops;
  751. atomic_t bypass_tx_pending;
  752. atomic_t rx_pending;
  753. atomic_t tx_pending;
  754. atomic_t cmd_pending;
  755. struct workqueue_struct *workqueue;
  756. struct work_struct main_work;
  757. struct workqueue_struct *rx_workqueue;
  758. struct work_struct rx_work;
  759. struct workqueue_struct *dfs_workqueue;
  760. struct work_struct dfs_work;
  761. bool rx_work_enabled;
  762. bool rx_processing;
  763. bool delay_main_work;
  764. bool rx_locked;
  765. bool main_locked;
  766. struct mwifiex_bss_prio_tbl bss_prio_tbl[MWIFIEX_MAX_BSS_NUM];
  767. /* spin lock for init/shutdown */
  768. spinlock_t mwifiex_lock;
  769. /* spin lock for main process */
  770. spinlock_t main_proc_lock;
  771. u32 mwifiex_processing;
  772. u8 more_task_flag;
  773. u16 tx_buf_size;
  774. u16 curr_tx_buf_size;
  775. /* sdio single port rx aggregation capability */
  776. bool host_disable_sdio_rx_aggr;
  777. bool sdio_rx_aggr_enable;
  778. u16 sdio_rx_block_size;
  779. u32 ioport;
  780. enum MWIFIEX_HARDWARE_STATUS hw_status;
  781. u16 number_of_antenna;
  782. u32 fw_cap_info;
  783. /* spin lock for interrupt handling */
  784. spinlock_t int_lock;
  785. u8 int_status;
  786. u32 event_cause;
  787. struct sk_buff *event_skb;
  788. u8 upld_buf[MWIFIEX_UPLD_SIZE];
  789. u8 data_sent;
  790. u8 cmd_sent;
  791. u8 cmd_resp_received;
  792. u8 event_received;
  793. u8 data_received;
  794. u16 seq_num;
  795. struct cmd_ctrl_node *cmd_pool;
  796. struct cmd_ctrl_node *curr_cmd;
  797. /* spin lock for command */
  798. spinlock_t mwifiex_cmd_lock;
  799. u8 is_cmd_timedout;
  800. u16 last_init_cmd;
  801. struct timer_list cmd_timer;
  802. struct list_head cmd_free_q;
  803. /* spin lock for cmd_free_q */
  804. spinlock_t cmd_free_q_lock;
  805. struct list_head cmd_pending_q;
  806. /* spin lock for cmd_pending_q */
  807. spinlock_t cmd_pending_q_lock;
  808. struct list_head scan_pending_q;
  809. /* spin lock for scan_pending_q */
  810. spinlock_t scan_pending_q_lock;
  811. /* spin lock for RX processing routine */
  812. spinlock_t rx_proc_lock;
  813. struct sk_buff_head tx_data_q;
  814. atomic_t tx_queued;
  815. u32 scan_processing;
  816. u16 region_code;
  817. struct mwifiex_802_11d_domain_reg domain_reg;
  818. u16 scan_probes;
  819. u32 scan_mode;
  820. u16 specific_scan_time;
  821. u16 active_scan_time;
  822. u16 passive_scan_time;
  823. u16 scan_chan_gap_time;
  824. u8 fw_bands;
  825. u8 adhoc_start_band;
  826. u8 config_bands;
  827. struct mwifiex_chan_scan_param_set *scan_channels;
  828. u8 tx_lock_flag;
  829. struct mwifiex_sleep_params sleep_params;
  830. struct mwifiex_sleep_period sleep_period;
  831. u16 ps_mode;
  832. u32 ps_state;
  833. u8 need_to_wakeup;
  834. u16 multiple_dtim;
  835. u16 local_listen_interval;
  836. u16 null_pkt_interval;
  837. struct sk_buff *sleep_cfm;
  838. u16 bcn_miss_time_out;
  839. u16 adhoc_awake_period;
  840. u8 is_deep_sleep;
  841. u8 delay_null_pkt;
  842. u16 delay_to_ps;
  843. u16 enhanced_ps_mode;
  844. u8 pm_wakeup_card_req;
  845. u16 gen_null_pkt;
  846. u16 pps_uapsd_mode;
  847. u32 pm_wakeup_fw_try;
  848. struct timer_list wakeup_timer;
  849. u8 is_hs_configured;
  850. struct mwifiex_hs_config_param hs_cfg;
  851. u8 hs_activated;
  852. u16 hs_activate_wait_q_woken;
  853. wait_queue_head_t hs_activate_wait_q;
  854. bool is_suspended;
  855. bool hs_enabling;
  856. u8 event_body[MAX_EVENT_SIZE];
  857. u32 hw_dot_11n_dev_cap;
  858. u8 hw_dev_mcs_support;
  859. u8 user_dev_mcs_support;
  860. u8 adhoc_11n_enabled;
  861. u8 sec_chan_offset;
  862. struct mwifiex_dbg dbg;
  863. u8 arp_filter[ARP_FILTER_MAX_BUF_SIZE];
  864. u32 arp_filter_size;
  865. struct mwifiex_wait_queue cmd_wait_q;
  866. u8 scan_wait_q_woken;
  867. spinlock_t queue_lock; /* lock for tx queues */
  868. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  869. u16 max_mgmt_ie_index;
  870. const struct firmware *cal_data;
  871. struct device_node *dt_node;
  872. /* 11AC */
  873. u32 is_hw_11ac_capable;
  874. u32 hw_dot_11ac_dev_cap;
  875. u32 hw_dot_11ac_mcs_support;
  876. u32 usr_dot_11ac_dev_cap_bg;
  877. u32 usr_dot_11ac_dev_cap_a;
  878. u32 usr_dot_11ac_mcs_support;
  879. atomic_t pending_bridged_pkts;
  880. struct semaphore *card_sem;
  881. bool ext_scan;
  882. u8 fw_api_ver;
  883. u8 key_api_major_ver, key_api_minor_ver;
  884. struct memory_type_mapping *mem_type_mapping_tbl;
  885. u8 num_mem_types;
  886. void *drv_info_dump;
  887. u32 drv_info_size;
  888. bool scan_chan_gap_enabled;
  889. struct sk_buff_head rx_data_q;
  890. bool mfg_mode;
  891. struct mwifiex_chan_stats *chan_stats;
  892. u32 num_in_chan_stats;
  893. int survey_idx;
  894. bool auto_tdls;
  895. u8 coex_scan;
  896. u8 coex_min_scan_time;
  897. u8 coex_max_scan_time;
  898. u8 coex_win_size;
  899. u8 coex_tx_win_size;
  900. u8 coex_rx_win_size;
  901. bool drcs_enabled;
  902. u8 active_scan_triggered;
  903. bool usb_mc_status;
  904. bool usb_mc_setup;
  905. struct cfg80211_wowlan_nd_info *nd_info;
  906. struct ieee80211_regdomain *regd;
  907. };
  908. void mwifiex_process_tx_queue(struct mwifiex_adapter *adapter);
  909. int mwifiex_init_lock_list(struct mwifiex_adapter *adapter);
  910. void mwifiex_set_trans_start(struct net_device *dev);
  911. void mwifiex_stop_net_dev_queue(struct net_device *netdev,
  912. struct mwifiex_adapter *adapter);
  913. void mwifiex_wake_up_net_dev_queue(struct net_device *netdev,
  914. struct mwifiex_adapter *adapter);
  915. int mwifiex_init_priv(struct mwifiex_private *priv);
  916. void mwifiex_free_priv(struct mwifiex_private *priv);
  917. int mwifiex_init_fw(struct mwifiex_adapter *adapter);
  918. int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter);
  919. int mwifiex_shutdown_drv(struct mwifiex_adapter *adapter);
  920. int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter);
  921. int mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *);
  922. int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb);
  923. int mwifiex_uap_recv_packet(struct mwifiex_private *priv,
  924. struct sk_buff *skb);
  925. int mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
  926. struct sk_buff *skb);
  927. int mwifiex_process_event(struct mwifiex_adapter *adapter);
  928. int mwifiex_complete_cmd(struct mwifiex_adapter *adapter,
  929. struct cmd_ctrl_node *cmd_node);
  930. int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
  931. u16 cmd_action, u32 cmd_oid, void *data_buf, bool sync);
  932. void mwifiex_cmd_timeout_func(unsigned long function_context);
  933. int mwifiex_get_debug_info(struct mwifiex_private *,
  934. struct mwifiex_debug_info *);
  935. int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter);
  936. int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter);
  937. void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter);
  938. void mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter);
  939. void mwifiex_cancel_pending_scan_cmd(struct mwifiex_adapter *adapter);
  940. void mwifiex_cancel_scan(struct mwifiex_adapter *adapter);
  941. void mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter,
  942. struct cmd_ctrl_node *cmd_node);
  943. void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
  944. struct cmd_ctrl_node *cmd_node,
  945. u32 addtail);
  946. int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter);
  947. int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter);
  948. int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
  949. struct sk_buff *skb);
  950. int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
  951. struct mwifiex_tx_param *tx_param);
  952. int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags);
  953. int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
  954. struct sk_buff *skb, int aggr, int status);
  955. void mwifiex_clean_txrx(struct mwifiex_private *priv);
  956. u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv);
  957. void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter);
  958. void mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *, u8 *,
  959. u32);
  960. int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
  961. struct host_cmd_ds_command *cmd,
  962. u16 cmd_action, uint16_t ps_bitmap,
  963. struct mwifiex_ds_auto_ds *auto_ds);
  964. int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
  965. struct host_cmd_ds_command *resp,
  966. struct mwifiex_ds_pm_cfg *pm_cfg);
  967. void mwifiex_process_hs_config(struct mwifiex_adapter *adapter);
  968. void mwifiex_hs_activated_event(struct mwifiex_private *priv,
  969. u8 activated);
  970. int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
  971. int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg);
  972. int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv,
  973. struct host_cmd_ds_command *resp);
  974. int mwifiex_process_rx_packet(struct mwifiex_private *priv,
  975. struct sk_buff *skb);
  976. int mwifiex_sta_prepare_cmd(struct mwifiex_private *, uint16_t cmd_no,
  977. u16 cmd_action, u32 cmd_oid,
  978. void *data_buf, void *cmd_buf);
  979. int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
  980. u16 cmd_action, u32 cmd_oid,
  981. void *data_buf, void *cmd_buf);
  982. int mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no,
  983. struct host_cmd_ds_command *resp);
  984. int mwifiex_process_sta_rx_packet(struct mwifiex_private *,
  985. struct sk_buff *skb);
  986. int mwifiex_process_uap_rx_packet(struct mwifiex_private *priv,
  987. struct sk_buff *skb);
  988. int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv,
  989. struct sk_buff *skb);
  990. int mwifiex_process_sta_event(struct mwifiex_private *);
  991. int mwifiex_process_uap_event(struct mwifiex_private *);
  992. void mwifiex_delete_all_station_list(struct mwifiex_private *priv);
  993. void mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv,
  994. const u8 *ra_addr);
  995. void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb);
  996. void *mwifiex_process_uap_txpd(struct mwifiex_private *, struct sk_buff *skb);
  997. int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta, bool init);
  998. int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd,
  999. struct mwifiex_scan_cmd_config *scan_cfg);
  1000. void mwifiex_queue_scan_cmd(struct mwifiex_private *priv,
  1001. struct cmd_ctrl_node *cmd_node);
  1002. int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
  1003. struct host_cmd_ds_command *resp);
  1004. s32 mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2);
  1005. int mwifiex_associate(struct mwifiex_private *priv,
  1006. struct mwifiex_bssdescriptor *bss_desc);
  1007. int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
  1008. struct host_cmd_ds_command *cmd,
  1009. struct mwifiex_bssdescriptor *bss_desc);
  1010. int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
  1011. struct host_cmd_ds_command *resp);
  1012. void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason,
  1013. bool from_ap);
  1014. u8 mwifiex_band_to_radio_type(u8 band);
  1015. int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac);
  1016. void mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter);
  1017. int mwifiex_adhoc_start(struct mwifiex_private *priv,
  1018. struct cfg80211_ssid *adhoc_ssid);
  1019. int mwifiex_adhoc_join(struct mwifiex_private *priv,
  1020. struct mwifiex_bssdescriptor *bss_desc);
  1021. int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
  1022. struct host_cmd_ds_command *cmd,
  1023. struct cfg80211_ssid *req_ssid);
  1024. int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
  1025. struct host_cmd_ds_command *cmd,
  1026. struct mwifiex_bssdescriptor *bss_desc);
  1027. int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
  1028. struct host_cmd_ds_command *resp);
  1029. int mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command *cmd);
  1030. struct mwifiex_chan_freq_power *mwifiex_get_cfp(struct mwifiex_private *priv,
  1031. u8 band, u16 channel, u32 freq);
  1032. u32 mwifiex_index_to_data_rate(struct mwifiex_private *priv,
  1033. u8 index, u8 ht_info);
  1034. u32 mwifiex_index_to_acs_data_rate(struct mwifiex_private *priv,
  1035. u8 index, u8 ht_info);
  1036. u32 mwifiex_find_freq_from_band_chan(u8, u8);
  1037. int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv, u16 vsie_mask,
  1038. u8 **buffer);
  1039. u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv,
  1040. u8 *rates);
  1041. u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates);
  1042. u32 mwifiex_get_rates_from_cfg80211(struct mwifiex_private *priv,
  1043. u8 *rates, u8 radio_type);
  1044. u8 mwifiex_is_rate_auto(struct mwifiex_private *priv);
  1045. extern u16 region_code_index[MWIFIEX_MAX_REGION_CODE];
  1046. void mwifiex_save_curr_bcn(struct mwifiex_private *priv);
  1047. void mwifiex_free_curr_bcn(struct mwifiex_private *priv);
  1048. int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv,
  1049. struct host_cmd_ds_command *cmd);
  1050. int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
  1051. struct host_cmd_ds_command *resp);
  1052. int is_command_pending(struct mwifiex_adapter *adapter);
  1053. void mwifiex_init_priv_params(struct mwifiex_private *priv,
  1054. struct net_device *dev);
  1055. int mwifiex_set_secure_params(struct mwifiex_private *priv,
  1056. struct mwifiex_uap_bss_param *bss_config,
  1057. struct cfg80211_ap_settings *params);
  1058. void mwifiex_set_ht_params(struct mwifiex_private *priv,
  1059. struct mwifiex_uap_bss_param *bss_cfg,
  1060. struct cfg80211_ap_settings *params);
  1061. void mwifiex_set_vht_params(struct mwifiex_private *priv,
  1062. struct mwifiex_uap_bss_param *bss_cfg,
  1063. struct cfg80211_ap_settings *params);
  1064. void mwifiex_set_tpc_params(struct mwifiex_private *priv,
  1065. struct mwifiex_uap_bss_param *bss_cfg,
  1066. struct cfg80211_ap_settings *params);
  1067. void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg,
  1068. struct cfg80211_ap_settings *params);
  1069. void mwifiex_set_vht_width(struct mwifiex_private *priv,
  1070. enum nl80211_chan_width width,
  1071. bool ap_11ac_disable);
  1072. void
  1073. mwifiex_set_wmm_params(struct mwifiex_private *priv,
  1074. struct mwifiex_uap_bss_param *bss_cfg,
  1075. struct cfg80211_ap_settings *params);
  1076. void mwifiex_set_ba_params(struct mwifiex_private *priv);
  1077. void mwifiex_update_ampdu_txwinsize(struct mwifiex_adapter *pmadapter);
  1078. void mwifiex_bt_coex_wlan_param_update_event(struct mwifiex_private *priv,
  1079. struct sk_buff *event_skb);
  1080. void mwifiex_set_11ac_ba_params(struct mwifiex_private *priv);
  1081. int mwifiex_cmd_802_11_scan_ext(struct mwifiex_private *priv,
  1082. struct host_cmd_ds_command *cmd,
  1083. void *data_buf);
  1084. int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv,
  1085. struct host_cmd_ds_command *resp);
  1086. int mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv,
  1087. void *buf);
  1088. int mwifiex_cmd_802_11_bg_scan_config(struct mwifiex_private *priv,
  1089. struct host_cmd_ds_command *cmd,
  1090. void *data_buf);
  1091. int mwifiex_stop_bg_scan(struct mwifiex_private *priv);
  1092. /*
  1093. * This function checks if the queuing is RA based or not.
  1094. */
  1095. static inline u8
  1096. mwifiex_queuing_ra_based(struct mwifiex_private *priv)
  1097. {
  1098. /*
  1099. * Currently we assume if we are in Infra, then DA=RA. This might not be
  1100. * true in the future
  1101. */
  1102. if ((priv->bss_mode == NL80211_IFTYPE_STATION) &&
  1103. (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA))
  1104. return false;
  1105. return true;
  1106. }
  1107. /*
  1108. * This function copies rates.
  1109. */
  1110. static inline u32
  1111. mwifiex_copy_rates(u8 *dest, u32 pos, u8 *src, int len)
  1112. {
  1113. int i;
  1114. for (i = 0; i < len && src[i]; i++, pos++) {
  1115. if (pos >= MWIFIEX_SUPPORTED_RATES)
  1116. break;
  1117. dest[pos] = src[i];
  1118. }
  1119. return pos;
  1120. }
  1121. /*
  1122. * This function returns the correct private structure pointer based
  1123. * upon the BSS type and BSS number.
  1124. */
  1125. static inline struct mwifiex_private *
  1126. mwifiex_get_priv_by_id(struct mwifiex_adapter *adapter,
  1127. u8 bss_num, u8 bss_type)
  1128. {
  1129. int i;
  1130. for (i = 0; i < adapter->priv_num; i++) {
  1131. if (adapter->priv[i]) {
  1132. if ((adapter->priv[i]->bss_num == bss_num) &&
  1133. (adapter->priv[i]->bss_type == bss_type))
  1134. break;
  1135. }
  1136. }
  1137. return ((i < adapter->priv_num) ? adapter->priv[i] : NULL);
  1138. }
  1139. /*
  1140. * This function returns the first available private structure pointer
  1141. * based upon the BSS role.
  1142. */
  1143. static inline struct mwifiex_private *
  1144. mwifiex_get_priv(struct mwifiex_adapter *adapter,
  1145. enum mwifiex_bss_role bss_role)
  1146. {
  1147. int i;
  1148. for (i = 0; i < adapter->priv_num; i++) {
  1149. if (adapter->priv[i]) {
  1150. if (bss_role == MWIFIEX_BSS_ROLE_ANY ||
  1151. GET_BSS_ROLE(adapter->priv[i]) == bss_role)
  1152. break;
  1153. }
  1154. }
  1155. return ((i < adapter->priv_num) ? adapter->priv[i] : NULL);
  1156. }
  1157. /*
  1158. * This function checks available bss_num when adding new interface or
  1159. * changing interface type.
  1160. */
  1161. static inline u8
  1162. mwifiex_get_unused_bss_num(struct mwifiex_adapter *adapter, u8 bss_type)
  1163. {
  1164. u8 i, j;
  1165. int index[MWIFIEX_MAX_BSS_NUM];
  1166. memset(index, 0, sizeof(index));
  1167. for (i = 0; i < adapter->priv_num; i++)
  1168. if (adapter->priv[i]) {
  1169. if (adapter->priv[i]->bss_type == bss_type &&
  1170. !(adapter->priv[i]->bss_mode ==
  1171. NL80211_IFTYPE_UNSPECIFIED)) {
  1172. index[adapter->priv[i]->bss_num] = 1;
  1173. }
  1174. }
  1175. for (j = 0; j < MWIFIEX_MAX_BSS_NUM; j++)
  1176. if (!index[j])
  1177. return j;
  1178. return -1;
  1179. }
  1180. /*
  1181. * This function returns the first available unused private structure pointer.
  1182. */
  1183. static inline struct mwifiex_private *
  1184. mwifiex_get_unused_priv_by_bss_type(struct mwifiex_adapter *adapter,
  1185. u8 bss_type)
  1186. {
  1187. u8 i;
  1188. for (i = 0; i < adapter->priv_num; i++)
  1189. if (adapter->priv[i]->bss_mode ==
  1190. NL80211_IFTYPE_UNSPECIFIED) {
  1191. adapter->priv[i]->bss_num =
  1192. mwifiex_get_unused_bss_num(adapter, bss_type);
  1193. break;
  1194. }
  1195. return ((i < adapter->priv_num) ? adapter->priv[i] : NULL);
  1196. }
  1197. /*
  1198. * This function returns the driver private structure of a network device.
  1199. */
  1200. static inline struct mwifiex_private *
  1201. mwifiex_netdev_get_priv(struct net_device *dev)
  1202. {
  1203. return (struct mwifiex_private *) (*(unsigned long *) netdev_priv(dev));
  1204. }
  1205. /*
  1206. * This function checks if a skb holds a management frame.
  1207. */
  1208. static inline bool mwifiex_is_skb_mgmt_frame(struct sk_buff *skb)
  1209. {
  1210. return (le32_to_cpu(*(__le32 *)skb->data) == PKT_TYPE_MGMT);
  1211. }
  1212. /* This function retrieves channel closed for operation by Channel
  1213. * Switch Announcement.
  1214. */
  1215. static inline u8
  1216. mwifiex_11h_get_csa_closed_channel(struct mwifiex_private *priv)
  1217. {
  1218. if (!priv->csa_chan)
  1219. return 0;
  1220. /* Clear csa channel, if DFS channel move time has passed */
  1221. if (time_after(jiffies, priv->csa_expire_time)) {
  1222. priv->csa_chan = 0;
  1223. priv->csa_expire_time = 0;
  1224. }
  1225. return priv->csa_chan;
  1226. }
  1227. static inline u8 mwifiex_is_any_intf_active(struct mwifiex_private *priv)
  1228. {
  1229. struct mwifiex_private *priv_num;
  1230. int i;
  1231. for (i = 0; i < priv->adapter->priv_num; i++) {
  1232. priv_num = priv->adapter->priv[i];
  1233. if (priv_num) {
  1234. if ((GET_BSS_ROLE(priv_num) == MWIFIEX_BSS_ROLE_UAP &&
  1235. priv_num->bss_started) ||
  1236. (GET_BSS_ROLE(priv_num) == MWIFIEX_BSS_ROLE_STA &&
  1237. priv_num->media_connected))
  1238. return 1;
  1239. }
  1240. }
  1241. return 0;
  1242. }
  1243. static inline u8 mwifiex_is_tdls_link_setup(u8 status)
  1244. {
  1245. switch (status) {
  1246. case TDLS_SETUP_COMPLETE:
  1247. case TDLS_CHAN_SWITCHING:
  1248. case TDLS_IN_BASE_CHAN:
  1249. case TDLS_IN_OFF_CHAN:
  1250. return true;
  1251. default:
  1252. break;
  1253. }
  1254. return false;
  1255. }
  1256. int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
  1257. u32 func_init_shutdown);
  1258. int mwifiex_add_card(void *, struct semaphore *, struct mwifiex_if_ops *, u8);
  1259. int mwifiex_remove_card(struct mwifiex_adapter *, struct semaphore *);
  1260. void mwifiex_get_version(struct mwifiex_adapter *adapter, char *version,
  1261. int maxlen);
  1262. int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
  1263. struct mwifiex_multicast_list *mcast_list);
  1264. int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
  1265. struct net_device *dev);
  1266. int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter,
  1267. struct cmd_ctrl_node *cmd_queued);
  1268. int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
  1269. struct cfg80211_ssid *req_ssid);
  1270. int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type);
  1271. int mwifiex_enable_hs(struct mwifiex_adapter *adapter);
  1272. int mwifiex_disable_auto_ds(struct mwifiex_private *priv);
  1273. int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, u32 *rate);
  1274. int mwifiex_request_scan(struct mwifiex_private *priv,
  1275. struct cfg80211_ssid *req_ssid);
  1276. int mwifiex_scan_networks(struct mwifiex_private *priv,
  1277. const struct mwifiex_user_scan_cfg *user_scan_in);
  1278. int mwifiex_set_radio(struct mwifiex_private *priv, u8 option);
  1279. int mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp,
  1280. const u8 *key, int key_len, u8 key_index,
  1281. const u8 *mac_addr, int disable);
  1282. int mwifiex_set_gen_ie(struct mwifiex_private *priv, const u8 *ie, int ie_len);
  1283. int mwifiex_get_ver_ext(struct mwifiex_private *priv, u32 version_str_sel);
  1284. int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
  1285. struct ieee80211_channel *chan,
  1286. unsigned int duration);
  1287. int mwifiex_get_stats_info(struct mwifiex_private *priv,
  1288. struct mwifiex_ds_get_stats *log);
  1289. int mwifiex_reg_write(struct mwifiex_private *priv, u32 reg_type,
  1290. u32 reg_offset, u32 reg_value);
  1291. int mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type,
  1292. u32 reg_offset, u32 *value);
  1293. int mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes,
  1294. u8 *value);
  1295. int mwifiex_set_11n_httx_cfg(struct mwifiex_private *priv, int data);
  1296. int mwifiex_get_11n_httx_cfg(struct mwifiex_private *priv, int *data);
  1297. int mwifiex_set_tx_rate_cfg(struct mwifiex_private *priv, int tx_rate_index);
  1298. int mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_index);
  1299. int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode);
  1300. int mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter,
  1301. char *version, int max_len);
  1302. int mwifiex_set_tx_power(struct mwifiex_private *priv,
  1303. struct mwifiex_power_cfg *power_cfg);
  1304. int mwifiex_main_process(struct mwifiex_adapter *);
  1305. int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb);
  1306. int mwifiex_get_bss_info(struct mwifiex_private *,
  1307. struct mwifiex_bss_info *);
  1308. int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
  1309. struct cfg80211_bss *bss,
  1310. struct mwifiex_bssdescriptor *bss_desc);
  1311. int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
  1312. struct mwifiex_bssdescriptor *bss_entry);
  1313. int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
  1314. struct mwifiex_bssdescriptor *bss_desc);
  1315. u8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type);
  1316. u8 mwifiex_sec_chan_offset_to_chan_type(u8 second_chan_offset);
  1317. struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
  1318. const char *name,
  1319. unsigned char name_assign_type,
  1320. enum nl80211_iftype type,
  1321. u32 *flags,
  1322. struct vif_params *params);
  1323. int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev);
  1324. void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config);
  1325. int mwifiex_add_wowlan_magic_pkt_filter(struct mwifiex_adapter *adapter);
  1326. int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
  1327. struct cfg80211_beacon_data *data);
  1328. int mwifiex_del_mgmt_ies(struct mwifiex_private *priv);
  1329. u8 *mwifiex_11d_code_2_region(u8 code);
  1330. void mwifiex_uap_set_channel(struct mwifiex_private *priv,
  1331. struct mwifiex_uap_bss_param *bss_cfg,
  1332. struct cfg80211_chan_def chandef);
  1333. int mwifiex_config_start_uap(struct mwifiex_private *priv,
  1334. struct mwifiex_uap_bss_param *bss_cfg);
  1335. void mwifiex_uap_del_sta_data(struct mwifiex_private *priv,
  1336. struct mwifiex_sta_node *node);
  1337. void mwifiex_init_11h_params(struct mwifiex_private *priv);
  1338. int mwifiex_is_11h_active(struct mwifiex_private *priv);
  1339. int mwifiex_11h_activate(struct mwifiex_private *priv, bool flag);
  1340. void mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer,
  1341. struct mwifiex_bssdescriptor *bss_desc);
  1342. int mwifiex_11h_handle_event_chanswann(struct mwifiex_private *priv);
  1343. int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv,
  1344. struct device_node *node, const char *prefix);
  1345. void mwifiex_dnld_txpwr_table(struct mwifiex_private *priv);
  1346. extern const struct ethtool_ops mwifiex_ethtool_ops;
  1347. void mwifiex_del_all_sta_list(struct mwifiex_private *priv);
  1348. void mwifiex_del_sta_entry(struct mwifiex_private *priv, const u8 *mac);
  1349. void
  1350. mwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies,
  1351. int ies_len, struct mwifiex_sta_node *node);
  1352. struct mwifiex_sta_node *
  1353. mwifiex_add_sta_entry(struct mwifiex_private *priv, const u8 *mac);
  1354. struct mwifiex_sta_node *
  1355. mwifiex_get_sta_entry(struct mwifiex_private *priv, const u8 *mac);
  1356. u8 mwifiex_is_tdls_chan_switching(struct mwifiex_private *priv);
  1357. u8 mwifiex_is_tdls_off_chan(struct mwifiex_private *priv);
  1358. u8 mwifiex_is_send_cmd_allowed(struct mwifiex_private *priv);
  1359. int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer,
  1360. u8 action_code, u8 dialog_token,
  1361. u16 status_code, const u8 *extra_ies,
  1362. size_t extra_ies_len);
  1363. int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer,
  1364. u8 action_code, u8 dialog_token,
  1365. u16 status_code, const u8 *extra_ies,
  1366. size_t extra_ies_len);
  1367. void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv,
  1368. u8 *buf, int len);
  1369. int mwifiex_tdls_oper(struct mwifiex_private *priv, const u8 *peer, u8 action);
  1370. int mwifiex_get_tdls_link_status(struct mwifiex_private *priv, const u8 *mac);
  1371. int mwifiex_get_tdls_list(struct mwifiex_private *priv,
  1372. struct tdls_peer_info *buf);
  1373. void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv);
  1374. bool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private *priv);
  1375. u8 mwifiex_get_center_freq_index(struct mwifiex_private *priv, u8 band,
  1376. u32 pri_chan, u8 chan_bw);
  1377. int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter);
  1378. int mwifiex_tdls_check_tx(struct mwifiex_private *priv, struct sk_buff *skb);
  1379. void mwifiex_flush_auto_tdls_list(struct mwifiex_private *priv);
  1380. void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv,
  1381. const u8 *mac, u8 link_status);
  1382. void mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private *priv,
  1383. u8 *mac, s8 snr, s8 nflr);
  1384. void mwifiex_check_auto_tdls(unsigned long context);
  1385. void mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv, const u8 *mac);
  1386. void mwifiex_setup_auto_tdls_timer(struct mwifiex_private *priv);
  1387. void mwifiex_clean_auto_tdls(struct mwifiex_private *priv);
  1388. int mwifiex_config_tdls_enable(struct mwifiex_private *priv);
  1389. int mwifiex_config_tdls_disable(struct mwifiex_private *priv);
  1390. int mwifiex_config_tdls_cs_params(struct mwifiex_private *priv);
  1391. int mwifiex_stop_tdls_cs(struct mwifiex_private *priv, const u8 *peer_mac);
  1392. int mwifiex_start_tdls_cs(struct mwifiex_private *priv, const u8 *peer_mac,
  1393. u8 primary_chan, u8 second_chan_offset, u8 band);
  1394. int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv,
  1395. struct host_cmd_ds_command *cmd,
  1396. void *data_buf);
  1397. int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv,
  1398. struct sk_buff *skb);
  1399. void mwifiex_parse_tx_status_event(struct mwifiex_private *priv,
  1400. void *event_body);
  1401. struct sk_buff *
  1402. mwifiex_clone_skb_for_tx_status(struct mwifiex_private *priv,
  1403. struct sk_buff *skb, u8 flag, u64 *cookie);
  1404. void mwifiex_dfs_cac_work_queue(struct work_struct *work);
  1405. void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work);
  1406. void mwifiex_abort_cac(struct mwifiex_private *priv);
  1407. int mwifiex_stop_radar_detection(struct mwifiex_private *priv,
  1408. struct cfg80211_chan_def *chandef);
  1409. int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv,
  1410. struct sk_buff *skb);
  1411. void mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr,
  1412. s8 nflr);
  1413. void mwifiex_hist_data_reset(struct mwifiex_private *priv);
  1414. void mwifiex_hist_data_add(struct mwifiex_private *priv,
  1415. u8 rx_rate, s8 snr, s8 nflr);
  1416. u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv,
  1417. u8 rx_rate, u8 ht_info);
  1418. void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter);
  1419. void mwifiex_upload_device_dump(struct mwifiex_adapter *adapter);
  1420. void *mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags);
  1421. void mwifiex_queue_main_work(struct mwifiex_adapter *adapter);
  1422. int mwifiex_get_wakeup_reason(struct mwifiex_private *priv, u16 action,
  1423. int cmd_type,
  1424. struct mwifiex_ds_wakeup_reason *wakeup_reason);
  1425. int mwifiex_ret_wakeup_reason(struct mwifiex_private *priv,
  1426. struct host_cmd_ds_command *resp,
  1427. struct host_cmd_ds_wakeup_reason *wakeup_reason);
  1428. void mwifiex_coex_ampdu_rxwinsize(struct mwifiex_adapter *adapter);
  1429. void mwifiex_11n_delba(struct mwifiex_private *priv, int tid);
  1430. int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy);
  1431. void mwifiex_process_tx_pause_event(struct mwifiex_private *priv,
  1432. struct sk_buff *event);
  1433. void mwifiex_process_multi_chan_event(struct mwifiex_private *priv,
  1434. struct sk_buff *event_skb);
  1435. void mwifiex_multi_chan_resync(struct mwifiex_adapter *adapter);
  1436. #ifdef CONFIG_DEBUG_FS
  1437. void mwifiex_debugfs_init(void);
  1438. void mwifiex_debugfs_remove(void);
  1439. void mwifiex_dev_debugfs_init(struct mwifiex_private *priv);
  1440. void mwifiex_dev_debugfs_remove(struct mwifiex_private *priv);
  1441. #endif
  1442. void mwifiex_do_flr(struct mwifiex_adapter *adapter, bool prepare);
  1443. #endif /* !_MWIFIEX_MAIN_H_ */