ioctl.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. /*
  2. * Marvell Wireless LAN device driver: ioctl data structures & APIs
  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_IOCTL_H_
  20. #define _MWIFIEX_IOCTL_H_
  21. #include <net/mac80211.h>
  22. enum {
  23. MWIFIEX_SCAN_MODE_UNCHANGED = 0,
  24. MWIFIEX_SCAN_MODE_BSS,
  25. MWIFIEX_SCAN_MODE_IBSS,
  26. MWIFIEX_SCAN_MODE_ANY
  27. };
  28. enum {
  29. MWIFIEX_SCAN_TYPE_UNCHANGED = 0,
  30. MWIFIEX_SCAN_TYPE_ACTIVE,
  31. MWIFIEX_SCAN_TYPE_PASSIVE
  32. };
  33. struct mwifiex_get_scan_table_fixed {
  34. u8 bssid[ETH_ALEN];
  35. u8 channel;
  36. u8 rssi;
  37. long long network_tsf;
  38. };
  39. struct mwifiex_scan_time_params {
  40. u32 specific_scan_time;
  41. u32 active_scan_time;
  42. u32 passive_scan_time;
  43. };
  44. struct mwifiex_user_scan {
  45. u32 scan_cfg_len;
  46. u8 scan_cfg_buf[1];
  47. };
  48. struct mwifiex_scan_req {
  49. u32 scan_mode;
  50. u32 scan_type;
  51. struct mwifiex_802_11_ssid scan_ssid;
  52. struct mwifiex_scan_time_params scan_time;
  53. struct mwifiex_user_scan user_scan;
  54. };
  55. struct mwifiex_scan_resp {
  56. u32 num_in_scan_table;
  57. u8 *scan_table;
  58. };
  59. enum {
  60. MWIFIEX_BSS_MODE_INFRA = 1,
  61. MWIFIEX_BSS_MODE_IBSS,
  62. MWIFIEX_BSS_MODE_AUTO
  63. };
  64. #define MWIFIEX_PROMISC_MODE 1
  65. #define MWIFIEX_MULTICAST_MODE 2
  66. #define MWIFIEX_ALL_MULTI_MODE 4
  67. #define MWIFIEX_MAX_MULTICAST_LIST_SIZE 32
  68. struct mwifiex_multicast_list {
  69. u32 mode;
  70. u32 num_multicast_addr;
  71. u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
  72. };
  73. #define MWIFIEX_MAX_CHANNEL_NUM 128
  74. struct mwifiex_chan_freq {
  75. u32 channel;
  76. u32 freq;
  77. };
  78. struct mwifiex_chan_list {
  79. u32 num_of_chan;
  80. struct mwifiex_chan_freq cf[MWIFIEX_MAX_CHANNEL_NUM];
  81. };
  82. struct mwifiex_ssid_bssid {
  83. struct mwifiex_802_11_ssid ssid;
  84. u8 bssid[ETH_ALEN];
  85. };
  86. enum {
  87. BAND_B = 1,
  88. BAND_G = 2,
  89. BAND_A = 4,
  90. BAND_GN = 8,
  91. BAND_AN = 16,
  92. };
  93. #define NO_SEC_CHANNEL 0
  94. #define SEC_CHANNEL_ABOVE 1
  95. #define SEC_CHANNEL_BELOW 3
  96. struct mwifiex_ds_band_cfg {
  97. u32 config_bands;
  98. u32 adhoc_start_band;
  99. u32 adhoc_channel;
  100. u32 sec_chan_offset;
  101. };
  102. enum {
  103. ADHOC_IDLE,
  104. ADHOC_STARTED,
  105. ADHOC_JOINED,
  106. ADHOC_COALESCED
  107. };
  108. struct mwifiex_ds_get_stats {
  109. u32 mcast_tx_frame;
  110. u32 failed;
  111. u32 retry;
  112. u32 multi_retry;
  113. u32 frame_dup;
  114. u32 rts_success;
  115. u32 rts_failure;
  116. u32 ack_failure;
  117. u32 rx_frag;
  118. u32 mcast_rx_frame;
  119. u32 fcs_error;
  120. u32 tx_frame;
  121. u32 wep_icv_error[4];
  122. };
  123. #define BCN_RSSI_LAST_MASK 0x00000001
  124. #define BCN_RSSI_AVG_MASK 0x00000002
  125. #define DATA_RSSI_LAST_MASK 0x00000004
  126. #define DATA_RSSI_AVG_MASK 0x00000008
  127. #define BCN_SNR_LAST_MASK 0x00000010
  128. #define BCN_SNR_AVG_MASK 0x00000020
  129. #define DATA_SNR_LAST_MASK 0x00000040
  130. #define DATA_SNR_AVG_MASK 0x00000080
  131. #define BCN_NF_LAST_MASK 0x00000100
  132. #define BCN_NF_AVG_MASK 0x00000200
  133. #define DATA_NF_LAST_MASK 0x00000400
  134. #define DATA_NF_AVG_MASK 0x00000800
  135. #define ALL_RSSI_INFO_MASK 0x00000fff
  136. struct mwifiex_ds_get_signal {
  137. /*
  138. * Bit0: Last Beacon RSSI, Bit1: Average Beacon RSSI,
  139. * Bit2: Last Data RSSI, Bit3: Average Data RSSI,
  140. * Bit4: Last Beacon SNR, Bit5: Average Beacon SNR,
  141. * Bit6: Last Data SNR, Bit7: Average Data SNR,
  142. * Bit8: Last Beacon NF, Bit9: Average Beacon NF,
  143. * Bit10: Last Data NF, Bit11: Average Data NF
  144. */
  145. u16 selector;
  146. s16 bcn_rssi_last;
  147. s16 bcn_rssi_avg;
  148. s16 data_rssi_last;
  149. s16 data_rssi_avg;
  150. s16 bcn_snr_last;
  151. s16 bcn_snr_avg;
  152. s16 data_snr_last;
  153. s16 data_snr_avg;
  154. s16 bcn_nf_last;
  155. s16 bcn_nf_avg;
  156. s16 data_nf_last;
  157. s16 data_nf_avg;
  158. };
  159. struct mwifiex_fw_info {
  160. u32 fw_ver;
  161. u8 mac_addr[ETH_ALEN];
  162. };
  163. #define MWIFIEX_MAX_VER_STR_LEN 128
  164. struct mwifiex_ver_ext {
  165. u32 version_str_sel;
  166. char version_str[MWIFIEX_MAX_VER_STR_LEN];
  167. };
  168. struct mwifiex_bss_info {
  169. u32 bss_mode;
  170. struct mwifiex_802_11_ssid ssid;
  171. u32 scan_table_idx;
  172. u32 bss_chan;
  173. u32 region_code;
  174. u32 media_connected;
  175. u32 radio_on;
  176. u32 max_power_level;
  177. u32 min_power_level;
  178. u32 adhoc_state;
  179. signed int bcn_nf_last;
  180. u32 wep_status;
  181. u32 is_hs_configured;
  182. u32 is_deep_sleep;
  183. u8 bssid[ETH_ALEN];
  184. };
  185. #define MAX_NUM_TID 8
  186. #define MAX_RX_WINSIZE 64
  187. struct mwifiex_ds_rx_reorder_tbl {
  188. u16 tid;
  189. u8 ta[ETH_ALEN];
  190. u32 start_win;
  191. u32 win_size;
  192. u32 buffer[MAX_RX_WINSIZE];
  193. };
  194. struct mwifiex_ds_tx_ba_stream_tbl {
  195. u16 tid;
  196. u8 ra[ETH_ALEN];
  197. };
  198. #define DBG_CMD_NUM 5
  199. struct mwifiex_debug_info {
  200. u32 int_counter;
  201. u32 packets_out[MAX_NUM_TID];
  202. u32 max_tx_buf_size;
  203. u32 tx_buf_size;
  204. u32 curr_tx_buf_size;
  205. u32 tx_tbl_num;
  206. struct mwifiex_ds_tx_ba_stream_tbl
  207. tx_tbl[MWIFIEX_MAX_TX_BASTREAM_SUPPORTED];
  208. u32 rx_tbl_num;
  209. struct mwifiex_ds_rx_reorder_tbl rx_tbl
  210. [MWIFIEX_MAX_RX_BASTREAM_SUPPORTED];
  211. u16 ps_mode;
  212. u32 ps_state;
  213. u8 is_deep_sleep;
  214. u8 pm_wakeup_card_req;
  215. u32 pm_wakeup_fw_try;
  216. u8 is_hs_configured;
  217. u8 hs_activated;
  218. u32 num_cmd_host_to_card_failure;
  219. u32 num_cmd_sleep_cfm_host_to_card_failure;
  220. u32 num_tx_host_to_card_failure;
  221. u32 num_event_deauth;
  222. u32 num_event_disassoc;
  223. u32 num_event_link_lost;
  224. u32 num_cmd_deauth;
  225. u32 num_cmd_assoc_success;
  226. u32 num_cmd_assoc_failure;
  227. u32 num_tx_timeout;
  228. u32 num_cmd_timeout;
  229. u16 timeout_cmd_id;
  230. u16 timeout_cmd_act;
  231. u16 last_cmd_id[DBG_CMD_NUM];
  232. u16 last_cmd_act[DBG_CMD_NUM];
  233. u16 last_cmd_index;
  234. u16 last_cmd_resp_id[DBG_CMD_NUM];
  235. u16 last_cmd_resp_index;
  236. u16 last_event[DBG_CMD_NUM];
  237. u16 last_event_index;
  238. u8 data_sent;
  239. u8 cmd_sent;
  240. u8 cmd_resp_received;
  241. u8 event_received;
  242. };
  243. enum {
  244. MWIFIEX_AUTH_MODE_OPEN = 0x00,
  245. MWIFIEX_AUTH_MODE_SHARED = 0x01,
  246. MWIFIEX_AUTH_MODE_NETWORKEAP = 0x80,
  247. MWIFIEX_AUTH_MODE_AUTO = 0xFF,
  248. };
  249. enum {
  250. MWIFIEX_ENCRYPTION_MODE_NONE = 0,
  251. MWIFIEX_ENCRYPTION_MODE_WEP40 = 1,
  252. MWIFIEX_ENCRYPTION_MODE_TKIP = 2,
  253. MWIFIEX_ENCRYPTION_MODE_CCMP = 3,
  254. MWIFIEX_ENCRYPTION_MODE_WEP104 = 4,
  255. };
  256. #define MWIFIEX_KEY_INDEX_UNICAST 0x40000000
  257. #define MWIFIEX_MAX_KEY_LENGTH 32
  258. #define WAPI_RXPN_LEN 16
  259. struct mwifiex_ds_encrypt_key {
  260. u32 key_disable;
  261. u32 key_index;
  262. u32 key_len;
  263. u8 key_material[MWIFIEX_MAX_KEY_LENGTH];
  264. u8 mac_addr[ETH_ALEN];
  265. u32 is_wapi_key;
  266. u8 wapi_rxpn[WAPI_RXPN_LEN];
  267. };
  268. struct mwifiex_rate_cfg {
  269. u32 action;
  270. u32 is_rate_auto;
  271. u32 rate;
  272. };
  273. struct mwifiex_data_rate {
  274. u32 tx_data_rate;
  275. u32 rx_data_rate;
  276. };
  277. struct mwifiex_power_cfg {
  278. u32 is_power_auto;
  279. u32 power_level;
  280. };
  281. struct mwifiex_ds_hs_cfg {
  282. u32 is_invoke_hostcmd;
  283. /* Bit0: non-unicast data
  284. * Bit1: unicast data
  285. * Bit2: mac events
  286. * Bit3: magic packet
  287. */
  288. u32 conditions;
  289. u32 gpio;
  290. u32 gap;
  291. };
  292. #define DEEP_SLEEP_ON 1
  293. #define DEEP_SLEEP_OFF 0
  294. #define DEEP_SLEEP_IDLE_TIME 100
  295. struct mwifiex_ds_auto_ds {
  296. u16 auto_ds;
  297. u16 idle_time;
  298. };
  299. #define PS_MODE_UNCHANGED 0
  300. #define PS_MODE_AUTO 1
  301. #define PS_MODE_POLL 2
  302. #define PS_MODE_NULL 3
  303. struct mwifiex_ds_pm_cfg {
  304. union {
  305. u32 ps_mode;
  306. struct mwifiex_ds_hs_cfg hs_cfg;
  307. struct mwifiex_ds_auto_ds auto_deep_sleep;
  308. u32 sleep_period;
  309. } param;
  310. };
  311. struct mwifiex_ioctl_wmm_queue_status_ac {
  312. u8 wmm_acm;
  313. u8 flow_required;
  314. u8 flow_created;
  315. u8 disabled;
  316. };
  317. struct mwifiex_ds_wmm_queue_status {
  318. struct mwifiex_ioctl_wmm_queue_status_ac
  319. ac_status[IEEE80211_MAX_QUEUES];
  320. };
  321. struct mwifiex_ds_11n_tx_cfg {
  322. u16 tx_htcap;
  323. u16 tx_htinfo;
  324. };
  325. struct mwifiex_ds_11n_amsdu_aggr_ctrl {
  326. u16 enable;
  327. u16 curr_buf_size;
  328. };
  329. #define MWIFIEX_NUM_OF_CMD_BUFFER 20
  330. #define MWIFIEX_SIZE_OF_CMD_BUFFER 2048
  331. enum {
  332. MWIFIEX_IE_TYPE_GEN_IE = 0,
  333. MWIFIEX_IE_TYPE_ARP_FILTER,
  334. };
  335. enum {
  336. MWIFIEX_REG_MAC = 1,
  337. MWIFIEX_REG_BBP,
  338. MWIFIEX_REG_RF,
  339. MWIFIEX_REG_PMIC,
  340. MWIFIEX_REG_CAU,
  341. };
  342. struct mwifiex_ds_reg_rw {
  343. __le32 type;
  344. __le32 offset;
  345. __le32 value;
  346. };
  347. #define MAX_EEPROM_DATA 256
  348. struct mwifiex_ds_read_eeprom {
  349. __le16 offset;
  350. __le16 byte_count;
  351. u8 value[MAX_EEPROM_DATA];
  352. };
  353. struct mwifiex_ds_misc_gen_ie {
  354. u32 type;
  355. u32 len;
  356. u8 ie_data[IW_CUSTOM_MAX];
  357. };
  358. struct mwifiex_ds_misc_cmd {
  359. u32 len;
  360. u8 cmd[MWIFIEX_SIZE_OF_CMD_BUFFER];
  361. };
  362. #define MWIFIEX_MAX_VSIE_LEN (256)
  363. #define MWIFIEX_MAX_VSIE_NUM (8)
  364. #define MWIFIEX_VSIE_MASK_SCAN 0x01
  365. #define MWIFIEX_VSIE_MASK_ASSOC 0x02
  366. #define MWIFIEX_VSIE_MASK_ADHOC 0x04
  367. enum {
  368. MWIFIEX_FUNC_INIT = 1,
  369. MWIFIEX_FUNC_SHUTDOWN,
  370. };
  371. #endif /* !_MWIFIEX_IOCTL_H_ */