main.h 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159
  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. };
  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. };
  449. enum mwifiex_ba_status {
  450. BA_SETUP_NONE = 0,
  451. BA_SETUP_INPROGRESS,
  452. BA_SETUP_COMPLETE
  453. };
  454. struct mwifiex_tx_ba_stream_tbl {
  455. struct list_head list;
  456. int tid;
  457. u8 ra[ETH_ALEN];
  458. enum mwifiex_ba_status ba_status;
  459. };
  460. struct mwifiex_rx_reorder_tbl;
  461. struct reorder_tmr_cnxt {
  462. struct timer_list timer;
  463. struct mwifiex_rx_reorder_tbl *ptr;
  464. struct mwifiex_private *priv;
  465. };
  466. struct mwifiex_rx_reorder_tbl {
  467. struct list_head list;
  468. int tid;
  469. u8 ta[ETH_ALEN];
  470. int start_win;
  471. int win_size;
  472. void **rx_reorder_ptr;
  473. struct reorder_tmr_cnxt timer_context;
  474. u8 flags;
  475. };
  476. struct mwifiex_bss_prio_node {
  477. struct list_head list;
  478. struct mwifiex_private *priv;
  479. };
  480. struct mwifiex_bss_prio_tbl {
  481. struct list_head bss_prio_head;
  482. /* spin lock for bss priority */
  483. spinlock_t bss_prio_lock;
  484. struct mwifiex_bss_prio_node *bss_prio_cur;
  485. };
  486. struct cmd_ctrl_node {
  487. struct list_head list;
  488. struct mwifiex_private *priv;
  489. u32 cmd_oid;
  490. u32 cmd_flag;
  491. struct sk_buff *cmd_skb;
  492. struct sk_buff *resp_skb;
  493. void *data_buf;
  494. u32 wait_q_enabled;
  495. struct sk_buff *skb;
  496. u8 *condition;
  497. u8 cmd_wait_q_woken;
  498. };
  499. struct mwifiex_bss_priv {
  500. u8 band;
  501. u64 fw_tsf;
  502. };
  503. /* This is AP specific structure which stores information
  504. * about associated STA
  505. */
  506. struct mwifiex_sta_node {
  507. struct list_head list;
  508. u8 mac_addr[ETH_ALEN];
  509. u8 is_wmm_enabled;
  510. u8 is_11n_enabled;
  511. u8 ampdu_sta[MAX_NUM_TID];
  512. u16 rx_seq[MAX_NUM_TID];
  513. u16 max_amsdu;
  514. };
  515. struct mwifiex_if_ops {
  516. int (*init_if) (struct mwifiex_adapter *);
  517. void (*cleanup_if) (struct mwifiex_adapter *);
  518. int (*check_fw_status) (struct mwifiex_adapter *, u32);
  519. int (*prog_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
  520. int (*register_dev) (struct mwifiex_adapter *);
  521. void (*unregister_dev) (struct mwifiex_adapter *);
  522. int (*enable_int) (struct mwifiex_adapter *);
  523. void (*disable_int) (struct mwifiex_adapter *);
  524. int (*process_int_status) (struct mwifiex_adapter *);
  525. int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *,
  526. struct mwifiex_tx_param *);
  527. int (*wakeup) (struct mwifiex_adapter *);
  528. int (*wakeup_complete) (struct mwifiex_adapter *);
  529. /* Interface specific functions */
  530. void (*update_mp_end_port) (struct mwifiex_adapter *, u16);
  531. void (*cleanup_mpa_buf) (struct mwifiex_adapter *);
  532. int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *);
  533. int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *);
  534. int (*data_complete) (struct mwifiex_adapter *, struct sk_buff *);
  535. int (*init_fw_port) (struct mwifiex_adapter *);
  536. int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
  537. void (*card_reset) (struct mwifiex_adapter *);
  538. int (*clean_pcie_ring) (struct mwifiex_adapter *adapter);
  539. };
  540. struct mwifiex_adapter {
  541. u8 iface_type;
  542. struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM];
  543. u8 priv_num;
  544. const struct firmware *firmware;
  545. char fw_name[32];
  546. int winner;
  547. struct device *dev;
  548. struct wiphy *wiphy;
  549. bool surprise_removed;
  550. u32 fw_release_number;
  551. u16 init_wait_q_woken;
  552. wait_queue_head_t init_wait_q;
  553. void *card;
  554. struct mwifiex_if_ops if_ops;
  555. atomic_t rx_pending;
  556. atomic_t tx_pending;
  557. atomic_t cmd_pending;
  558. struct workqueue_struct *workqueue;
  559. struct work_struct main_work;
  560. struct mwifiex_bss_prio_tbl bss_prio_tbl[MWIFIEX_MAX_BSS_NUM];
  561. /* spin lock for init/shutdown */
  562. spinlock_t mwifiex_lock;
  563. /* spin lock for main process */
  564. spinlock_t main_proc_lock;
  565. u32 mwifiex_processing;
  566. u16 tx_buf_size;
  567. u16 curr_tx_buf_size;
  568. u32 ioport;
  569. enum MWIFIEX_HARDWARE_STATUS hw_status;
  570. u16 number_of_antenna;
  571. u32 fw_cap_info;
  572. /* spin lock for interrupt handling */
  573. spinlock_t int_lock;
  574. u8 int_status;
  575. u32 event_cause;
  576. struct sk_buff *event_skb;
  577. u8 upld_buf[MWIFIEX_UPLD_SIZE];
  578. u8 data_sent;
  579. u8 cmd_sent;
  580. u8 cmd_resp_received;
  581. u8 event_received;
  582. u8 data_received;
  583. u16 seq_num;
  584. struct cmd_ctrl_node *cmd_pool;
  585. struct cmd_ctrl_node *curr_cmd;
  586. /* spin lock for command */
  587. spinlock_t mwifiex_cmd_lock;
  588. u32 num_cmd_timeout;
  589. u16 last_init_cmd;
  590. struct timer_list cmd_timer;
  591. struct list_head cmd_free_q;
  592. /* spin lock for cmd_free_q */
  593. spinlock_t cmd_free_q_lock;
  594. struct list_head cmd_pending_q;
  595. /* spin lock for cmd_pending_q */
  596. spinlock_t cmd_pending_q_lock;
  597. struct list_head scan_pending_q;
  598. /* spin lock for scan_pending_q */
  599. spinlock_t scan_pending_q_lock;
  600. struct sk_buff_head usb_rx_data_q;
  601. u32 scan_processing;
  602. u16 region_code;
  603. struct mwifiex_802_11d_domain_reg domain_reg;
  604. u16 scan_probes;
  605. u32 scan_mode;
  606. u16 specific_scan_time;
  607. u16 active_scan_time;
  608. u16 passive_scan_time;
  609. u8 fw_bands;
  610. u8 adhoc_start_band;
  611. u8 config_bands;
  612. struct mwifiex_chan_scan_param_set *scan_channels;
  613. u8 tx_lock_flag;
  614. struct mwifiex_sleep_params sleep_params;
  615. struct mwifiex_sleep_period sleep_period;
  616. u16 ps_mode;
  617. u32 ps_state;
  618. u8 need_to_wakeup;
  619. u16 multiple_dtim;
  620. u16 local_listen_interval;
  621. u16 null_pkt_interval;
  622. struct sk_buff *sleep_cfm;
  623. u16 bcn_miss_time_out;
  624. u16 adhoc_awake_period;
  625. u8 is_deep_sleep;
  626. u8 delay_null_pkt;
  627. u16 delay_to_ps;
  628. u16 enhanced_ps_mode;
  629. u8 pm_wakeup_card_req;
  630. u16 gen_null_pkt;
  631. u16 pps_uapsd_mode;
  632. u32 pm_wakeup_fw_try;
  633. u8 is_hs_configured;
  634. struct mwifiex_hs_config_param hs_cfg;
  635. u8 hs_activated;
  636. u16 hs_activate_wait_q_woken;
  637. wait_queue_head_t hs_activate_wait_q;
  638. bool is_suspended;
  639. u8 event_body[MAX_EVENT_SIZE];
  640. u32 hw_dot_11n_dev_cap;
  641. u8 hw_dev_mcs_support;
  642. u8 adhoc_11n_enabled;
  643. u8 sec_chan_offset;
  644. struct mwifiex_dbg dbg;
  645. u8 arp_filter[ARP_FILTER_MAX_BUF_SIZE];
  646. u32 arp_filter_size;
  647. u16 cmd_wait_q_required;
  648. struct mwifiex_wait_queue cmd_wait_q;
  649. u8 scan_wait_q_woken;
  650. spinlock_t queue_lock; /* lock for tx queues */
  651. struct completion fw_load;
  652. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  653. u16 max_mgmt_ie_index;
  654. u8 scan_delay_cnt;
  655. u8 empty_tx_q_cnt;
  656. const struct firmware *cal_data;
  657. /* 11AC */
  658. u32 is_hw_11ac_capable;
  659. u32 hw_dot_11ac_dev_cap;
  660. u32 hw_dot_11ac_mcs_support;
  661. u32 usr_dot_11ac_dev_cap_bg;
  662. u32 usr_dot_11ac_dev_cap_a;
  663. u32 usr_dot_11ac_mcs_support;
  664. atomic_t is_tx_received;
  665. atomic_t pending_bridged_pkts;
  666. };
  667. int mwifiex_init_lock_list(struct mwifiex_adapter *adapter);
  668. void mwifiex_set_trans_start(struct net_device *dev);
  669. void mwifiex_stop_net_dev_queue(struct net_device *netdev,
  670. struct mwifiex_adapter *adapter);
  671. void mwifiex_wake_up_net_dev_queue(struct net_device *netdev,
  672. struct mwifiex_adapter *adapter);
  673. int mwifiex_init_priv(struct mwifiex_private *priv);
  674. void mwifiex_free_priv(struct mwifiex_private *priv);
  675. int mwifiex_init_fw(struct mwifiex_adapter *adapter);
  676. int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter);
  677. int mwifiex_shutdown_drv(struct mwifiex_adapter *adapter);
  678. int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter);
  679. int mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *);
  680. int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb);
  681. int mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
  682. struct sk_buff *skb);
  683. int mwifiex_process_event(struct mwifiex_adapter *adapter);
  684. int mwifiex_complete_cmd(struct mwifiex_adapter *adapter,
  685. struct cmd_ctrl_node *cmd_node);
  686. int mwifiex_send_cmd_async(struct mwifiex_private *priv, uint16_t cmd_no,
  687. u16 cmd_action, u32 cmd_oid, void *data_buf);
  688. int mwifiex_send_cmd_sync(struct mwifiex_private *priv, uint16_t cmd_no,
  689. u16 cmd_action, u32 cmd_oid, void *data_buf);
  690. void mwifiex_cmd_timeout_func(unsigned long function_context);
  691. int mwifiex_get_debug_info(struct mwifiex_private *,
  692. struct mwifiex_debug_info *);
  693. int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter);
  694. int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter);
  695. void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter);
  696. void mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter);
  697. void mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter *adapter,
  698. struct cmd_ctrl_node *cmd_node);
  699. void mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter,
  700. struct cmd_ctrl_node *cmd_node);
  701. void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
  702. struct cmd_ctrl_node *cmd_node,
  703. u32 addtail);
  704. int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter);
  705. int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter);
  706. int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
  707. struct sk_buff *skb);
  708. int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
  709. struct mwifiex_tx_param *tx_param);
  710. int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags);
  711. int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
  712. struct sk_buff *skb, int aggr, int status);
  713. void mwifiex_clean_txrx(struct mwifiex_private *priv);
  714. u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv);
  715. void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter);
  716. void mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *, u8 *,
  717. u32);
  718. int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
  719. struct host_cmd_ds_command *cmd,
  720. u16 cmd_action, uint16_t ps_bitmap,
  721. struct mwifiex_ds_auto_ds *auto_ds);
  722. int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
  723. struct host_cmd_ds_command *resp,
  724. struct mwifiex_ds_pm_cfg *pm_cfg);
  725. void mwifiex_process_hs_config(struct mwifiex_adapter *adapter);
  726. void mwifiex_hs_activated_event(struct mwifiex_private *priv,
  727. u8 activated);
  728. int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv,
  729. struct host_cmd_ds_command *resp);
  730. int mwifiex_process_rx_packet(struct mwifiex_private *priv,
  731. struct sk_buff *skb);
  732. int mwifiex_sta_prepare_cmd(struct mwifiex_private *, uint16_t cmd_no,
  733. u16 cmd_action, u32 cmd_oid,
  734. void *data_buf, void *cmd_buf);
  735. int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
  736. u16 cmd_action, u32 cmd_oid,
  737. void *data_buf, void *cmd_buf);
  738. int mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no,
  739. struct host_cmd_ds_command *resp);
  740. int mwifiex_process_sta_rx_packet(struct mwifiex_private *,
  741. struct sk_buff *skb);
  742. int mwifiex_process_uap_rx_packet(struct mwifiex_private *priv,
  743. struct sk_buff *skb);
  744. int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv,
  745. struct sk_buff *skb);
  746. int mwifiex_process_sta_event(struct mwifiex_private *);
  747. int mwifiex_process_uap_event(struct mwifiex_private *);
  748. struct mwifiex_sta_node *
  749. mwifiex_get_sta_entry(struct mwifiex_private *priv, u8 *mac);
  750. void mwifiex_delete_all_station_list(struct mwifiex_private *priv);
  751. void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb);
  752. void *mwifiex_process_uap_txpd(struct mwifiex_private *, struct sk_buff *skb);
  753. int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta);
  754. int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd,
  755. struct mwifiex_scan_cmd_config *scan_cfg);
  756. void mwifiex_queue_scan_cmd(struct mwifiex_private *priv,
  757. struct cmd_ctrl_node *cmd_node);
  758. int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
  759. struct host_cmd_ds_command *resp);
  760. s32 mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2);
  761. int mwifiex_associate(struct mwifiex_private *priv,
  762. struct mwifiex_bssdescriptor *bss_desc);
  763. int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
  764. struct host_cmd_ds_command *cmd,
  765. struct mwifiex_bssdescriptor *bss_desc);
  766. int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
  767. struct host_cmd_ds_command *resp);
  768. void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason);
  769. u8 mwifiex_band_to_radio_type(u8 band);
  770. int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac);
  771. int mwifiex_adhoc_start(struct mwifiex_private *priv,
  772. struct cfg80211_ssid *adhoc_ssid);
  773. int mwifiex_adhoc_join(struct mwifiex_private *priv,
  774. struct mwifiex_bssdescriptor *bss_desc);
  775. int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
  776. struct host_cmd_ds_command *cmd,
  777. struct cfg80211_ssid *req_ssid);
  778. int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
  779. struct host_cmd_ds_command *cmd,
  780. struct mwifiex_bssdescriptor *bss_desc);
  781. int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv,
  782. struct host_cmd_ds_command *resp);
  783. int mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command *cmd);
  784. struct mwifiex_chan_freq_power *mwifiex_get_cfp(struct mwifiex_private *priv,
  785. u8 band, u16 channel, u32 freq);
  786. u32 mwifiex_index_to_data_rate(struct mwifiex_private *priv,
  787. u8 index, u8 ht_info);
  788. u32 mwifiex_index_to_acs_data_rate(struct mwifiex_private *priv,
  789. u8 index, u8 ht_info);
  790. u32 mwifiex_find_freq_from_band_chan(u8, u8);
  791. int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv, u16 vsie_mask,
  792. u8 **buffer);
  793. u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv,
  794. u8 *rates);
  795. u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates);
  796. u8 mwifiex_is_rate_auto(struct mwifiex_private *priv);
  797. extern u16 region_code_index[MWIFIEX_MAX_REGION_CODE];
  798. void mwifiex_save_curr_bcn(struct mwifiex_private *priv);
  799. void mwifiex_free_curr_bcn(struct mwifiex_private *priv);
  800. int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv,
  801. struct host_cmd_ds_command *cmd);
  802. int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
  803. struct host_cmd_ds_command *resp);
  804. int is_command_pending(struct mwifiex_adapter *adapter);
  805. void mwifiex_init_priv_params(struct mwifiex_private *priv,
  806. struct net_device *dev);
  807. int mwifiex_set_secure_params(struct mwifiex_private *priv,
  808. struct mwifiex_uap_bss_param *bss_config,
  809. struct cfg80211_ap_settings *params);
  810. void mwifiex_set_ht_params(struct mwifiex_private *priv,
  811. struct mwifiex_uap_bss_param *bss_cfg,
  812. struct cfg80211_ap_settings *params);
  813. void mwifiex_set_vht_params(struct mwifiex_private *priv,
  814. struct mwifiex_uap_bss_param *bss_cfg,
  815. struct cfg80211_ap_settings *params);
  816. void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg,
  817. struct cfg80211_ap_settings *params);
  818. void mwifiex_set_vht_width(struct mwifiex_private *priv,
  819. enum nl80211_chan_width width,
  820. bool ap_11ac_disable);
  821. void
  822. mwifiex_set_wmm_params(struct mwifiex_private *priv,
  823. struct mwifiex_uap_bss_param *bss_cfg,
  824. struct cfg80211_ap_settings *params);
  825. void mwifiex_set_ba_params(struct mwifiex_private *priv);
  826. void mwifiex_set_11ac_ba_params(struct mwifiex_private *priv);
  827. /*
  828. * This function checks if the queuing is RA based or not.
  829. */
  830. static inline u8
  831. mwifiex_queuing_ra_based(struct mwifiex_private *priv)
  832. {
  833. /*
  834. * Currently we assume if we are in Infra, then DA=RA. This might not be
  835. * true in the future
  836. */
  837. if ((priv->bss_mode == NL80211_IFTYPE_STATION) &&
  838. (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA))
  839. return false;
  840. return true;
  841. }
  842. /*
  843. * This function copies rates.
  844. */
  845. static inline u32
  846. mwifiex_copy_rates(u8 *dest, u32 pos, u8 *src, int len)
  847. {
  848. int i;
  849. for (i = 0; i < len && src[i]; i++, pos++) {
  850. if (pos >= MWIFIEX_SUPPORTED_RATES)
  851. break;
  852. dest[pos] = src[i];
  853. }
  854. return pos;
  855. }
  856. /*
  857. * This function returns the correct private structure pointer based
  858. * upon the BSS type and BSS number.
  859. */
  860. static inline struct mwifiex_private *
  861. mwifiex_get_priv_by_id(struct mwifiex_adapter *adapter,
  862. u8 bss_num, u8 bss_type)
  863. {
  864. int i;
  865. for (i = 0; i < adapter->priv_num; i++) {
  866. if (adapter->priv[i]) {
  867. if ((adapter->priv[i]->bss_num == bss_num) &&
  868. (adapter->priv[i]->bss_type == bss_type))
  869. break;
  870. }
  871. }
  872. return ((i < adapter->priv_num) ? adapter->priv[i] : NULL);
  873. }
  874. /*
  875. * This function returns the first available private structure pointer
  876. * based upon the BSS role.
  877. */
  878. static inline struct mwifiex_private *
  879. mwifiex_get_priv(struct mwifiex_adapter *adapter,
  880. enum mwifiex_bss_role bss_role)
  881. {
  882. int i;
  883. for (i = 0; i < adapter->priv_num; i++) {
  884. if (adapter->priv[i]) {
  885. if (bss_role == MWIFIEX_BSS_ROLE_ANY ||
  886. GET_BSS_ROLE(adapter->priv[i]) == bss_role)
  887. break;
  888. }
  889. }
  890. return ((i < adapter->priv_num) ? adapter->priv[i] : NULL);
  891. }
  892. /*
  893. * This function returns the driver private structure of a network device.
  894. */
  895. static inline struct mwifiex_private *
  896. mwifiex_netdev_get_priv(struct net_device *dev)
  897. {
  898. return (struct mwifiex_private *) (*(unsigned long *) netdev_priv(dev));
  899. }
  900. /*
  901. * This function checks if a skb holds a management frame.
  902. */
  903. static inline bool mwifiex_is_skb_mgmt_frame(struct sk_buff *skb)
  904. {
  905. return (*(u32 *)skb->data == PKT_TYPE_MGMT);
  906. }
  907. /* This function retrieves channel closed for operation by Channel
  908. * Switch Announcement.
  909. */
  910. static inline u8
  911. mwifiex_11h_get_csa_closed_channel(struct mwifiex_private *priv)
  912. {
  913. if (!priv->csa_chan)
  914. return 0;
  915. /* Clear csa channel, if DFS channel move time has passed */
  916. if (jiffies > priv->csa_expire_time) {
  917. priv->csa_chan = 0;
  918. priv->csa_expire_time = 0;
  919. }
  920. return priv->csa_chan;
  921. }
  922. int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
  923. u32 func_init_shutdown);
  924. int mwifiex_add_card(void *, struct semaphore *, struct mwifiex_if_ops *, u8);
  925. int mwifiex_remove_card(struct mwifiex_adapter *, struct semaphore *);
  926. void mwifiex_get_version(struct mwifiex_adapter *adapter, char *version,
  927. int maxlen);
  928. int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
  929. struct mwifiex_multicast_list *mcast_list);
  930. int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
  931. struct net_device *dev);
  932. int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter,
  933. struct cmd_ctrl_node *cmd_queued);
  934. int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
  935. struct cfg80211_ssid *req_ssid);
  936. int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type);
  937. int mwifiex_enable_hs(struct mwifiex_adapter *adapter);
  938. int mwifiex_disable_auto_ds(struct mwifiex_private *priv);
  939. int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, u32 *rate);
  940. int mwifiex_request_scan(struct mwifiex_private *priv,
  941. struct cfg80211_ssid *req_ssid);
  942. int mwifiex_scan_networks(struct mwifiex_private *priv,
  943. const struct mwifiex_user_scan_cfg *user_scan_in);
  944. int mwifiex_set_radio(struct mwifiex_private *priv, u8 option);
  945. int mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp,
  946. const u8 *key, int key_len, u8 key_index,
  947. const u8 *mac_addr, int disable);
  948. int mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len);
  949. int mwifiex_get_ver_ext(struct mwifiex_private *priv);
  950. int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
  951. struct ieee80211_channel *chan,
  952. unsigned int duration);
  953. int mwifiex_set_bss_role(struct mwifiex_private *priv, u8 bss_role);
  954. int mwifiex_get_stats_info(struct mwifiex_private *priv,
  955. struct mwifiex_ds_get_stats *log);
  956. int mwifiex_reg_write(struct mwifiex_private *priv, u32 reg_type,
  957. u32 reg_offset, u32 reg_value);
  958. int mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type,
  959. u32 reg_offset, u32 *value);
  960. int mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes,
  961. u8 *value);
  962. int mwifiex_set_11n_httx_cfg(struct mwifiex_private *priv, int data);
  963. int mwifiex_get_11n_httx_cfg(struct mwifiex_private *priv, int *data);
  964. int mwifiex_set_tx_rate_cfg(struct mwifiex_private *priv, int tx_rate_index);
  965. int mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_index);
  966. int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode);
  967. int mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter,
  968. char *version, int max_len);
  969. int mwifiex_set_tx_power(struct mwifiex_private *priv,
  970. struct mwifiex_power_cfg *power_cfg);
  971. int mwifiex_main_process(struct mwifiex_adapter *);
  972. int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb);
  973. int mwifiex_get_bss_info(struct mwifiex_private *,
  974. struct mwifiex_bss_info *);
  975. int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
  976. struct cfg80211_bss *bss,
  977. struct mwifiex_bssdescriptor *bss_desc);
  978. int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
  979. struct mwifiex_bssdescriptor *bss_entry);
  980. int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
  981. struct mwifiex_bssdescriptor *bss_desc);
  982. u8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type);
  983. struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
  984. const char *name,
  985. enum nl80211_iftype type,
  986. u32 *flags,
  987. struct vif_params *params);
  988. int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev);
  989. void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config);
  990. int mwifiex_add_wowlan_magic_pkt_filter(struct mwifiex_adapter *adapter);
  991. int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
  992. struct cfg80211_beacon_data *data);
  993. int mwifiex_del_mgmt_ies(struct mwifiex_private *priv);
  994. u8 *mwifiex_11d_code_2_region(u8 code);
  995. void mwifiex_uap_del_sta_data(struct mwifiex_private *priv,
  996. struct mwifiex_sta_node *node);
  997. void mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer,
  998. struct mwifiex_bssdescriptor *bss_desc);
  999. int mwifiex_11h_handle_event_chanswann(struct mwifiex_private *priv);
  1000. extern const struct ethtool_ops mwifiex_ethtool_ops;
  1001. #ifdef CONFIG_DEBUG_FS
  1002. void mwifiex_debugfs_init(void);
  1003. void mwifiex_debugfs_remove(void);
  1004. void mwifiex_dev_debugfs_init(struct mwifiex_private *priv);
  1005. void mwifiex_dev_debugfs_remove(struct mwifiex_private *priv);
  1006. #endif
  1007. #endif /* !_MWIFIEX_MAIN_H_ */