main.h 33 KB

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