ioctl.h 8.6 KB

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