main.h 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579
  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. struct mwifiex_adapter;
  47. struct mwifiex_private;
  48. enum {
  49. MWIFIEX_ASYNC_CMD,
  50. MWIFIEX_SYNC_CMD
  51. };
  52. #define MWIFIEX_DRIVER_MODE_STA BIT(0)
  53. #define MWIFIEX_DRIVER_MODE_UAP BIT(1)
  54. #define MWIFIEX_DRIVER_MODE_P2P BIT(2)
  55. #define MWIFIEX_DRIVER_MODE_BITMASK (BIT(0) | BIT(1) | BIT(2))
  56. #define MWIFIEX_MAX_AP 64
  57. #define MWIFIEX_MAX_PKTS_TXQ 16
  58. #define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ)
  59. #define MWIFIEX_TIMER_10S 10000
  60. #define MWIFIEX_TIMER_1S 1000
  61. #define MAX_TX_PENDING 100
  62. #define LOW_TX_PENDING 80
  63. #define HIGH_RX_PENDING 50
  64. #define LOW_RX_PENDING 20
  65. #define MWIFIEX_UPLD_SIZE (2312)
  66. #define MAX_EVENT_SIZE 2048
  67. #define ARP_FILTER_MAX_BUF_SIZE 68
  68. #define MWIFIEX_KEY_BUFFER_SIZE 16
  69. #define MWIFIEX_DEFAULT_LISTEN_INTERVAL 10
  70. #define MWIFIEX_MAX_REGION_CODE 7
  71. #define DEFAULT_BCN_AVG_FACTOR 8
  72. #define DEFAULT_DATA_AVG_FACTOR 8
  73. #define FIRST_VALID_CHANNEL 0xff
  74. #define DEFAULT_AD_HOC_CHANNEL 6
  75. #define DEFAULT_AD_HOC_CHANNEL_A 36
  76. #define DEFAULT_BCN_MISS_TIMEOUT 5
  77. #define MAX_SCAN_BEACON_BUFFER 8000
  78. #define SCAN_BEACON_ENTRY_PAD 6
  79. #define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 110
  80. #define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 30
  81. #define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME 30
  82. #define MWIFIEX_DEF_SCAN_CHAN_GAP_TIME 50
  83. #define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI)))
  84. #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S)
  85. #define RSN_GTK_OUI_OFFSET 2
  86. #define MWIFIEX_OUI_NOT_PRESENT 0
  87. #define MWIFIEX_OUI_PRESENT 1
  88. #define PKT_TYPE_MGMT 0xE5
  89. /*
  90. * Do not check for data_received for USB, as data_received
  91. * is handled in mwifiex_usb_recv for USB
  92. */
  93. #define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \
  94. adapter->event_received || \
  95. adapter->data_received)
  96. #define MWIFIEX_TYPE_CMD 1
  97. #define MWIFIEX_TYPE_DATA 0
  98. #define MWIFIEX_TYPE_AGGR_DATA 10
  99. #define MWIFIEX_TYPE_EVENT 3
  100. #define MAX_BITMAP_RATES_SIZE 18
  101. #define MAX_CHANNEL_BAND_BG 14
  102. #define MAX_CHANNEL_BAND_A 165
  103. #define MAX_FREQUENCY_BAND_BG 2484
  104. #define MWIFIEX_EVENT_HEADER_LEN 4
  105. #define MWIFIEX_UAP_EVENT_EXTRA_HEADER 2
  106. #define MWIFIEX_TYPE_LEN 4
  107. #define MWIFIEX_USB_TYPE_CMD 0xF00DFACE
  108. #define MWIFIEX_USB_TYPE_DATA 0xBEADC0DE
  109. #define MWIFIEX_USB_TYPE_EVENT 0xBEEFFACE
  110. /* Threshold for tx_timeout_cnt before we trigger a card reset */
  111. #define TX_TIMEOUT_THRESHOLD 6
  112. #define MWIFIEX_DRV_INFO_SIZE_MAX 0x40000
  113. /* Address alignment */
  114. #define MWIFIEX_ALIGN_ADDR(p, a) (((long)(p) + (a) - 1) & ~((a) - 1))
  115. /**
  116. *enum mwifiex_debug_level - marvell wifi debug level
  117. */
  118. enum MWIFIEX_DEBUG_LEVEL {
  119. MWIFIEX_DBG_MSG = 0x00000001,
  120. MWIFIEX_DBG_FATAL = 0x00000002,
  121. MWIFIEX_DBG_ERROR = 0x00000004,
  122. MWIFIEX_DBG_DATA = 0x00000008,
  123. MWIFIEX_DBG_CMD = 0x00000010,
  124. MWIFIEX_DBG_EVENT = 0x00000020,
  125. MWIFIEX_DBG_INTR = 0x00000040,
  126. MWIFIEX_DBG_IOCTL = 0x00000080,
  127. MWIFIEX_DBG_MPA_D = 0x00008000,
  128. MWIFIEX_DBG_DAT_D = 0x00010000,
  129. MWIFIEX_DBG_CMD_D = 0x00020000,
  130. MWIFIEX_DBG_EVT_D = 0x00040000,
  131. MWIFIEX_DBG_FW_D = 0x00080000,
  132. MWIFIEX_DBG_IF_D = 0x00100000,
  133. MWIFIEX_DBG_ENTRY = 0x10000000,
  134. MWIFIEX_DBG_WARN = 0x20000000,
  135. MWIFIEX_DBG_INFO = 0x40000000,
  136. MWIFIEX_DBG_DUMP = 0x80000000,
  137. MWIFIEX_DBG_ANY = 0xffffffff
  138. };
  139. #define MWIFIEX_DEFAULT_DEBUG_MASK (MWIFIEX_DBG_MSG | \
  140. MWIFIEX_DBG_FATAL | \
  141. MWIFIEX_DBG_ERROR)
  142. __printf(3, 4)
  143. void _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask,
  144. const char *fmt, ...);
  145. #define mwifiex_dbg(adapter, mask, fmt, ...) \
  146. _mwifiex_dbg(adapter, MWIFIEX_DBG_##mask, fmt, ##__VA_ARGS__)
  147. #define DEBUG_DUMP_DATA_MAX_LEN 128
  148. #define mwifiex_dbg_dump(adapter, dbg_mask, str, buf, len) \
  149. do { \
  150. if ((adapter)->debug_mask & MWIFIEX_DBG_##dbg_mask) \
  151. print_hex_dump(KERN_DEBUG, str, \
  152. DUMP_PREFIX_OFFSET, 16, 1, \
  153. buf, len, false); \
  154. } while (0)
  155. struct mwifiex_dbg {
  156. u32 num_cmd_host_to_card_failure;
  157. u32 num_cmd_sleep_cfm_host_to_card_failure;
  158. u32 num_tx_host_to_card_failure;
  159. u32 num_event_deauth;
  160. u32 num_event_disassoc;
  161. u32 num_event_link_lost;
  162. u32 num_cmd_deauth;
  163. u32 num_cmd_assoc_success;
  164. u32 num_cmd_assoc_failure;
  165. u32 num_tx_timeout;
  166. u16 timeout_cmd_id;
  167. u16 timeout_cmd_act;
  168. u16 last_cmd_id[DBG_CMD_NUM];
  169. u16 last_cmd_act[DBG_CMD_NUM];
  170. u16 last_cmd_index;
  171. u16 last_cmd_resp_id[DBG_CMD_NUM];
  172. u16 last_cmd_resp_index;
  173. u16 last_event[DBG_CMD_NUM];
  174. u16 last_event_index;
  175. };
  176. enum MWIFIEX_HARDWARE_STATUS {
  177. MWIFIEX_HW_STATUS_READY,
  178. MWIFIEX_HW_STATUS_INITIALIZING,
  179. MWIFIEX_HW_STATUS_INIT_DONE,
  180. MWIFIEX_HW_STATUS_RESET,
  181. MWIFIEX_HW_STATUS_CLOSING,
  182. MWIFIEX_HW_STATUS_NOT_READY
  183. };
  184. enum MWIFIEX_802_11_POWER_MODE {
  185. MWIFIEX_802_11_POWER_MODE_CAM,
  186. MWIFIEX_802_11_POWER_MODE_PSP
  187. };
  188. struct mwifiex_tx_param {
  189. u32 next_pkt_len;
  190. };
  191. enum MWIFIEX_PS_STATE {
  192. PS_STATE_AWAKE,
  193. PS_STATE_PRE_SLEEP,
  194. PS_STATE_SLEEP_CFM,
  195. PS_STATE_SLEEP
  196. };
  197. enum mwifiex_iface_type {
  198. MWIFIEX_SDIO,
  199. MWIFIEX_PCIE,
  200. MWIFIEX_USB
  201. };
  202. struct mwifiex_add_ba_param {
  203. u32 tx_win_size;
  204. u32 rx_win_size;
  205. u32 timeout;
  206. u8 tx_amsdu;
  207. u8 rx_amsdu;
  208. };
  209. struct mwifiex_tx_aggr {
  210. u8 ampdu_user;
  211. u8 ampdu_ap;
  212. u8 amsdu;
  213. };
  214. enum mwifiex_ba_status {
  215. BA_SETUP_NONE = 0,
  216. BA_SETUP_INPROGRESS,
  217. BA_SETUP_COMPLETE
  218. };
  219. struct mwifiex_ra_list_tbl {
  220. struct list_head list;
  221. struct sk_buff_head skb_head;
  222. u8 ra[ETH_ALEN];
  223. u32 is_11n_enabled;
  224. u16 max_amsdu;
  225. u16 ba_pkt_count;
  226. u8 ba_packet_thr;
  227. enum mwifiex_ba_status ba_status;
  228. u8 amsdu_in_ampdu;
  229. u16 total_pkt_count;
  230. bool tdls_link;
  231. bool tx_paused;
  232. };
  233. struct mwifiex_tid_tbl {
  234. struct list_head ra_list;
  235. };
  236. #define WMM_HIGHEST_PRIORITY 7
  237. #define HIGH_PRIO_TID 7
  238. #define LOW_PRIO_TID 0
  239. struct mwifiex_wmm_desc {
  240. struct mwifiex_tid_tbl tid_tbl_ptr[MAX_NUM_TID];
  241. u32 packets_out[MAX_NUM_TID];
  242. u32 pkts_paused[MAX_NUM_TID];
  243. /* spin lock to protect ra_list */
  244. spinlock_t ra_list_spinlock;
  245. struct mwifiex_wmm_ac_status ac_status[IEEE80211_NUM_ACS];
  246. enum mwifiex_wmm_ac_e ac_down_graded_vals[IEEE80211_NUM_ACS];
  247. u32 drv_pkt_delay_max;
  248. u8 queue_priority[IEEE80211_NUM_ACS];
  249. u32 user_pri_pkt_tx_ctrl[WMM_HIGHEST_PRIORITY + 1]; /* UP: 0 to 7 */
  250. /* Number of transmit packets queued */
  251. atomic_t tx_pkts_queued;
  252. /* Tracks highest priority with a packet queued */
  253. atomic_t highest_queued_prio;
  254. };
  255. struct mwifiex_802_11_security {
  256. u8 wpa_enabled;
  257. u8 wpa2_enabled;
  258. u8 wapi_enabled;
  259. u8 wapi_key_on;
  260. u8 wep_enabled;
  261. u32 authentication_mode;
  262. u8 is_authtype_auto;
  263. u32 encryption_mode;
  264. };
  265. struct ieee_types_header {
  266. u8 element_id;
  267. u8 len;
  268. } __packed;
  269. struct ieee_types_vendor_specific {
  270. struct ieee_types_vendor_header vend_hdr;
  271. u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)];
  272. } __packed;
  273. struct ieee_types_generic {
  274. struct ieee_types_header ieee_hdr;
  275. u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_header)];
  276. } __packed;
  277. struct ieee_types_bss_co_2040 {
  278. struct ieee_types_header ieee_hdr;
  279. u8 bss_2040co;
  280. } __packed;
  281. struct ieee_types_extcap {
  282. struct ieee_types_header ieee_hdr;
  283. u8 ext_capab[8];
  284. } __packed;
  285. struct ieee_types_vht_cap {
  286. struct ieee_types_header ieee_hdr;
  287. struct ieee80211_vht_cap vhtcap;
  288. } __packed;
  289. struct ieee_types_vht_oper {
  290. struct ieee_types_header ieee_hdr;
  291. struct ieee80211_vht_operation vhtoper;
  292. } __packed;
  293. struct ieee_types_aid {
  294. struct ieee_types_header ieee_hdr;
  295. u16 aid;
  296. } __packed;
  297. struct mwifiex_bssdescriptor {
  298. u8 mac_address[ETH_ALEN];
  299. struct cfg80211_ssid ssid;
  300. u32 privacy;
  301. s32 rssi;
  302. u32 channel;
  303. u32 freq;
  304. u16 beacon_period;
  305. u8 erp_flags;
  306. u32 bss_mode;
  307. u8 supported_rates[MWIFIEX_SUPPORTED_RATES];
  308. u8 data_rates[MWIFIEX_SUPPORTED_RATES];
  309. /* Network band.
  310. * BAND_B(0x01): 'b' band
  311. * BAND_G(0x02): 'g' band
  312. * BAND_A(0X04): 'a' band
  313. */
  314. u16 bss_band;
  315. u64 fw_tsf;
  316. u64 timestamp;
  317. union ieee_types_phy_param_set phy_param_set;
  318. union ieee_types_ss_param_set ss_param_set;
  319. u16 cap_info_bitmap;
  320. struct ieee_types_wmm_parameter wmm_ie;
  321. u8 disable_11n;
  322. struct ieee80211_ht_cap *bcn_ht_cap;
  323. u16 ht_cap_offset;
  324. struct ieee80211_ht_operation *bcn_ht_oper;
  325. u16 ht_info_offset;
  326. u8 *bcn_bss_co_2040;
  327. u16 bss_co_2040_offset;
  328. u8 *bcn_ext_cap;
  329. u16 ext_cap_offset;
  330. struct ieee80211_vht_cap *bcn_vht_cap;
  331. u16 vht_cap_offset;
  332. struct ieee80211_vht_operation *bcn_vht_oper;
  333. u16 vht_info_offset;
  334. struct ieee_types_oper_mode_ntf *oper_mode;
  335. u16 oper_mode_offset;
  336. u8 disable_11ac;
  337. struct ieee_types_vendor_specific *bcn_wpa_ie;
  338. u16 wpa_offset;
  339. struct ieee_types_generic *bcn_rsn_ie;
  340. u16 rsn_offset;
  341. struct ieee_types_generic *bcn_wapi_ie;
  342. u16 wapi_offset;
  343. u8 *beacon_buf;
  344. u32 beacon_buf_size;
  345. u8 sensed_11h;
  346. u8 local_constraint;
  347. u8 chan_sw_ie_present;
  348. };
  349. struct mwifiex_current_bss_params {
  350. struct mwifiex_bssdescriptor bss_descriptor;
  351. u8 wmm_enabled;
  352. u8 wmm_uapsd_enabled;
  353. u8 band;
  354. u32 num_of_rates;
  355. u8 data_rates[MWIFIEX_SUPPORTED_RATES];
  356. };
  357. struct mwifiex_sleep_params {
  358. u16 sp_error;
  359. u16 sp_offset;
  360. u16 sp_stable_time;
  361. u8 sp_cal_control;
  362. u8 sp_ext_sleep_clk;
  363. u16 sp_reserved;
  364. };
  365. struct mwifiex_sleep_period {
  366. u16 period;
  367. u16 reserved;
  368. };
  369. struct mwifiex_wep_key {
  370. u32 length;
  371. u32 key_index;
  372. u32 key_length;
  373. u8 key_material[MWIFIEX_KEY_BUFFER_SIZE];
  374. };
  375. #define MAX_REGION_CHANNEL_NUM 2
  376. struct mwifiex_chan_freq_power {
  377. u16 channel;
  378. u32 freq;
  379. u16 max_tx_power;
  380. u8 unsupported;
  381. };
  382. enum state_11d_t {
  383. DISABLE_11D = 0,
  384. ENABLE_11D = 1,
  385. };
  386. #define MWIFIEX_MAX_TRIPLET_802_11D 83
  387. struct mwifiex_802_11d_domain_reg {
  388. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  389. u8 no_of_triplet;
  390. struct ieee80211_country_ie_triplet
  391. triplet[MWIFIEX_MAX_TRIPLET_802_11D];
  392. };
  393. struct mwifiex_vendor_spec_cfg_ie {
  394. u16 mask;
  395. u16 flag;
  396. u8 ie[MWIFIEX_MAX_VSIE_LEN];
  397. };
  398. struct wps {
  399. u8 session_enable;
  400. };
  401. struct mwifiex_roc_cfg {
  402. u64 cookie;
  403. struct ieee80211_channel chan;
  404. };
  405. #define MWIFIEX_FW_DUMP_IDX 0xff
  406. #define MWIFIEX_DRV_INFO_IDX 20
  407. #define FW_DUMP_MAX_NAME_LEN 8
  408. #define FW_DUMP_HOST_READY 0xEE
  409. #define FW_DUMP_DONE 0xFF
  410. #define FW_DUMP_READ_DONE 0xFE
  411. struct memory_type_mapping {
  412. u8 mem_name[FW_DUMP_MAX_NAME_LEN];
  413. u8 *mem_ptr;
  414. u32 mem_size;
  415. u8 done_flag;
  416. };
  417. enum rdwr_status {
  418. RDWR_STATUS_SUCCESS = 0,
  419. RDWR_STATUS_FAILURE = 1,
  420. RDWR_STATUS_DONE = 2
  421. };
  422. enum mwifiex_iface_work_flags {
  423. MWIFIEX_IFACE_WORK_DEVICE_DUMP,
  424. MWIFIEX_IFACE_WORK_CARD_RESET,
  425. };
  426. struct mwifiex_private {
  427. struct mwifiex_adapter *adapter;
  428. u8 bss_type;
  429. u8 bss_role;
  430. u8 bss_priority;
  431. u8 bss_num;
  432. u8 bss_started;
  433. u8 frame_type;
  434. u8 curr_addr[ETH_ALEN];
  435. u8 media_connected;
  436. u8 port_open;
  437. u8 usb_port;
  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. void (*multi_port_resync)(struct mwifiex_adapter *);
  715. bool (*is_port_ready)(struct mwifiex_private *);
  716. };
  717. struct mwifiex_adapter {
  718. u8 iface_type;
  719. unsigned int debug_mask;
  720. struct mwifiex_iface_comb iface_limit;
  721. struct mwifiex_iface_comb curr_iface_comb;
  722. struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM];
  723. u8 priv_num;
  724. const struct firmware *firmware;
  725. char fw_name[32];
  726. int winner;
  727. struct device *dev;
  728. struct wiphy *wiphy;
  729. u8 perm_addr[ETH_ALEN];
  730. bool surprise_removed;
  731. u32 fw_release_number;
  732. u16 init_wait_q_woken;
  733. wait_queue_head_t init_wait_q;
  734. void *card;
  735. struct mwifiex_if_ops if_ops;
  736. atomic_t bypass_tx_pending;
  737. atomic_t rx_pending;
  738. atomic_t tx_pending;
  739. atomic_t cmd_pending;
  740. struct workqueue_struct *workqueue;
  741. struct work_struct main_work;
  742. struct workqueue_struct *rx_workqueue;
  743. struct work_struct rx_work;
  744. struct workqueue_struct *dfs_workqueue;
  745. struct work_struct dfs_work;
  746. bool rx_work_enabled;
  747. bool rx_processing;
  748. bool delay_main_work;
  749. bool rx_locked;
  750. bool main_locked;
  751. struct mwifiex_bss_prio_tbl bss_prio_tbl[MWIFIEX_MAX_BSS_NUM];
  752. /* spin lock for init/shutdown */
  753. spinlock_t mwifiex_lock;
  754. /* spin lock for main process */
  755. spinlock_t main_proc_lock;
  756. u32 mwifiex_processing;
  757. u8 more_task_flag;
  758. u16 tx_buf_size;
  759. u16 curr_tx_buf_size;
  760. /* sdio single port rx aggregation capability */
  761. bool host_disable_sdio_rx_aggr;
  762. bool sdio_rx_aggr_enable;
  763. u16 sdio_rx_block_size;
  764. u32 ioport;
  765. enum MWIFIEX_HARDWARE_STATUS hw_status;
  766. u16 number_of_antenna;
  767. u32 fw_cap_info;
  768. /* spin lock for interrupt handling */
  769. spinlock_t int_lock;
  770. u8 int_status;
  771. u32 event_cause;
  772. struct sk_buff *event_skb;
  773. u8 upld_buf[MWIFIEX_UPLD_SIZE];
  774. u8 data_sent;
  775. u8 cmd_sent;
  776. u8 cmd_resp_received;
  777. u8 event_received;
  778. u8 data_received;
  779. u16 seq_num;
  780. struct cmd_ctrl_node *cmd_pool;
  781. struct cmd_ctrl_node *curr_cmd;
  782. /* spin lock for command */
  783. spinlock_t mwifiex_cmd_lock;
  784. u8 is_cmd_timedout;
  785. u16 last_init_cmd;
  786. struct timer_list cmd_timer;
  787. struct list_head cmd_free_q;
  788. /* spin lock for cmd_free_q */
  789. spinlock_t cmd_free_q_lock;
  790. struct list_head cmd_pending_q;
  791. /* spin lock for cmd_pending_q */
  792. spinlock_t cmd_pending_q_lock;
  793. struct list_head scan_pending_q;
  794. /* spin lock for scan_pending_q */
  795. spinlock_t scan_pending_q_lock;
  796. /* spin lock for RX processing routine */
  797. spinlock_t rx_proc_lock;
  798. struct sk_buff_head tx_data_q;
  799. atomic_t tx_queued;
  800. u32 scan_processing;
  801. u16 region_code;
  802. struct mwifiex_802_11d_domain_reg domain_reg;
  803. u16 scan_probes;
  804. u32 scan_mode;
  805. u16 specific_scan_time;
  806. u16 active_scan_time;
  807. u16 passive_scan_time;
  808. u16 scan_chan_gap_time;
  809. u8 fw_bands;
  810. u8 adhoc_start_band;
  811. u8 config_bands;
  812. struct mwifiex_chan_scan_param_set *scan_channels;
  813. u8 tx_lock_flag;
  814. struct mwifiex_sleep_params sleep_params;
  815. struct mwifiex_sleep_period sleep_period;
  816. u16 ps_mode;
  817. u32 ps_state;
  818. u8 need_to_wakeup;
  819. u16 multiple_dtim;
  820. u16 local_listen_interval;
  821. u16 null_pkt_interval;
  822. struct sk_buff *sleep_cfm;
  823. u16 bcn_miss_time_out;
  824. u16 adhoc_awake_period;
  825. u8 is_deep_sleep;
  826. u8 delay_null_pkt;
  827. u16 delay_to_ps;
  828. u16 enhanced_ps_mode;
  829. u8 pm_wakeup_card_req;
  830. u16 gen_null_pkt;
  831. u16 pps_uapsd_mode;
  832. u32 pm_wakeup_fw_try;
  833. struct timer_list wakeup_timer;
  834. u8 is_hs_configured;
  835. struct mwifiex_hs_config_param hs_cfg;
  836. u8 hs_activated;
  837. u16 hs_activate_wait_q_woken;
  838. wait_queue_head_t hs_activate_wait_q;
  839. bool is_suspended;
  840. bool hs_enabling;
  841. u8 event_body[MAX_EVENT_SIZE];
  842. u32 hw_dot_11n_dev_cap;
  843. u8 hw_dev_mcs_support;
  844. u8 user_dev_mcs_support;
  845. u8 adhoc_11n_enabled;
  846. u8 sec_chan_offset;
  847. struct mwifiex_dbg dbg;
  848. u8 arp_filter[ARP_FILTER_MAX_BUF_SIZE];
  849. u32 arp_filter_size;
  850. struct mwifiex_wait_queue cmd_wait_q;
  851. u8 scan_wait_q_woken;
  852. spinlock_t queue_lock; /* lock for tx queues */
  853. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  854. u16 max_mgmt_ie_index;
  855. const struct firmware *cal_data;
  856. struct device_node *dt_node;
  857. /* 11AC */
  858. u32 is_hw_11ac_capable;
  859. u32 hw_dot_11ac_dev_cap;
  860. u32 hw_dot_11ac_mcs_support;
  861. u32 usr_dot_11ac_dev_cap_bg;
  862. u32 usr_dot_11ac_dev_cap_a;
  863. u32 usr_dot_11ac_mcs_support;
  864. atomic_t pending_bridged_pkts;
  865. struct semaphore *card_sem;
  866. bool ext_scan;
  867. u8 fw_api_ver;
  868. u8 key_api_major_ver, key_api_minor_ver;
  869. struct memory_type_mapping *mem_type_mapping_tbl;
  870. u8 num_mem_types;
  871. void *drv_info_dump;
  872. u32 drv_info_size;
  873. bool scan_chan_gap_enabled;
  874. struct sk_buff_head rx_data_q;
  875. struct mwifiex_chan_stats *chan_stats;
  876. u32 num_in_chan_stats;
  877. int survey_idx;
  878. bool auto_tdls;
  879. u8 coex_scan;
  880. u8 coex_min_scan_time;
  881. u8 coex_max_scan_time;
  882. u8 coex_win_size;
  883. u8 coex_tx_win_size;
  884. u8 coex_rx_win_size;
  885. bool drcs_enabled;
  886. u8 active_scan_triggered;
  887. bool usb_mc_status;
  888. bool usb_mc_setup;
  889. };
  890. void mwifiex_process_tx_queue(struct mwifiex_adapter *adapter);
  891. int mwifiex_init_lock_list(struct mwifiex_adapter *adapter);
  892. void mwifiex_set_trans_start(struct net_device *dev);
  893. void mwifiex_stop_net_dev_queue(struct net_device *netdev,
  894. struct mwifiex_adapter *adapter);
  895. void mwifiex_wake_up_net_dev_queue(struct net_device *netdev,
  896. struct mwifiex_adapter *adapter);
  897. int mwifiex_init_priv(struct mwifiex_private *priv);
  898. void mwifiex_free_priv(struct mwifiex_private *priv);
  899. int mwifiex_init_fw(struct mwifiex_adapter *adapter);
  900. int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter);
  901. int mwifiex_shutdown_drv(struct mwifiex_adapter *adapter);
  902. int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter);
  903. int mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *);
  904. int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb);
  905. int mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
  906. struct sk_buff *skb);
  907. int mwifiex_process_event(struct mwifiex_adapter *adapter);
  908. int mwifiex_complete_cmd(struct mwifiex_adapter *adapter,
  909. struct cmd_ctrl_node *cmd_node);
  910. int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
  911. u16 cmd_action, u32 cmd_oid, void *data_buf, bool sync);
  912. void mwifiex_cmd_timeout_func(unsigned long function_context);
  913. int mwifiex_get_debug_info(struct mwifiex_private *,
  914. struct mwifiex_debug_info *);
  915. int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter);
  916. int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter);
  917. void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter);
  918. void mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter);
  919. void mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter *adapter,
  920. struct cmd_ctrl_node *cmd_node);
  921. void mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter,
  922. struct cmd_ctrl_node *cmd_node);
  923. void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
  924. struct cmd_ctrl_node *cmd_node,
  925. u32 addtail);
  926. int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter);
  927. int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter);
  928. int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
  929. struct sk_buff *skb);
  930. int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
  931. struct mwifiex_tx_param *tx_param);
  932. int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags);
  933. int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
  934. struct sk_buff *skb, int aggr, int status);
  935. void mwifiex_clean_txrx(struct mwifiex_private *priv);
  936. u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv);
  937. void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter);
  938. void mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *, u8 *,
  939. u32);
  940. int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
  941. struct host_cmd_ds_command *cmd,
  942. u16 cmd_action, uint16_t ps_bitmap,
  943. struct mwifiex_ds_auto_ds *auto_ds);
  944. int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
  945. struct host_cmd_ds_command *resp,
  946. struct mwifiex_ds_pm_cfg *pm_cfg);
  947. void mwifiex_process_hs_config(struct mwifiex_adapter *adapter);
  948. void mwifiex_hs_activated_event(struct mwifiex_private *priv,
  949. u8 activated);
  950. int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
  951. int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg);
  952. int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv,
  953. struct host_cmd_ds_command *resp);
  954. int mwifiex_process_rx_packet(struct mwifiex_private *priv,
  955. struct sk_buff *skb);
  956. int mwifiex_sta_prepare_cmd(struct mwifiex_private *, uint16_t cmd_no,
  957. u16 cmd_action, u32 cmd_oid,
  958. void *data_buf, void *cmd_buf);
  959. int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
  960. u16 cmd_action, u32 cmd_oid,
  961. void *data_buf, void *cmd_buf);
  962. int mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no,
  963. struct host_cmd_ds_command *resp);
  964. int mwifiex_process_sta_rx_packet(struct mwifiex_private *,
  965. struct sk_buff *skb);
  966. int mwifiex_process_uap_rx_packet(struct mwifiex_private *priv,
  967. struct sk_buff *skb);
  968. int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv,
  969. struct sk_buff *skb);
  970. int mwifiex_process_sta_event(struct mwifiex_private *);
  971. int mwifiex_process_uap_event(struct mwifiex_private *);
  972. void mwifiex_delete_all_station_list(struct mwifiex_private *priv);
  973. void mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv,
  974. const u8 *ra_addr);
  975. void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb);
  976. void *mwifiex_process_uap_txpd(struct mwifiex_private *, struct sk_buff *skb);
  977. int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta, bool init);
  978. int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd,
  979. struct mwifiex_scan_cmd_config *scan_cfg);
  980. void mwifiex_queue_scan_cmd(struct mwifiex_private *priv,
  981. struct cmd_ctrl_node *cmd_node);
  982. int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
  983. struct host_cmd_ds_command *resp);
  984. s32 mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2);
  985. int mwifiex_associate(struct mwifiex_private *priv,
  986. struct mwifiex_bssdescriptor *bss_desc);
  987. int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
  988. struct host_cmd_ds_command *cmd,
  989. struct mwifiex_bssdescriptor *bss_desc);
  990. int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
  991. struct host_cmd_ds_command *resp);
  992. void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason);
  993. u8 mwifiex_band_to_radio_type(u8 band);
  994. int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac);
  995. void mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter);
  996. int mwifiex_adhoc_start(struct mwifiex_private *priv,
  997. struct cfg80211_ssid *adhoc_ssid);
  998. int mwifiex_adhoc_join(struct mwifiex_private *priv,
  999. struct mwifiex_bssdescriptor *bss_desc);
  1000. int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
  1001. struct host_cmd_ds_command *cmd,
  1002. struct cfg80211_ssid *req_ssid);
  1003. int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
  1004. struct host_cmd_ds_command *cmd,
  1005. struct mwifiex_bssdescriptor *bss_desc);
  1006. int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
  1007. struct host_cmd_ds_command *resp);
  1008. int mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command *cmd);
  1009. struct mwifiex_chan_freq_power *mwifiex_get_cfp(struct mwifiex_private *priv,
  1010. u8 band, u16 channel, u32 freq);
  1011. u32 mwifiex_index_to_data_rate(struct mwifiex_private *priv,
  1012. u8 index, u8 ht_info);
  1013. u32 mwifiex_index_to_acs_data_rate(struct mwifiex_private *priv,
  1014. u8 index, u8 ht_info);
  1015. u32 mwifiex_find_freq_from_band_chan(u8, u8);
  1016. int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv, u16 vsie_mask,
  1017. u8 **buffer);
  1018. u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv,
  1019. u8 *rates);
  1020. u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates);
  1021. u32 mwifiex_get_rates_from_cfg80211(struct mwifiex_private *priv,
  1022. u8 *rates, u8 radio_type);
  1023. u8 mwifiex_is_rate_auto(struct mwifiex_private *priv);
  1024. extern u16 region_code_index[MWIFIEX_MAX_REGION_CODE];
  1025. void mwifiex_save_curr_bcn(struct mwifiex_private *priv);
  1026. void mwifiex_free_curr_bcn(struct mwifiex_private *priv);
  1027. int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv,
  1028. struct host_cmd_ds_command *cmd);
  1029. int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
  1030. struct host_cmd_ds_command *resp);
  1031. int is_command_pending(struct mwifiex_adapter *adapter);
  1032. void mwifiex_init_priv_params(struct mwifiex_private *priv,
  1033. struct net_device *dev);
  1034. int mwifiex_set_secure_params(struct mwifiex_private *priv,
  1035. struct mwifiex_uap_bss_param *bss_config,
  1036. struct cfg80211_ap_settings *params);
  1037. void mwifiex_set_ht_params(struct mwifiex_private *priv,
  1038. struct mwifiex_uap_bss_param *bss_cfg,
  1039. struct cfg80211_ap_settings *params);
  1040. void mwifiex_set_vht_params(struct mwifiex_private *priv,
  1041. struct mwifiex_uap_bss_param *bss_cfg,
  1042. struct cfg80211_ap_settings *params);
  1043. void mwifiex_set_tpc_params(struct mwifiex_private *priv,
  1044. struct mwifiex_uap_bss_param *bss_cfg,
  1045. struct cfg80211_ap_settings *params);
  1046. void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg,
  1047. struct cfg80211_ap_settings *params);
  1048. void mwifiex_set_vht_width(struct mwifiex_private *priv,
  1049. enum nl80211_chan_width width,
  1050. bool ap_11ac_disable);
  1051. void
  1052. mwifiex_set_wmm_params(struct mwifiex_private *priv,
  1053. struct mwifiex_uap_bss_param *bss_cfg,
  1054. struct cfg80211_ap_settings *params);
  1055. void mwifiex_set_ba_params(struct mwifiex_private *priv);
  1056. void mwifiex_update_ampdu_txwinsize(struct mwifiex_adapter *pmadapter);
  1057. void mwifiex_bt_coex_wlan_param_update_event(struct mwifiex_private *priv,
  1058. struct sk_buff *event_skb);
  1059. void mwifiex_set_11ac_ba_params(struct mwifiex_private *priv);
  1060. int mwifiex_cmd_802_11_scan_ext(struct mwifiex_private *priv,
  1061. struct host_cmd_ds_command *cmd,
  1062. void *data_buf);
  1063. int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv,
  1064. struct host_cmd_ds_command *resp);
  1065. int mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv,
  1066. void *buf);
  1067. /*
  1068. * This function checks if the queuing is RA based or not.
  1069. */
  1070. static inline u8
  1071. mwifiex_queuing_ra_based(struct mwifiex_private *priv)
  1072. {
  1073. /*
  1074. * Currently we assume if we are in Infra, then DA=RA. This might not be
  1075. * true in the future
  1076. */
  1077. if ((priv->bss_mode == NL80211_IFTYPE_STATION) &&
  1078. (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA))
  1079. return false;
  1080. return true;
  1081. }
  1082. /*
  1083. * This function copies rates.
  1084. */
  1085. static inline u32
  1086. mwifiex_copy_rates(u8 *dest, u32 pos, u8 *src, int len)
  1087. {
  1088. int i;
  1089. for (i = 0; i < len && src[i]; i++, pos++) {
  1090. if (pos >= MWIFIEX_SUPPORTED_RATES)
  1091. break;
  1092. dest[pos] = src[i];
  1093. }
  1094. return pos;
  1095. }
  1096. /*
  1097. * This function returns the correct private structure pointer based
  1098. * upon the BSS type and BSS number.
  1099. */
  1100. static inline struct mwifiex_private *
  1101. mwifiex_get_priv_by_id(struct mwifiex_adapter *adapter,
  1102. u8 bss_num, u8 bss_type)
  1103. {
  1104. int i;
  1105. for (i = 0; i < adapter->priv_num; i++) {
  1106. if (adapter->priv[i]) {
  1107. if ((adapter->priv[i]->bss_num == bss_num) &&
  1108. (adapter->priv[i]->bss_type == bss_type))
  1109. break;
  1110. }
  1111. }
  1112. return ((i < adapter->priv_num) ? adapter->priv[i] : NULL);
  1113. }
  1114. /*
  1115. * This function returns the first available private structure pointer
  1116. * based upon the BSS role.
  1117. */
  1118. static inline struct mwifiex_private *
  1119. mwifiex_get_priv(struct mwifiex_adapter *adapter,
  1120. enum mwifiex_bss_role bss_role)
  1121. {
  1122. int i;
  1123. for (i = 0; i < adapter->priv_num; i++) {
  1124. if (adapter->priv[i]) {
  1125. if (bss_role == MWIFIEX_BSS_ROLE_ANY ||
  1126. GET_BSS_ROLE(adapter->priv[i]) == bss_role)
  1127. break;
  1128. }
  1129. }
  1130. return ((i < adapter->priv_num) ? adapter->priv[i] : NULL);
  1131. }
  1132. /*
  1133. * This function returns the first available unused private structure pointer.
  1134. */
  1135. static inline struct mwifiex_private *
  1136. mwifiex_get_unused_priv(struct mwifiex_adapter *adapter)
  1137. {
  1138. int i;
  1139. for (i = 0; i < adapter->priv_num; i++) {
  1140. if (adapter->priv[i]) {
  1141. if (adapter->priv[i]->bss_mode ==
  1142. NL80211_IFTYPE_UNSPECIFIED)
  1143. break;
  1144. }
  1145. }
  1146. return ((i < adapter->priv_num) ? adapter->priv[i] : NULL);
  1147. }
  1148. /*
  1149. * This function returns the driver private structure of a network device.
  1150. */
  1151. static inline struct mwifiex_private *
  1152. mwifiex_netdev_get_priv(struct net_device *dev)
  1153. {
  1154. return (struct mwifiex_private *) (*(unsigned long *) netdev_priv(dev));
  1155. }
  1156. /*
  1157. * This function checks if a skb holds a management frame.
  1158. */
  1159. static inline bool mwifiex_is_skb_mgmt_frame(struct sk_buff *skb)
  1160. {
  1161. return (le32_to_cpu(*(__le32 *)skb->data) == PKT_TYPE_MGMT);
  1162. }
  1163. /* This function retrieves channel closed for operation by Channel
  1164. * Switch Announcement.
  1165. */
  1166. static inline u8
  1167. mwifiex_11h_get_csa_closed_channel(struct mwifiex_private *priv)
  1168. {
  1169. if (!priv->csa_chan)
  1170. return 0;
  1171. /* Clear csa channel, if DFS channel move time has passed */
  1172. if (time_after(jiffies, priv->csa_expire_time)) {
  1173. priv->csa_chan = 0;
  1174. priv->csa_expire_time = 0;
  1175. }
  1176. return priv->csa_chan;
  1177. }
  1178. static inline u8 mwifiex_is_any_intf_active(struct mwifiex_private *priv)
  1179. {
  1180. struct mwifiex_private *priv_num;
  1181. int i;
  1182. for (i = 0; i < priv->adapter->priv_num; i++) {
  1183. priv_num = priv->adapter->priv[i];
  1184. if (priv_num) {
  1185. if ((GET_BSS_ROLE(priv_num) == MWIFIEX_BSS_ROLE_UAP &&
  1186. priv_num->bss_started) ||
  1187. (GET_BSS_ROLE(priv_num) == MWIFIEX_BSS_ROLE_STA &&
  1188. priv_num->media_connected))
  1189. return 1;
  1190. }
  1191. }
  1192. return 0;
  1193. }
  1194. static inline u8 mwifiex_is_tdls_link_setup(u8 status)
  1195. {
  1196. switch (status) {
  1197. case TDLS_SETUP_COMPLETE:
  1198. case TDLS_CHAN_SWITCHING:
  1199. case TDLS_IN_BASE_CHAN:
  1200. case TDLS_IN_OFF_CHAN:
  1201. return true;
  1202. default:
  1203. break;
  1204. }
  1205. return false;
  1206. }
  1207. int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
  1208. u32 func_init_shutdown);
  1209. int mwifiex_add_card(void *, struct semaphore *, struct mwifiex_if_ops *, u8);
  1210. int mwifiex_remove_card(struct mwifiex_adapter *, struct semaphore *);
  1211. void mwifiex_get_version(struct mwifiex_adapter *adapter, char *version,
  1212. int maxlen);
  1213. int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
  1214. struct mwifiex_multicast_list *mcast_list);
  1215. int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
  1216. struct net_device *dev);
  1217. int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter,
  1218. struct cmd_ctrl_node *cmd_queued);
  1219. int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
  1220. struct cfg80211_ssid *req_ssid);
  1221. int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type);
  1222. int mwifiex_enable_hs(struct mwifiex_adapter *adapter);
  1223. int mwifiex_disable_auto_ds(struct mwifiex_private *priv);
  1224. int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, u32 *rate);
  1225. int mwifiex_request_scan(struct mwifiex_private *priv,
  1226. struct cfg80211_ssid *req_ssid);
  1227. int mwifiex_scan_networks(struct mwifiex_private *priv,
  1228. const struct mwifiex_user_scan_cfg *user_scan_in);
  1229. int mwifiex_set_radio(struct mwifiex_private *priv, u8 option);
  1230. int mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp,
  1231. const u8 *key, int key_len, u8 key_index,
  1232. const u8 *mac_addr, int disable);
  1233. int mwifiex_set_gen_ie(struct mwifiex_private *priv, const u8 *ie, int ie_len);
  1234. int mwifiex_get_ver_ext(struct mwifiex_private *priv);
  1235. int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
  1236. struct ieee80211_channel *chan,
  1237. unsigned int duration);
  1238. int mwifiex_get_stats_info(struct mwifiex_private *priv,
  1239. struct mwifiex_ds_get_stats *log);
  1240. int mwifiex_reg_write(struct mwifiex_private *priv, u32 reg_type,
  1241. u32 reg_offset, u32 reg_value);
  1242. int mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type,
  1243. u32 reg_offset, u32 *value);
  1244. int mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes,
  1245. u8 *value);
  1246. int mwifiex_set_11n_httx_cfg(struct mwifiex_private *priv, int data);
  1247. int mwifiex_get_11n_httx_cfg(struct mwifiex_private *priv, int *data);
  1248. int mwifiex_set_tx_rate_cfg(struct mwifiex_private *priv, int tx_rate_index);
  1249. int mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_index);
  1250. int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode);
  1251. int mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter,
  1252. char *version, int max_len);
  1253. int mwifiex_set_tx_power(struct mwifiex_private *priv,
  1254. struct mwifiex_power_cfg *power_cfg);
  1255. int mwifiex_main_process(struct mwifiex_adapter *);
  1256. int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb);
  1257. int mwifiex_get_bss_info(struct mwifiex_private *,
  1258. struct mwifiex_bss_info *);
  1259. int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
  1260. struct cfg80211_bss *bss,
  1261. struct mwifiex_bssdescriptor *bss_desc);
  1262. int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
  1263. struct mwifiex_bssdescriptor *bss_entry);
  1264. int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
  1265. struct mwifiex_bssdescriptor *bss_desc);
  1266. u8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type);
  1267. u8 mwifiex_sec_chan_offset_to_chan_type(u8 second_chan_offset);
  1268. struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
  1269. const char *name,
  1270. unsigned char name_assign_type,
  1271. enum nl80211_iftype type,
  1272. u32 *flags,
  1273. struct vif_params *params);
  1274. int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev);
  1275. void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config);
  1276. int mwifiex_add_wowlan_magic_pkt_filter(struct mwifiex_adapter *adapter);
  1277. int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
  1278. struct cfg80211_beacon_data *data);
  1279. int mwifiex_del_mgmt_ies(struct mwifiex_private *priv);
  1280. u8 *mwifiex_11d_code_2_region(u8 code);
  1281. void mwifiex_uap_set_channel(struct mwifiex_private *priv,
  1282. struct mwifiex_uap_bss_param *bss_cfg,
  1283. struct cfg80211_chan_def chandef);
  1284. int mwifiex_config_start_uap(struct mwifiex_private *priv,
  1285. struct mwifiex_uap_bss_param *bss_cfg);
  1286. void mwifiex_uap_del_sta_data(struct mwifiex_private *priv,
  1287. struct mwifiex_sta_node *node);
  1288. void mwifiex_init_11h_params(struct mwifiex_private *priv);
  1289. int mwifiex_is_11h_active(struct mwifiex_private *priv);
  1290. int mwifiex_11h_activate(struct mwifiex_private *priv, bool flag);
  1291. void mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer,
  1292. struct mwifiex_bssdescriptor *bss_desc);
  1293. int mwifiex_11h_handle_event_chanswann(struct mwifiex_private *priv);
  1294. int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv,
  1295. struct device_node *node, const char *prefix);
  1296. void mwifiex_dnld_txpwr_table(struct mwifiex_private *priv);
  1297. extern const struct ethtool_ops mwifiex_ethtool_ops;
  1298. void mwifiex_del_all_sta_list(struct mwifiex_private *priv);
  1299. void mwifiex_del_sta_entry(struct mwifiex_private *priv, const u8 *mac);
  1300. void
  1301. mwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies,
  1302. int ies_len, struct mwifiex_sta_node *node);
  1303. struct mwifiex_sta_node *
  1304. mwifiex_add_sta_entry(struct mwifiex_private *priv, const u8 *mac);
  1305. struct mwifiex_sta_node *
  1306. mwifiex_get_sta_entry(struct mwifiex_private *priv, const u8 *mac);
  1307. u8 mwifiex_is_tdls_chan_switching(struct mwifiex_private *priv);
  1308. u8 mwifiex_is_tdls_off_chan(struct mwifiex_private *priv);
  1309. u8 mwifiex_is_send_cmd_allowed(struct mwifiex_private *priv);
  1310. int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer,
  1311. u8 action_code, u8 dialog_token,
  1312. u16 status_code, const u8 *extra_ies,
  1313. size_t extra_ies_len);
  1314. int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer,
  1315. u8 action_code, u8 dialog_token,
  1316. u16 status_code, const u8 *extra_ies,
  1317. size_t extra_ies_len);
  1318. void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv,
  1319. u8 *buf, int len);
  1320. int mwifiex_tdls_oper(struct mwifiex_private *priv, const u8 *peer, u8 action);
  1321. int mwifiex_get_tdls_link_status(struct mwifiex_private *priv, const u8 *mac);
  1322. int mwifiex_get_tdls_list(struct mwifiex_private *priv,
  1323. struct tdls_peer_info *buf);
  1324. void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv);
  1325. bool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private *priv);
  1326. u8 mwifiex_get_center_freq_index(struct mwifiex_private *priv, u8 band,
  1327. u32 pri_chan, u8 chan_bw);
  1328. int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter);
  1329. int mwifiex_tdls_check_tx(struct mwifiex_private *priv, struct sk_buff *skb);
  1330. void mwifiex_flush_auto_tdls_list(struct mwifiex_private *priv);
  1331. void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv,
  1332. const u8 *mac, u8 link_status);
  1333. void mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private *priv,
  1334. u8 *mac, s8 snr, s8 nflr);
  1335. void mwifiex_check_auto_tdls(unsigned long context);
  1336. void mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv, const u8 *mac);
  1337. void mwifiex_setup_auto_tdls_timer(struct mwifiex_private *priv);
  1338. void mwifiex_clean_auto_tdls(struct mwifiex_private *priv);
  1339. int mwifiex_config_tdls_enable(struct mwifiex_private *priv);
  1340. int mwifiex_config_tdls_disable(struct mwifiex_private *priv);
  1341. int mwifiex_config_tdls_cs_params(struct mwifiex_private *priv);
  1342. int mwifiex_stop_tdls_cs(struct mwifiex_private *priv, const u8 *peer_mac);
  1343. int mwifiex_start_tdls_cs(struct mwifiex_private *priv, const u8 *peer_mac,
  1344. u8 primary_chan, u8 second_chan_offset, u8 band);
  1345. int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv,
  1346. struct host_cmd_ds_command *cmd,
  1347. void *data_buf);
  1348. int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv,
  1349. struct sk_buff *skb);
  1350. void mwifiex_parse_tx_status_event(struct mwifiex_private *priv,
  1351. void *event_body);
  1352. struct sk_buff *
  1353. mwifiex_clone_skb_for_tx_status(struct mwifiex_private *priv,
  1354. struct sk_buff *skb, u8 flag, u64 *cookie);
  1355. void mwifiex_dfs_cac_work_queue(struct work_struct *work);
  1356. void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work);
  1357. void mwifiex_abort_cac(struct mwifiex_private *priv);
  1358. int mwifiex_stop_radar_detection(struct mwifiex_private *priv,
  1359. struct cfg80211_chan_def *chandef);
  1360. int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv,
  1361. struct sk_buff *skb);
  1362. void mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr,
  1363. s8 nflr);
  1364. void mwifiex_hist_data_reset(struct mwifiex_private *priv);
  1365. void mwifiex_hist_data_add(struct mwifiex_private *priv,
  1366. u8 rx_rate, s8 snr, s8 nflr);
  1367. u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv,
  1368. u8 rx_rate, u8 ht_info);
  1369. void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter);
  1370. void mwifiex_upload_device_dump(struct mwifiex_adapter *adapter);
  1371. void *mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags);
  1372. void mwifiex_queue_main_work(struct mwifiex_adapter *adapter);
  1373. void mwifiex_coex_ampdu_rxwinsize(struct mwifiex_adapter *adapter);
  1374. void mwifiex_11n_delba(struct mwifiex_private *priv, int tid);
  1375. int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy);
  1376. void mwifiex_process_tx_pause_event(struct mwifiex_private *priv,
  1377. struct sk_buff *event);
  1378. void mwifiex_process_multi_chan_event(struct mwifiex_private *priv,
  1379. struct sk_buff *event_skb);
  1380. void mwifiex_multi_chan_resync(struct mwifiex_adapter *adapter);
  1381. #ifdef CONFIG_DEBUG_FS
  1382. void mwifiex_debugfs_init(void);
  1383. void mwifiex_debugfs_remove(void);
  1384. void mwifiex_dev_debugfs_init(struct mwifiex_private *priv);
  1385. void mwifiex_dev_debugfs_remove(struct mwifiex_private *priv);
  1386. #endif
  1387. #endif /* !_MWIFIEX_MAIN_H_ */