main.h 32 KB

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