main.h 32 KB

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