ioctl.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. /*
  2. * Marvell Wireless LAN device driver: ioctl data structures & APIs
  3. *
  4. * Copyright (C) 2011-2014, 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_IOCTL_H_
  20. #define _MWIFIEX_IOCTL_H_
  21. #include <net/lib80211.h>
  22. enum {
  23. MWIFIEX_SCAN_TYPE_UNCHANGED = 0,
  24. MWIFIEX_SCAN_TYPE_ACTIVE,
  25. MWIFIEX_SCAN_TYPE_PASSIVE
  26. };
  27. struct mwifiex_user_scan {
  28. u32 scan_cfg_len;
  29. u8 scan_cfg_buf[1];
  30. };
  31. #define MWIFIEX_PROMISC_MODE 1
  32. #define MWIFIEX_MULTICAST_MODE 2
  33. #define MWIFIEX_ALL_MULTI_MODE 4
  34. #define MWIFIEX_MAX_MULTICAST_LIST_SIZE 32
  35. struct mwifiex_multicast_list {
  36. u32 mode;
  37. u32 num_multicast_addr;
  38. u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
  39. };
  40. struct mwifiex_chan_freq {
  41. u32 channel;
  42. u32 freq;
  43. };
  44. struct mwifiex_ssid_bssid {
  45. struct cfg80211_ssid ssid;
  46. u8 bssid[ETH_ALEN];
  47. };
  48. enum {
  49. BAND_B = 1,
  50. BAND_G = 2,
  51. BAND_A = 4,
  52. BAND_GN = 8,
  53. BAND_AN = 16,
  54. BAND_AAC = 32,
  55. };
  56. #define MWIFIEX_WPA_PASSHPHRASE_LEN 64
  57. struct wpa_param {
  58. u8 pairwise_cipher_wpa;
  59. u8 pairwise_cipher_wpa2;
  60. u8 group_cipher;
  61. u32 length;
  62. u8 passphrase[MWIFIEX_WPA_PASSHPHRASE_LEN];
  63. };
  64. struct wep_key {
  65. u8 key_index;
  66. u8 is_default;
  67. u16 length;
  68. u8 key[WLAN_KEY_LEN_WEP104];
  69. };
  70. #define KEY_MGMT_ON_HOST 0x03
  71. #define MWIFIEX_AUTH_MODE_AUTO 0xFF
  72. #define BAND_CONFIG_BG 0x00
  73. #define BAND_CONFIG_A 0x01
  74. #define MWIFIEX_SEC_CHAN_BELOW 0x30
  75. #define MWIFIEX_SEC_CHAN_ABOVE 0x10
  76. #define MWIFIEX_SUPPORTED_RATES 14
  77. #define MWIFIEX_SUPPORTED_RATES_EXT 32
  78. #define MWIFIEX_TDLS_SUPPORTED_RATES 8
  79. #define MWIFIEX_TDLS_DEF_QOS_CAPAB 0xf
  80. #define MWIFIEX_PRIO_BK 2
  81. #define MWIFIEX_PRIO_VI 5
  82. #define MWIFIEX_SUPPORTED_CHANNELS 2
  83. #define MWIFIEX_OPERATING_CLASSES 16
  84. struct mwifiex_uap_bss_param {
  85. u8 channel;
  86. u8 band_cfg;
  87. u16 rts_threshold;
  88. u16 frag_threshold;
  89. u8 retry_limit;
  90. struct mwifiex_802_11_ssid ssid;
  91. u8 bcast_ssid_ctl;
  92. u8 radio_ctl;
  93. u8 dtim_period;
  94. u16 beacon_period;
  95. u16 auth_mode;
  96. u16 protocol;
  97. u16 key_mgmt;
  98. u16 key_mgmt_operation;
  99. struct wpa_param wpa_cfg;
  100. struct wep_key wep_cfg[NUM_WEP_KEYS];
  101. struct ieee80211_ht_cap ht_cap;
  102. struct ieee80211_vht_cap vht_cap;
  103. u8 rates[MWIFIEX_SUPPORTED_RATES];
  104. u32 sta_ao_timer;
  105. u32 ps_sta_ao_timer;
  106. u8 qos_info;
  107. u8 power_constraint;
  108. struct mwifiex_types_wmm_info wmm_info;
  109. };
  110. enum {
  111. ADHOC_IDLE,
  112. ADHOC_STARTED,
  113. ADHOC_JOINED,
  114. ADHOC_COALESCED
  115. };
  116. struct mwifiex_ds_get_stats {
  117. u32 mcast_tx_frame;
  118. u32 failed;
  119. u32 retry;
  120. u32 multi_retry;
  121. u32 frame_dup;
  122. u32 rts_success;
  123. u32 rts_failure;
  124. u32 ack_failure;
  125. u32 rx_frag;
  126. u32 mcast_rx_frame;
  127. u32 fcs_error;
  128. u32 tx_frame;
  129. u32 wep_icv_error[4];
  130. u32 bcn_rcv_cnt;
  131. u32 bcn_miss_cnt;
  132. };
  133. #define MWIFIEX_MAX_VER_STR_LEN 128
  134. struct mwifiex_ver_ext {
  135. u32 version_str_sel;
  136. char version_str[MWIFIEX_MAX_VER_STR_LEN];
  137. };
  138. struct mwifiex_bss_info {
  139. u32 bss_mode;
  140. struct cfg80211_ssid ssid;
  141. u32 bss_chan;
  142. u8 country_code[3];
  143. u32 media_connected;
  144. u32 max_power_level;
  145. u32 min_power_level;
  146. u32 adhoc_state;
  147. signed int bcn_nf_last;
  148. u32 wep_status;
  149. u32 is_hs_configured;
  150. u32 is_deep_sleep;
  151. u8 bssid[ETH_ALEN];
  152. };
  153. #define MAX_NUM_TID 8
  154. #define MAX_RX_WINSIZE 64
  155. struct mwifiex_ds_rx_reorder_tbl {
  156. u16 tid;
  157. u8 ta[ETH_ALEN];
  158. u32 start_win;
  159. u32 win_size;
  160. u32 buffer[MAX_RX_WINSIZE];
  161. };
  162. struct mwifiex_ds_tx_ba_stream_tbl {
  163. u16 tid;
  164. u8 ra[ETH_ALEN];
  165. u8 amsdu;
  166. };
  167. #define DBG_CMD_NUM 5
  168. #define MWIFIEX_DBG_SDIO_MP_NUM 10
  169. struct tdls_peer_info {
  170. u8 peer_addr[ETH_ALEN];
  171. };
  172. struct mwifiex_debug_info {
  173. unsigned int debug_mask;
  174. u32 int_counter;
  175. u32 packets_out[MAX_NUM_TID];
  176. u32 tx_buf_size;
  177. u32 curr_tx_buf_size;
  178. u32 tx_tbl_num;
  179. struct mwifiex_ds_tx_ba_stream_tbl
  180. tx_tbl[MWIFIEX_MAX_TX_BASTREAM_SUPPORTED];
  181. u32 rx_tbl_num;
  182. struct mwifiex_ds_rx_reorder_tbl rx_tbl
  183. [MWIFIEX_MAX_RX_BASTREAM_SUPPORTED];
  184. u32 tdls_peer_num;
  185. struct tdls_peer_info tdls_list
  186. [MWIFIEX_MAX_TDLS_PEER_SUPPORTED];
  187. u16 ps_mode;
  188. u32 ps_state;
  189. u8 is_deep_sleep;
  190. u8 pm_wakeup_card_req;
  191. u32 pm_wakeup_fw_try;
  192. u8 is_hs_configured;
  193. u8 hs_activated;
  194. u32 num_cmd_host_to_card_failure;
  195. u32 num_cmd_sleep_cfm_host_to_card_failure;
  196. u32 num_tx_host_to_card_failure;
  197. u32 num_event_deauth;
  198. u32 num_event_disassoc;
  199. u32 num_event_link_lost;
  200. u32 num_cmd_deauth;
  201. u32 num_cmd_assoc_success;
  202. u32 num_cmd_assoc_failure;
  203. u32 num_tx_timeout;
  204. u8 is_cmd_timedout;
  205. u16 timeout_cmd_id;
  206. u16 timeout_cmd_act;
  207. u16 last_cmd_id[DBG_CMD_NUM];
  208. u16 last_cmd_act[DBG_CMD_NUM];
  209. u16 last_cmd_index;
  210. u16 last_cmd_resp_id[DBG_CMD_NUM];
  211. u16 last_cmd_resp_index;
  212. u16 last_event[DBG_CMD_NUM];
  213. u16 last_event_index;
  214. u8 data_sent;
  215. u8 cmd_sent;
  216. u8 cmd_resp_received;
  217. u8 event_received;
  218. u32 last_mp_wr_bitmap[MWIFIEX_DBG_SDIO_MP_NUM];
  219. u32 last_mp_wr_ports[MWIFIEX_DBG_SDIO_MP_NUM];
  220. u32 last_mp_wr_len[MWIFIEX_DBG_SDIO_MP_NUM];
  221. u32 last_mp_curr_wr_port[MWIFIEX_DBG_SDIO_MP_NUM];
  222. u8 last_sdio_mp_index;
  223. };
  224. #define MWIFIEX_KEY_INDEX_UNICAST 0x40000000
  225. #define PN_LEN 16
  226. struct mwifiex_ds_encrypt_key {
  227. u32 key_disable;
  228. u32 key_index;
  229. u32 key_len;
  230. u8 key_material[WLAN_MAX_KEY_LEN];
  231. u8 mac_addr[ETH_ALEN];
  232. u32 is_wapi_key;
  233. u8 pn[PN_LEN]; /* packet number */
  234. u8 pn_len;
  235. u8 is_igtk_key;
  236. u8 is_current_wep_key;
  237. u8 is_rx_seq_valid;
  238. u8 is_igtk_def_key;
  239. };
  240. struct mwifiex_power_cfg {
  241. u32 is_power_auto;
  242. u32 is_power_fixed;
  243. u32 power_level;
  244. };
  245. struct mwifiex_ds_hs_cfg {
  246. u32 is_invoke_hostcmd;
  247. /* Bit0: non-unicast data
  248. * Bit1: unicast data
  249. * Bit2: mac events
  250. * Bit3: magic packet
  251. */
  252. u32 conditions;
  253. u32 gpio;
  254. u32 gap;
  255. };
  256. struct mwifiex_ds_wakeup_reason {
  257. u16 hs_wakeup_reason;
  258. };
  259. #define DEEP_SLEEP_ON 1
  260. #define DEEP_SLEEP_OFF 0
  261. #define DEEP_SLEEP_IDLE_TIME 100
  262. #define PS_MODE_AUTO 1
  263. struct mwifiex_ds_auto_ds {
  264. u16 auto_ds;
  265. u16 idle_time;
  266. };
  267. struct mwifiex_ds_pm_cfg {
  268. union {
  269. u32 ps_mode;
  270. struct mwifiex_ds_hs_cfg hs_cfg;
  271. struct mwifiex_ds_auto_ds auto_deep_sleep;
  272. u32 sleep_period;
  273. } param;
  274. };
  275. struct mwifiex_11ac_vht_cfg {
  276. u8 band_config;
  277. u8 misc_config;
  278. u32 cap_info;
  279. u32 mcs_tx_set;
  280. u32 mcs_rx_set;
  281. };
  282. struct mwifiex_ds_11n_tx_cfg {
  283. u16 tx_htcap;
  284. u16 tx_htinfo;
  285. u16 misc_config; /* Needed for 802.11AC cards only */
  286. };
  287. struct mwifiex_ds_11n_amsdu_aggr_ctrl {
  288. u16 enable;
  289. u16 curr_buf_size;
  290. };
  291. struct mwifiex_ds_ant_cfg {
  292. u32 tx_ant;
  293. u32 rx_ant;
  294. };
  295. #define MWIFIEX_NUM_OF_CMD_BUFFER 50
  296. #define MWIFIEX_SIZE_OF_CMD_BUFFER 2048
  297. enum {
  298. MWIFIEX_IE_TYPE_GEN_IE = 0,
  299. MWIFIEX_IE_TYPE_ARP_FILTER,
  300. };
  301. enum {
  302. MWIFIEX_REG_MAC = 1,
  303. MWIFIEX_REG_BBP,
  304. MWIFIEX_REG_RF,
  305. MWIFIEX_REG_PMIC,
  306. MWIFIEX_REG_CAU,
  307. };
  308. struct mwifiex_ds_reg_rw {
  309. u32 type;
  310. u32 offset;
  311. u32 value;
  312. };
  313. #define MAX_EEPROM_DATA 256
  314. struct mwifiex_ds_read_eeprom {
  315. u16 offset;
  316. u16 byte_count;
  317. u8 value[MAX_EEPROM_DATA];
  318. };
  319. struct mwifiex_ds_mem_rw {
  320. u32 addr;
  321. u32 value;
  322. };
  323. #define IEEE_MAX_IE_SIZE 256
  324. #define MWIFIEX_IE_HDR_SIZE (sizeof(struct mwifiex_ie) - IEEE_MAX_IE_SIZE)
  325. struct mwifiex_ds_misc_gen_ie {
  326. u32 type;
  327. u32 len;
  328. u8 ie_data[IEEE_MAX_IE_SIZE];
  329. };
  330. struct mwifiex_ds_misc_cmd {
  331. u32 len;
  332. u8 cmd[MWIFIEX_SIZE_OF_CMD_BUFFER];
  333. };
  334. #define BITMASK_BCN_RSSI_LOW BIT(0)
  335. #define BITMASK_BCN_RSSI_HIGH BIT(4)
  336. enum subsc_evt_rssi_state {
  337. EVENT_HANDLED,
  338. RSSI_LOW_RECVD,
  339. RSSI_HIGH_RECVD
  340. };
  341. struct subsc_evt_cfg {
  342. u8 abs_value;
  343. u8 evt_freq;
  344. };
  345. struct mwifiex_ds_misc_subsc_evt {
  346. u16 action;
  347. u16 events;
  348. struct subsc_evt_cfg bcn_l_rssi_cfg;
  349. struct subsc_evt_cfg bcn_h_rssi_cfg;
  350. };
  351. #define MWIFIEX_MEF_MAX_BYTESEQ 6 /* non-adjustable */
  352. #define MWIFIEX_MEF_MAX_FILTERS 10
  353. struct mwifiex_mef_filter {
  354. u16 repeat;
  355. u16 offset;
  356. s8 byte_seq[MWIFIEX_MEF_MAX_BYTESEQ + 1];
  357. u8 filt_type;
  358. u8 filt_action;
  359. };
  360. struct mwifiex_mef_entry {
  361. u8 mode;
  362. u8 action;
  363. struct mwifiex_mef_filter filter[MWIFIEX_MEF_MAX_FILTERS];
  364. };
  365. struct mwifiex_ds_mef_cfg {
  366. u32 criteria;
  367. u16 num_entries;
  368. struct mwifiex_mef_entry *mef_entry;
  369. };
  370. #define MWIFIEX_MAX_VSIE_LEN (256)
  371. #define MWIFIEX_MAX_VSIE_NUM (8)
  372. #define MWIFIEX_VSIE_MASK_CLEAR 0x00
  373. #define MWIFIEX_VSIE_MASK_SCAN 0x01
  374. #define MWIFIEX_VSIE_MASK_ASSOC 0x02
  375. #define MWIFIEX_VSIE_MASK_ADHOC 0x04
  376. #define MWIFIEX_VSIE_MASK_BGSCAN 0x08
  377. enum {
  378. MWIFIEX_FUNC_INIT = 1,
  379. MWIFIEX_FUNC_SHUTDOWN,
  380. };
  381. enum COALESCE_OPERATION {
  382. RECV_FILTER_MATCH_TYPE_EQ = 0x80,
  383. RECV_FILTER_MATCH_TYPE_NE,
  384. };
  385. enum COALESCE_PACKET_TYPE {
  386. PACKET_TYPE_UNICAST = 1,
  387. PACKET_TYPE_MULTICAST = 2,
  388. PACKET_TYPE_BROADCAST = 3
  389. };
  390. #define MWIFIEX_COALESCE_MAX_RULES 8
  391. #define MWIFIEX_COALESCE_MAX_BYTESEQ 4 /* non-adjustable */
  392. #define MWIFIEX_COALESCE_MAX_FILTERS 4
  393. #define MWIFIEX_MAX_COALESCING_DELAY 100 /* in msecs */
  394. struct filt_field_param {
  395. u8 operation;
  396. u8 operand_len;
  397. u16 offset;
  398. u8 operand_byte_stream[MWIFIEX_COALESCE_MAX_BYTESEQ];
  399. };
  400. struct mwifiex_coalesce_rule {
  401. u16 max_coalescing_delay;
  402. u8 num_of_fields;
  403. u8 pkt_type;
  404. struct filt_field_param params[MWIFIEX_COALESCE_MAX_FILTERS];
  405. };
  406. struct mwifiex_ds_coalesce_cfg {
  407. u16 num_of_rules;
  408. struct mwifiex_coalesce_rule rule[MWIFIEX_COALESCE_MAX_RULES];
  409. };
  410. struct mwifiex_ds_tdls_oper {
  411. u16 tdls_action;
  412. u8 peer_mac[ETH_ALEN];
  413. u16 capability;
  414. u8 qos_info;
  415. u8 *ext_capab;
  416. u8 ext_capab_len;
  417. u8 *supp_rates;
  418. u8 supp_rates_len;
  419. u8 *ht_capab;
  420. };
  421. #endif /* !_MWIFIEX_IOCTL_H_ */