main.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164
  1. /*
  2. * Marvell Wireless LAN device driver: major data structures and prototypes
  3. *
  4. * Copyright (C) 2011, 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/firmware.h>
  32. #include <linux/ctype.h>
  33. #include "decl.h"
  34. #include "ioctl.h"
  35. #include "util.h"
  36. #include "fw.h"
  37. #include "pcie.h"
  38. extern const char driver_version[];
  39. enum {
  40. MWIFIEX_ASYNC_CMD,
  41. MWIFIEX_SYNC_CMD
  42. };
  43. #define MWIFIEX_MAX_AP 64
  44. #define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ)
  45. #define MWIFIEX_TIMER_10S 10000
  46. #define MWIFIEX_TIMER_1S 1000
  47. #define MAX_TX_PENDING 100
  48. #define LOW_TX_PENDING 80
  49. #define MWIFIEX_UPLD_SIZE (2312)
  50. #define MAX_EVENT_SIZE 1024
  51. #define ARP_FILTER_MAX_BUF_SIZE 68
  52. #define MWIFIEX_KEY_BUFFER_SIZE 16
  53. #define MWIFIEX_DEFAULT_LISTEN_INTERVAL 10
  54. #define MWIFIEX_MAX_REGION_CODE 7
  55. #define DEFAULT_BCN_AVG_FACTOR 8
  56. #define DEFAULT_DATA_AVG_FACTOR 8
  57. #define FIRST_VALID_CHANNEL 0xff
  58. #define DEFAULT_AD_HOC_CHANNEL 6
  59. #define DEFAULT_AD_HOC_CHANNEL_A 36
  60. #define DEFAULT_BCN_MISS_TIMEOUT 5
  61. #define MAX_SCAN_BEACON_BUFFER 8000
  62. #define SCAN_BEACON_ENTRY_PAD 6
  63. #define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 110
  64. #define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 30
  65. #define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME 30
  66. #define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI)))
  67. #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S)
  68. #define MWIFIEX_MAX_SCAN_DELAY_CNT 50
  69. #define MWIFIEX_MAX_EMPTY_TX_Q_CNT 10
  70. #define MWIFIEX_SCAN_DELAY_MSEC 20
  71. #define MWIFIEX_MIN_TX_PENDING_TO_CANCEL_SCAN 2
  72. #define RSN_GTK_OUI_OFFSET 2
  73. #define MWIFIEX_OUI_NOT_PRESENT 0
  74. #define MWIFIEX_OUI_PRESENT 1
  75. #define PKT_TYPE_MGMT 0xE5
  76. /*
  77. * Do not check for data_received for USB, as data_received
  78. * is handled in mwifiex_usb_recv for USB
  79. */
  80. #define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \
  81. adapter->event_received || \
  82. ((adapter->iface_type != MWIFIEX_USB) && \
  83. adapter->data_received) || \
  84. ((adapter->iface_type == MWIFIEX_USB) && \
  85. !skb_queue_empty(&adapter->usb_rx_data_q)))
  86. #define MWIFIEX_TYPE_CMD 1
  87. #define MWIFIEX_TYPE_DATA 0
  88. #define MWIFIEX_TYPE_EVENT 3
  89. #define MAX_BITMAP_RATES_SIZE 10
  90. #define MAX_CHANNEL_BAND_BG 14
  91. #define MAX_CHANNEL_BAND_A 165
  92. #define MAX_FREQUENCY_BAND_BG 2484
  93. #define MWIFIEX_EVENT_HEADER_LEN 4
  94. #define MWIFIEX_UAP_EVENT_EXTRA_HEADER 2
  95. #define MWIFIEX_TYPE_LEN 4
  96. #define MWIFIEX_USB_TYPE_CMD 0xF00DFACE
  97. #define MWIFIEX_USB_TYPE_DATA 0xBEADC0DE
  98. #define MWIFIEX_USB_TYPE_EVENT 0xBEEFFACE
  99. /* Threshold for tx_timeout_cnt before we trigger a card reset */
  100. #define TX_TIMEOUT_THRESHOLD 6
  101. struct mwifiex_dbg {
  102. u32 num_cmd_host_to_card_failure;
  103. u32 num_cmd_sleep_cfm_host_to_card_failure;
  104. u32 num_tx_host_to_card_failure;
  105. u32 num_event_deauth;
  106. u32 num_event_disassoc;
  107. u32 num_event_link_lost;
  108. u32 num_cmd_deauth;
  109. u32 num_cmd_assoc_success;
  110. u32 num_cmd_assoc_failure;
  111. u32 num_tx_timeout;
  112. u32 num_cmd_timeout;
  113. u16 timeout_cmd_id;
  114. u16 timeout_cmd_act;
  115. u16 last_cmd_id[DBG_CMD_NUM];
  116. u16 last_cmd_act[DBG_CMD_NUM];
  117. u16 last_cmd_index;
  118. u16 last_cmd_resp_id[DBG_CMD_NUM];
  119. u16 last_cmd_resp_index;
  120. u16 last_event[DBG_CMD_NUM];
  121. u16 last_event_index;
  122. };
  123. enum MWIFIEX_HARDWARE_STATUS {
  124. MWIFIEX_HW_STATUS_READY,
  125. MWIFIEX_HW_STATUS_INITIALIZING,
  126. MWIFIEX_HW_STATUS_FW_READY,
  127. MWIFIEX_HW_STATUS_INIT_DONE,
  128. MWIFIEX_HW_STATUS_RESET,
  129. MWIFIEX_HW_STATUS_CLOSING,
  130. MWIFIEX_HW_STATUS_NOT_READY
  131. };
  132. enum MWIFIEX_802_11_POWER_MODE {
  133. MWIFIEX_802_11_POWER_MODE_CAM,
  134. MWIFIEX_802_11_POWER_MODE_PSP
  135. };
  136. struct mwifiex_tx_param {
  137. u32 next_pkt_len;
  138. };
  139. enum MWIFIEX_PS_STATE {
  140. PS_STATE_AWAKE,
  141. PS_STATE_PRE_SLEEP,
  142. PS_STATE_SLEEP_CFM,
  143. PS_STATE_SLEEP
  144. };
  145. enum mwifiex_iface_type {
  146. MWIFIEX_SDIO,
  147. MWIFIEX_PCIE,
  148. MWIFIEX_USB
  149. };
  150. struct mwifiex_add_ba_param {
  151. u32 tx_win_size;
  152. u32 rx_win_size;
  153. u32 timeout;
  154. };
  155. struct mwifiex_tx_aggr {
  156. u8 ampdu_user;
  157. u8 ampdu_ap;
  158. u8 amsdu;
  159. };
  160. struct mwifiex_ra_list_tbl {
  161. struct list_head list;
  162. struct sk_buff_head skb_head;
  163. u8 ra[ETH_ALEN];
  164. u32 is_11n_enabled;
  165. u16 max_amsdu;
  166. u16 ba_pkt_count;
  167. u8 ba_packet_thr;
  168. u16 total_pkt_count;
  169. };
  170. struct mwifiex_tid_tbl {
  171. struct list_head ra_list;
  172. };
  173. #define WMM_HIGHEST_PRIORITY 7
  174. #define HIGH_PRIO_TID 7
  175. #define LOW_PRIO_TID 0
  176. struct mwifiex_wmm_desc {
  177. struct mwifiex_tid_tbl tid_tbl_ptr[MAX_NUM_TID];
  178. u32 packets_out[MAX_NUM_TID];
  179. /* spin lock to protect ra_list */
  180. spinlock_t ra_list_spinlock;
  181. struct mwifiex_wmm_ac_status ac_status[IEEE80211_NUM_ACS];
  182. enum mwifiex_wmm_ac_e ac_down_graded_vals[IEEE80211_NUM_ACS];
  183. u32 drv_pkt_delay_max;
  184. u8 queue_priority[IEEE80211_NUM_ACS];
  185. u32 user_pri_pkt_tx_ctrl[WMM_HIGHEST_PRIORITY + 1]; /* UP: 0 to 7 */
  186. /* Number of transmit packets queued */
  187. atomic_t tx_pkts_queued;
  188. /* Tracks highest priority with a packet queued */
  189. atomic_t highest_queued_prio;
  190. };
  191. struct mwifiex_802_11_security {
  192. u8 wpa_enabled;
  193. u8 wpa2_enabled;
  194. u8 wapi_enabled;
  195. u8 wapi_key_on;
  196. u8 wep_enabled;
  197. u32 authentication_mode;
  198. u8 is_authtype_auto;
  199. u32 encryption_mode;
  200. };
  201. struct ieee_types_header {
  202. u8 element_id;
  203. u8 len;
  204. } __packed;
  205. struct ieee_types_vendor_specific {
  206. struct ieee_types_vendor_header vend_hdr;
  207. u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)];
  208. } __packed;
  209. struct ieee_types_generic {
  210. struct ieee_types_header ieee_hdr;
  211. u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_header)];
  212. } __packed;
  213. struct mwifiex_bssdescriptor {
  214. u8 mac_address[ETH_ALEN];
  215. struct cfg80211_ssid ssid;
  216. u32 privacy;
  217. s32 rssi;
  218. u32 channel;
  219. u32 freq;
  220. u16 beacon_period;
  221. u8 erp_flags;
  222. u32 bss_mode;
  223. u8 supported_rates[MWIFIEX_SUPPORTED_RATES];
  224. u8 data_rates[MWIFIEX_SUPPORTED_RATES];
  225. /* Network band.
  226. * BAND_B(0x01): 'b' band
  227. * BAND_G(0x02): 'g' band
  228. * BAND_A(0X04): 'a' band
  229. */
  230. u16 bss_band;
  231. u64 fw_tsf;
  232. u64 timestamp;
  233. union ieee_types_phy_param_set phy_param_set;
  234. union ieee_types_ss_param_set ss_param_set;
  235. u16 cap_info_bitmap;
  236. struct ieee_types_wmm_parameter wmm_ie;
  237. u8 disable_11n;
  238. struct ieee80211_ht_cap *bcn_ht_cap;
  239. u16 ht_cap_offset;
  240. struct ieee80211_ht_operation *bcn_ht_oper;
  241. u16 ht_info_offset;
  242. u8 *bcn_bss_co_2040;
  243. u16 bss_co_2040_offset;
  244. u8 *bcn_ext_cap;
  245. u16 ext_cap_offset;
  246. struct ieee80211_vht_cap *bcn_vht_cap;
  247. u16 vht_cap_offset;
  248. struct ieee80211_vht_operation *bcn_vht_oper;
  249. u16 vht_info_offset;
  250. struct ieee_types_oper_mode_ntf *oper_mode;
  251. u16 oper_mode_offset;
  252. u8 disable_11ac;
  253. struct ieee_types_vendor_specific *bcn_wpa_ie;
  254. u16 wpa_offset;
  255. struct ieee_types_generic *bcn_rsn_ie;
  256. u16 rsn_offset;
  257. struct ieee_types_generic *bcn_wapi_ie;
  258. u16 wapi_offset;
  259. u8 *beacon_buf;
  260. u32 beacon_buf_size;
  261. u8 sensed_11h;
  262. u8 local_constraint;
  263. u8 chan_sw_ie_present;
  264. };
  265. struct mwifiex_current_bss_params {
  266. struct mwifiex_bssdescriptor bss_descriptor;
  267. u8 wmm_enabled;
  268. u8 wmm_uapsd_enabled;
  269. u8 band;
  270. u32 num_of_rates;
  271. u8 data_rates[MWIFIEX_SUPPORTED_RATES];
  272. };
  273. struct mwifiex_sleep_params {
  274. u16 sp_error;
  275. u16 sp_offset;
  276. u16 sp_stable_time;
  277. u8 sp_cal_control;
  278. u8 sp_ext_sleep_clk;
  279. u16 sp_reserved;
  280. };
  281. struct mwifiex_sleep_period {
  282. u16 period;
  283. u16 reserved;
  284. };
  285. struct mwifiex_wep_key {
  286. u32 length;
  287. u32 key_index;
  288. u32 key_length;
  289. u8 key_material[MWIFIEX_KEY_BUFFER_SIZE];
  290. };
  291. #define MAX_REGION_CHANNEL_NUM 2
  292. struct mwifiex_chan_freq_power {
  293. u16 channel;
  294. u32 freq;
  295. u16 max_tx_power;
  296. u8 unsupported;
  297. };
  298. enum state_11d_t {
  299. DISABLE_11D = 0,
  300. ENABLE_11D = 1,
  301. };
  302. #define MWIFIEX_MAX_TRIPLET_802_11D 83
  303. struct mwifiex_802_11d_domain_reg {
  304. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  305. u8 no_of_triplet;
  306. struct ieee80211_country_ie_triplet
  307. triplet[MWIFIEX_MAX_TRIPLET_802_11D];
  308. };
  309. struct mwifiex_vendor_spec_cfg_ie {
  310. u16 mask;
  311. u16 flag;
  312. u8 ie[MWIFIEX_MAX_VSIE_LEN];
  313. };
  314. struct wps {
  315. u8 session_enable;
  316. };
  317. struct mwifiex_roc_cfg {
  318. u64 cookie;
  319. struct ieee80211_channel chan;
  320. };
  321. struct mwifiex_adapter;
  322. struct mwifiex_private;
  323. struct mwifiex_private {
  324. struct mwifiex_adapter *adapter;
  325. u8 bss_type;
  326. u8 bss_role;
  327. u8 bss_priority;
  328. u8 bss_num;
  329. u8 bss_started;
  330. u8 frame_type;
  331. u8 curr_addr[ETH_ALEN];
  332. u8 media_connected;
  333. u32 num_tx_timeout;
  334. /* track consecutive timeout */
  335. u8 tx_timeout_cnt;
  336. struct net_device *netdev;
  337. struct net_device_stats stats;
  338. u16 curr_pkt_filter;
  339. u32 bss_mode;
  340. u32 pkt_tx_ctrl;
  341. u16 tx_power_level;
  342. u8 max_tx_power_level;
  343. u8 min_tx_power_level;
  344. u8 tx_rate;
  345. u8 tx_htinfo;
  346. u8 rxpd_htinfo;
  347. u8 rxpd_rate;
  348. u16 rate_bitmap;
  349. u16 bitmap_rates[MAX_BITMAP_RATES_SIZE];
  350. u32 data_rate;
  351. u8 is_data_rate_auto;
  352. u16 bcn_avg_factor;
  353. u16 data_avg_factor;
  354. s16 data_rssi_last;
  355. s16 data_nf_last;
  356. s16 data_rssi_avg;
  357. s16 data_nf_avg;
  358. s16 bcn_rssi_last;
  359. s16 bcn_nf_last;
  360. s16 bcn_rssi_avg;
  361. s16 bcn_nf_avg;
  362. struct mwifiex_bssdescriptor *attempted_bss_desc;
  363. struct cfg80211_ssid prev_ssid;
  364. u8 prev_bssid[ETH_ALEN];
  365. struct mwifiex_current_bss_params curr_bss_params;
  366. u16 beacon_period;
  367. u8 dtim_period;
  368. u16 listen_interval;
  369. u16 atim_window;
  370. u8 adhoc_channel;
  371. u8 adhoc_is_link_sensed;
  372. u8 adhoc_state;
  373. struct mwifiex_802_11_security sec_info;
  374. struct mwifiex_wep_key wep_key[NUM_WEP_KEYS];
  375. u16 wep_key_curr_index;
  376. u8 wpa_ie[256];
  377. u8 wpa_ie_len;
  378. u8 wpa_is_gtk_set;
  379. struct host_cmd_ds_802_11_key_material aes_key;
  380. u8 wapi_ie[256];
  381. u8 wapi_ie_len;
  382. u8 *wps_ie;
  383. u8 wps_ie_len;
  384. u8 wmm_required;
  385. u8 wmm_enabled;
  386. u8 wmm_qosinfo;
  387. struct mwifiex_wmm_desc wmm;
  388. atomic_t wmm_tx_pending[IEEE80211_NUM_ACS];
  389. struct list_head sta_list;
  390. /* spin lock for associated station list */
  391. spinlock_t sta_list_spinlock;
  392. struct list_head tx_ba_stream_tbl_ptr;
  393. /* spin lock for tx_ba_stream_tbl_ptr queue */
  394. spinlock_t tx_ba_stream_tbl_lock;
  395. struct mwifiex_tx_aggr aggr_prio_tbl[MAX_NUM_TID];
  396. struct mwifiex_add_ba_param add_ba_param;
  397. u16 rx_seq[MAX_NUM_TID];
  398. struct list_head rx_reorder_tbl_ptr;
  399. /* spin lock for rx_reorder_tbl_ptr queue */
  400. spinlock_t rx_reorder_tbl_lock;
  401. /* spin lock for Rx packets */
  402. spinlock_t rx_pkt_lock;
  403. #define MWIFIEX_ASSOC_RSP_BUF_SIZE 500
  404. u8 assoc_rsp_buf[MWIFIEX_ASSOC_RSP_BUF_SIZE];
  405. u32 assoc_rsp_size;
  406. #define MWIFIEX_GENIE_BUF_SIZE 256
  407. u8 gen_ie_buf[MWIFIEX_GENIE_BUF_SIZE];
  408. u8 gen_ie_buf_len;
  409. struct mwifiex_vendor_spec_cfg_ie vs_ie[MWIFIEX_MAX_VSIE_NUM];
  410. #define MWIFIEX_ASSOC_TLV_BUF_SIZE 256
  411. u8 assoc_tlv_buf[MWIFIEX_ASSOC_TLV_BUF_SIZE];
  412. u8 assoc_tlv_buf_len;
  413. u8 *curr_bcn_buf;
  414. u32 curr_bcn_size;
  415. /* spin lock for beacon buffer */
  416. spinlock_t curr_bcn_buf_lock;
  417. struct wireless_dev *wdev;
  418. struct mwifiex_chan_freq_power cfp;
  419. char version_str[128];
  420. #ifdef CONFIG_DEBUG_FS
  421. struct dentry *dfs_dev_dir;
  422. #endif
  423. u8 nick_name[16];
  424. u16 current_key_index;
  425. struct semaphore async_sem;
  426. u8 report_scan_result;
  427. struct cfg80211_scan_request *scan_request;
  428. u8 cfg_bssid[6];
  429. struct wps wps;
  430. u8 scan_block;
  431. s32 cqm_rssi_thold;
  432. u32 cqm_rssi_hyst;
  433. u8 subsc_evt_rssi_state;
  434. struct mwifiex_ds_misc_subsc_evt async_subsc_evt_storage;
  435. struct mwifiex_ie mgmt_ie[MAX_MGMT_IE_INDEX];
  436. u16 beacon_idx;
  437. u16 proberesp_idx;
  438. u16 assocresp_idx;
  439. u16 rsn_idx;
  440. struct timer_list scan_delay_timer;
  441. u8 ap_11n_enabled;
  442. u8 ap_11ac_enabled;
  443. u32 mgmt_frame_mask;
  444. struct mwifiex_roc_cfg roc_cfg;
  445. bool scan_aborting;
  446. u8 csa_chan;
  447. unsigned long csa_expire_time;
  448. u8 del_list_idx;
  449. bool hs2_enabled;
  450. };
  451. enum mwifiex_ba_status {
  452. BA_SETUP_NONE = 0,
  453. BA_SETUP_INPROGRESS,
  454. BA_SETUP_COMPLETE
  455. };
  456. struct mwifiex_tx_ba_stream_tbl {
  457. struct list_head list;
  458. int tid;
  459. u8 ra[ETH_ALEN];
  460. enum mwifiex_ba_status ba_status;
  461. };
  462. struct mwifiex_rx_reorder_tbl;
  463. struct reorder_tmr_cnxt {
  464. struct timer_list timer;
  465. struct mwifiex_rx_reorder_tbl *ptr;
  466. struct mwifiex_private *priv;
  467. };
  468. struct mwifiex_rx_reorder_tbl {
  469. struct list_head list;
  470. int tid;
  471. u8 ta[ETH_ALEN];
  472. int start_win;
  473. int win_size;
  474. void **rx_reorder_ptr;
  475. struct reorder_tmr_cnxt timer_context;
  476. u8 flags;
  477. };
  478. struct mwifiex_bss_prio_node {
  479. struct list_head list;
  480. struct mwifiex_private *priv;
  481. };
  482. struct mwifiex_bss_prio_tbl {
  483. struct list_head bss_prio_head;
  484. /* spin lock for bss priority */
  485. spinlock_t bss_prio_lock;
  486. struct mwifiex_bss_prio_node *bss_prio_cur;
  487. };
  488. struct cmd_ctrl_node {
  489. struct list_head list;
  490. struct mwifiex_private *priv;
  491. u32 cmd_oid;
  492. u32 cmd_flag;
  493. struct sk_buff *cmd_skb;
  494. struct sk_buff *resp_skb;
  495. void *data_buf;
  496. u32 wait_q_enabled;
  497. struct sk_buff *skb;
  498. u8 *condition;
  499. u8 cmd_wait_q_woken;
  500. };
  501. struct mwifiex_bss_priv {
  502. u8 band;
  503. u64 fw_tsf;
  504. };
  505. /* This is AP specific structure which stores information
  506. * about associated STA
  507. */
  508. struct mwifiex_sta_node {
  509. struct list_head list;
  510. u8 mac_addr[ETH_ALEN];
  511. u8 is_wmm_enabled;
  512. u8 is_11n_enabled;
  513. u8 ampdu_sta[MAX_NUM_TID];
  514. u16 rx_seq[MAX_NUM_TID];
  515. u16 max_amsdu;
  516. };
  517. struct mwifiex_if_ops {
  518. int (*init_if) (struct mwifiex_adapter *);
  519. void (*cleanup_if) (struct mwifiex_adapter *);
  520. int (*check_fw_status) (struct mwifiex_adapter *, u32);
  521. int (*prog_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
  522. int (*register_dev) (struct mwifiex_adapter *);
  523. void (*unregister_dev) (struct mwifiex_adapter *);
  524. int (*enable_int) (struct mwifiex_adapter *);
  525. void (*disable_int) (struct mwifiex_adapter *);
  526. int (*process_int_status) (struct mwifiex_adapter *);
  527. int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *,
  528. struct mwifiex_tx_param *);
  529. int (*wakeup) (struct mwifiex_adapter *);
  530. int (*wakeup_complete) (struct mwifiex_adapter *);
  531. /* Interface specific functions */
  532. void (*update_mp_end_port) (struct mwifiex_adapter *, u16);
  533. void (*cleanup_mpa_buf) (struct mwifiex_adapter *);
  534. int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *);
  535. int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *);
  536. int (*data_complete) (struct mwifiex_adapter *, struct sk_buff *);
  537. int (*init_fw_port) (struct mwifiex_adapter *);
  538. int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
  539. void (*card_reset) (struct mwifiex_adapter *);
  540. int (*clean_pcie_ring) (struct mwifiex_adapter *adapter);
  541. };
  542. struct mwifiex_adapter {
  543. u8 iface_type;
  544. struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM];
  545. u8 priv_num;
  546. const struct firmware *firmware;
  547. char fw_name[32];
  548. int winner;
  549. struct device *dev;
  550. struct wiphy *wiphy;
  551. bool surprise_removed;
  552. u32 fw_release_number;
  553. u16 init_wait_q_woken;
  554. wait_queue_head_t init_wait_q;
  555. void *card;
  556. struct mwifiex_if_ops if_ops;
  557. atomic_t rx_pending;
  558. atomic_t tx_pending;
  559. atomic_t cmd_pending;
  560. struct workqueue_struct *workqueue;
  561. struct work_struct main_work;
  562. struct mwifiex_bss_prio_tbl bss_prio_tbl[MWIFIEX_MAX_BSS_NUM];
  563. /* spin lock for init/shutdown */
  564. spinlock_t mwifiex_lock;
  565. /* spin lock for main process */
  566. spinlock_t main_proc_lock;
  567. u32 mwifiex_processing;
  568. u16 tx_buf_size;
  569. u16 curr_tx_buf_size;
  570. u32 ioport;
  571. enum MWIFIEX_HARDWARE_STATUS hw_status;
  572. u16 number_of_antenna;
  573. u32 fw_cap_info;
  574. /* spin lock for interrupt handling */
  575. spinlock_t int_lock;
  576. u8 int_status;
  577. u32 event_cause;
  578. struct sk_buff *event_skb;
  579. u8 upld_buf[MWIFIEX_UPLD_SIZE];
  580. u8 data_sent;
  581. u8 cmd_sent;
  582. u8 cmd_resp_received;
  583. u8 event_received;
  584. u8 data_received;
  585. u16 seq_num;
  586. struct cmd_ctrl_node *cmd_pool;
  587. struct cmd_ctrl_node *curr_cmd;
  588. /* spin lock for command */
  589. spinlock_t mwifiex_cmd_lock;
  590. u32 num_cmd_timeout;
  591. u16 last_init_cmd;
  592. struct timer_list cmd_timer;
  593. struct list_head cmd_free_q;
  594. /* spin lock for cmd_free_q */
  595. spinlock_t cmd_free_q_lock;
  596. struct list_head cmd_pending_q;
  597. /* spin lock for cmd_pending_q */
  598. spinlock_t cmd_pending_q_lock;
  599. struct list_head scan_pending_q;
  600. /* spin lock for scan_pending_q */
  601. spinlock_t scan_pending_q_lock;
  602. struct sk_buff_head usb_rx_data_q;
  603. u32 scan_processing;
  604. u16 region_code;
  605. struct mwifiex_802_11d_domain_reg domain_reg;
  606. u16 scan_probes;
  607. u32 scan_mode;
  608. u16 specific_scan_time;
  609. u16 active_scan_time;
  610. u16 passive_scan_time;
  611. u8 fw_bands;
  612. u8 adhoc_start_band;
  613. u8 config_bands;
  614. struct mwifiex_chan_scan_param_set *scan_channels;
  615. u8 tx_lock_flag;
  616. struct mwifiex_sleep_params sleep_params;
  617. struct mwifiex_sleep_period sleep_period;
  618. u16 ps_mode;
  619. u32 ps_state;
  620. u8 need_to_wakeup;
  621. u16 multiple_dtim;
  622. u16 local_listen_interval;
  623. u16 null_pkt_interval;
  624. struct sk_buff *sleep_cfm;
  625. u16 bcn_miss_time_out;
  626. u16 adhoc_awake_period;
  627. u8 is_deep_sleep;
  628. u8 delay_null_pkt;
  629. u16 delay_to_ps;
  630. u16 enhanced_ps_mode;
  631. u8 pm_wakeup_card_req;
  632. u16 gen_null_pkt;
  633. u16 pps_uapsd_mode;
  634. u32 pm_wakeup_fw_try;
  635. u8 is_hs_configured;
  636. struct mwifiex_hs_config_param hs_cfg;
  637. u8 hs_activated;
  638. u16 hs_activate_wait_q_woken;
  639. wait_queue_head_t hs_activate_wait_q;
  640. bool is_suspended;
  641. u8 event_body[MAX_EVENT_SIZE];
  642. u32 hw_dot_11n_dev_cap;
  643. u8 hw_dev_mcs_support;
  644. u8 adhoc_11n_enabled;
  645. u8 sec_chan_offset;
  646. struct mwifiex_dbg dbg;
  647. u8 arp_filter[ARP_FILTER_MAX_BUF_SIZE];
  648. u32 arp_filter_size;
  649. u16 cmd_wait_q_required;
  650. struct mwifiex_wait_queue cmd_wait_q;
  651. u8 scan_wait_q_woken;
  652. spinlock_t queue_lock; /* lock for tx queues */
  653. struct completion fw_load;
  654. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  655. u16 max_mgmt_ie_index;
  656. u8 scan_delay_cnt;
  657. u8 empty_tx_q_cnt;
  658. const struct firmware *cal_data;
  659. /* 11AC */
  660. u32 is_hw_11ac_capable;
  661. u32 hw_dot_11ac_dev_cap;
  662. u32 hw_dot_11ac_mcs_support;
  663. u32 usr_dot_11ac_dev_cap_bg;
  664. u32 usr_dot_11ac_dev_cap_a;
  665. u32 usr_dot_11ac_mcs_support;
  666. atomic_t is_tx_received;
  667. atomic_t pending_bridged_pkts;
  668. struct semaphore *card_sem;
  669. };
  670. int mwifiex_init_lock_list(struct mwifiex_adapter *adapter);
  671. void mwifiex_set_trans_start(struct net_device *dev);
  672. void mwifiex_stop_net_dev_queue(struct net_device *netdev,
  673. struct mwifiex_adapter *adapter);
  674. void mwifiex_wake_up_net_dev_queue(struct net_device *netdev,
  675. struct mwifiex_adapter *adapter);
  676. int mwifiex_init_priv(struct mwifiex_private *priv);
  677. void mwifiex_free_priv(struct mwifiex_private *priv);
  678. int mwifiex_init_fw(struct mwifiex_adapter *adapter);
  679. int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter);
  680. int mwifiex_shutdown_drv(struct mwifiex_adapter *adapter);
  681. int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter);
  682. int mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *);
  683. int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb);
  684. int mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
  685. struct sk_buff *skb);
  686. int mwifiex_process_event(struct mwifiex_adapter *adapter);
  687. int mwifiex_complete_cmd(struct mwifiex_adapter *adapter,
  688. struct cmd_ctrl_node *cmd_node);
  689. int mwifiex_send_cmd_async(struct mwifiex_private *priv, uint16_t cmd_no,
  690. u16 cmd_action, u32 cmd_oid, void *data_buf);
  691. int mwifiex_send_cmd_sync(struct mwifiex_private *priv, uint16_t cmd_no,
  692. u16 cmd_action, u32 cmd_oid, void *data_buf);
  693. void mwifiex_cmd_timeout_func(unsigned long function_context);
  694. int mwifiex_get_debug_info(struct mwifiex_private *,
  695. struct mwifiex_debug_info *);
  696. int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter);
  697. int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter);
  698. void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter);
  699. void mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter);
  700. void mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter *adapter,
  701. struct cmd_ctrl_node *cmd_node);
  702. void mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter,
  703. struct cmd_ctrl_node *cmd_node);
  704. void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
  705. struct cmd_ctrl_node *cmd_node,
  706. u32 addtail);
  707. int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter);
  708. int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter);
  709. int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
  710. struct sk_buff *skb);
  711. int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
  712. struct mwifiex_tx_param *tx_param);
  713. int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags);
  714. int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
  715. struct sk_buff *skb, int aggr, int status);
  716. void mwifiex_clean_txrx(struct mwifiex_private *priv);
  717. u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv);
  718. void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter);
  719. void mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *, u8 *,
  720. u32);
  721. int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
  722. struct host_cmd_ds_command *cmd,
  723. u16 cmd_action, uint16_t ps_bitmap,
  724. struct mwifiex_ds_auto_ds *auto_ds);
  725. int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
  726. struct host_cmd_ds_command *resp,
  727. struct mwifiex_ds_pm_cfg *pm_cfg);
  728. void mwifiex_process_hs_config(struct mwifiex_adapter *adapter);
  729. void mwifiex_hs_activated_event(struct mwifiex_private *priv,
  730. u8 activated);
  731. int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv,
  732. struct host_cmd_ds_command *resp);
  733. int mwifiex_process_rx_packet(struct mwifiex_private *priv,
  734. struct sk_buff *skb);
  735. int mwifiex_sta_prepare_cmd(struct mwifiex_private *, uint16_t cmd_no,
  736. u16 cmd_action, u32 cmd_oid,
  737. void *data_buf, void *cmd_buf);
  738. int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
  739. u16 cmd_action, u32 cmd_oid,
  740. void *data_buf, void *cmd_buf);
  741. int mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no,
  742. struct host_cmd_ds_command *resp);
  743. int mwifiex_process_sta_rx_packet(struct mwifiex_private *,
  744. struct sk_buff *skb);
  745. int mwifiex_process_uap_rx_packet(struct mwifiex_private *priv,
  746. struct sk_buff *skb);
  747. int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv,
  748. struct sk_buff *skb);
  749. int mwifiex_process_sta_event(struct mwifiex_private *);
  750. int mwifiex_process_uap_event(struct mwifiex_private *);
  751. struct mwifiex_sta_node *
  752. mwifiex_get_sta_entry(struct mwifiex_private *priv, u8 *mac);
  753. void mwifiex_delete_all_station_list(struct mwifiex_private *priv);
  754. void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb);
  755. void *mwifiex_process_uap_txpd(struct mwifiex_private *, struct sk_buff *skb);
  756. int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta);
  757. int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd,
  758. struct mwifiex_scan_cmd_config *scan_cfg);
  759. void mwifiex_queue_scan_cmd(struct mwifiex_private *priv,
  760. struct cmd_ctrl_node *cmd_node);
  761. int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
  762. struct host_cmd_ds_command *resp);
  763. s32 mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2);
  764. int mwifiex_associate(struct mwifiex_private *priv,
  765. struct mwifiex_bssdescriptor *bss_desc);
  766. int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
  767. struct host_cmd_ds_command *cmd,
  768. struct mwifiex_bssdescriptor *bss_desc);
  769. int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
  770. struct host_cmd_ds_command *resp);
  771. void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason);
  772. u8 mwifiex_band_to_radio_type(u8 band);
  773. int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac);
  774. int mwifiex_adhoc_start(struct mwifiex_private *priv,
  775. struct cfg80211_ssid *adhoc_ssid);
  776. int mwifiex_adhoc_join(struct mwifiex_private *priv,
  777. struct mwifiex_bssdescriptor *bss_desc);
  778. int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
  779. struct host_cmd_ds_command *cmd,
  780. struct cfg80211_ssid *req_ssid);
  781. int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
  782. struct host_cmd_ds_command *cmd,
  783. struct mwifiex_bssdescriptor *bss_desc);
  784. int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
  785. struct host_cmd_ds_command *resp);
  786. int mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command *cmd);
  787. struct mwifiex_chan_freq_power *mwifiex_get_cfp(struct mwifiex_private *priv,
  788. u8 band, u16 channel, u32 freq);
  789. u32 mwifiex_index_to_data_rate(struct mwifiex_private *priv,
  790. u8 index, u8 ht_info);
  791. u32 mwifiex_index_to_acs_data_rate(struct mwifiex_private *priv,
  792. u8 index, u8 ht_info);
  793. u32 mwifiex_find_freq_from_band_chan(u8, u8);
  794. int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv, u16 vsie_mask,
  795. u8 **buffer);
  796. u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv,
  797. u8 *rates);
  798. u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates);
  799. u32 mwifiex_get_rates_from_cfg80211(struct mwifiex_private *priv,
  800. u8 *rates, u8 radio_type);
  801. u8 mwifiex_is_rate_auto(struct mwifiex_private *priv);
  802. extern u16 region_code_index[MWIFIEX_MAX_REGION_CODE];
  803. void mwifiex_save_curr_bcn(struct mwifiex_private *priv);
  804. void mwifiex_free_curr_bcn(struct mwifiex_private *priv);
  805. int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv,
  806. struct host_cmd_ds_command *cmd);
  807. int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
  808. struct host_cmd_ds_command *resp);
  809. int is_command_pending(struct mwifiex_adapter *adapter);
  810. void mwifiex_init_priv_params(struct mwifiex_private *priv,
  811. struct net_device *dev);
  812. int mwifiex_set_secure_params(struct mwifiex_private *priv,
  813. struct mwifiex_uap_bss_param *bss_config,
  814. struct cfg80211_ap_settings *params);
  815. void mwifiex_set_ht_params(struct mwifiex_private *priv,
  816. struct mwifiex_uap_bss_param *bss_cfg,
  817. struct cfg80211_ap_settings *params);
  818. void mwifiex_set_vht_params(struct mwifiex_private *priv,
  819. struct mwifiex_uap_bss_param *bss_cfg,
  820. struct cfg80211_ap_settings *params);
  821. void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg,
  822. struct cfg80211_ap_settings *params);
  823. void mwifiex_set_vht_width(struct mwifiex_private *priv,
  824. enum nl80211_chan_width width,
  825. bool ap_11ac_disable);
  826. void
  827. mwifiex_set_wmm_params(struct mwifiex_private *priv,
  828. struct mwifiex_uap_bss_param *bss_cfg,
  829. struct cfg80211_ap_settings *params);
  830. void mwifiex_set_ba_params(struct mwifiex_private *priv);
  831. void mwifiex_set_11ac_ba_params(struct mwifiex_private *priv);
  832. /*
  833. * This function checks if the queuing is RA based or not.
  834. */
  835. static inline u8
  836. mwifiex_queuing_ra_based(struct mwifiex_private *priv)
  837. {
  838. /*
  839. * Currently we assume if we are in Infra, then DA=RA. This might not be
  840. * true in the future
  841. */
  842. if ((priv->bss_mode == NL80211_IFTYPE_STATION) &&
  843. (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA))
  844. return false;
  845. return true;
  846. }
  847. /*
  848. * This function copies rates.
  849. */
  850. static inline u32
  851. mwifiex_copy_rates(u8 *dest, u32 pos, u8 *src, int len)
  852. {
  853. int i;
  854. for (i = 0; i < len && src[i]; i++, pos++) {
  855. if (pos >= MWIFIEX_SUPPORTED_RATES)
  856. break;
  857. dest[pos] = src[i];
  858. }
  859. return pos;
  860. }
  861. /*
  862. * This function returns the correct private structure pointer based
  863. * upon the BSS type and BSS number.
  864. */
  865. static inline struct mwifiex_private *
  866. mwifiex_get_priv_by_id(struct mwifiex_adapter *adapter,
  867. u8 bss_num, u8 bss_type)
  868. {
  869. int i;
  870. for (i = 0; i < adapter->priv_num; i++) {
  871. if (adapter->priv[i]) {
  872. if ((adapter->priv[i]->bss_num == bss_num) &&
  873. (adapter->priv[i]->bss_type == bss_type))
  874. break;
  875. }
  876. }
  877. return ((i < adapter->priv_num) ? adapter->priv[i] : NULL);
  878. }
  879. /*
  880. * This function returns the first available private structure pointer
  881. * based upon the BSS role.
  882. */
  883. static inline struct mwifiex_private *
  884. mwifiex_get_priv(struct mwifiex_adapter *adapter,
  885. enum mwifiex_bss_role bss_role)
  886. {
  887. int i;
  888. for (i = 0; i < adapter->priv_num; i++) {
  889. if (adapter->priv[i]) {
  890. if (bss_role == MWIFIEX_BSS_ROLE_ANY ||
  891. GET_BSS_ROLE(adapter->priv[i]) == bss_role)
  892. break;
  893. }
  894. }
  895. return ((i < adapter->priv_num) ? adapter->priv[i] : NULL);
  896. }
  897. /*
  898. * This function returns the driver private structure of a network device.
  899. */
  900. static inline struct mwifiex_private *
  901. mwifiex_netdev_get_priv(struct net_device *dev)
  902. {
  903. return (struct mwifiex_private *) (*(unsigned long *) netdev_priv(dev));
  904. }
  905. /*
  906. * This function checks if a skb holds a management frame.
  907. */
  908. static inline bool mwifiex_is_skb_mgmt_frame(struct sk_buff *skb)
  909. {
  910. return (le32_to_cpu(*(__le32 *)skb->data) == PKT_TYPE_MGMT);
  911. }
  912. /* This function retrieves channel closed for operation by Channel
  913. * Switch Announcement.
  914. */
  915. static inline u8
  916. mwifiex_11h_get_csa_closed_channel(struct mwifiex_private *priv)
  917. {
  918. if (!priv->csa_chan)
  919. return 0;
  920. /* Clear csa channel, if DFS channel move time has passed */
  921. if (jiffies > priv->csa_expire_time) {
  922. priv->csa_chan = 0;
  923. priv->csa_expire_time = 0;
  924. }
  925. return priv->csa_chan;
  926. }
  927. int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
  928. u32 func_init_shutdown);
  929. int mwifiex_add_card(void *, struct semaphore *, struct mwifiex_if_ops *, u8);
  930. int mwifiex_remove_card(struct mwifiex_adapter *, struct semaphore *);
  931. void mwifiex_get_version(struct mwifiex_adapter *adapter, char *version,
  932. int maxlen);
  933. int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
  934. struct mwifiex_multicast_list *mcast_list);
  935. int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
  936. struct net_device *dev);
  937. int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter,
  938. struct cmd_ctrl_node *cmd_queued);
  939. int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
  940. struct cfg80211_ssid *req_ssid);
  941. int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type);
  942. int mwifiex_enable_hs(struct mwifiex_adapter *adapter);
  943. int mwifiex_disable_auto_ds(struct mwifiex_private *priv);
  944. int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, u32 *rate);
  945. int mwifiex_request_scan(struct mwifiex_private *priv,
  946. struct cfg80211_ssid *req_ssid);
  947. int mwifiex_scan_networks(struct mwifiex_private *priv,
  948. const struct mwifiex_user_scan_cfg *user_scan_in);
  949. int mwifiex_set_radio(struct mwifiex_private *priv, u8 option);
  950. int mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp,
  951. const u8 *key, int key_len, u8 key_index,
  952. const u8 *mac_addr, int disable);
  953. int mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len);
  954. int mwifiex_get_ver_ext(struct mwifiex_private *priv);
  955. int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
  956. struct ieee80211_channel *chan,
  957. unsigned int duration);
  958. int mwifiex_set_bss_role(struct mwifiex_private *priv, u8 bss_role);
  959. int mwifiex_get_stats_info(struct mwifiex_private *priv,
  960. struct mwifiex_ds_get_stats *log);
  961. int mwifiex_reg_write(struct mwifiex_private *priv, u32 reg_type,
  962. u32 reg_offset, u32 reg_value);
  963. int mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type,
  964. u32 reg_offset, u32 *value);
  965. int mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes,
  966. u8 *value);
  967. int mwifiex_set_11n_httx_cfg(struct mwifiex_private *priv, int data);
  968. int mwifiex_get_11n_httx_cfg(struct mwifiex_private *priv, int *data);
  969. int mwifiex_set_tx_rate_cfg(struct mwifiex_private *priv, int tx_rate_index);
  970. int mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_index);
  971. int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode);
  972. int mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter,
  973. char *version, int max_len);
  974. int mwifiex_set_tx_power(struct mwifiex_private *priv,
  975. struct mwifiex_power_cfg *power_cfg);
  976. int mwifiex_main_process(struct mwifiex_adapter *);
  977. int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb);
  978. int mwifiex_get_bss_info(struct mwifiex_private *,
  979. struct mwifiex_bss_info *);
  980. int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
  981. struct cfg80211_bss *bss,
  982. struct mwifiex_bssdescriptor *bss_desc);
  983. int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
  984. struct mwifiex_bssdescriptor *bss_entry);
  985. int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
  986. struct mwifiex_bssdescriptor *bss_desc);
  987. u8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type);
  988. struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
  989. const char *name,
  990. enum nl80211_iftype type,
  991. u32 *flags,
  992. struct vif_params *params);
  993. int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev);
  994. void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config);
  995. int mwifiex_add_wowlan_magic_pkt_filter(struct mwifiex_adapter *adapter);
  996. int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
  997. struct cfg80211_beacon_data *data);
  998. int mwifiex_del_mgmt_ies(struct mwifiex_private *priv);
  999. u8 *mwifiex_11d_code_2_region(u8 code);
  1000. void mwifiex_uap_del_sta_data(struct mwifiex_private *priv,
  1001. struct mwifiex_sta_node *node);
  1002. void mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer,
  1003. struct mwifiex_bssdescriptor *bss_desc);
  1004. int mwifiex_11h_handle_event_chanswann(struct mwifiex_private *priv);
  1005. extern const struct ethtool_ops mwifiex_ethtool_ops;
  1006. #ifdef CONFIG_DEBUG_FS
  1007. void mwifiex_debugfs_init(void);
  1008. void mwifiex_debugfs_remove(void);
  1009. void mwifiex_dev_debugfs_init(struct mwifiex_private *priv);
  1010. void mwifiex_dev_debugfs_remove(struct mwifiex_private *priv);
  1011. #endif
  1012. #endif /* !_MWIFIEX_MAIN_H_ */