main.h 46 KB

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