ioctl.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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 max_power_level;
  171. u32 min_power_level;
  172. u32 adhoc_state;
  173. signed int bcn_nf_last;
  174. u32 wep_status;
  175. u32 is_hs_configured;
  176. u32 is_deep_sleep;
  177. u8 bssid[ETH_ALEN];
  178. };
  179. #define MAX_NUM_TID 8
  180. #define MAX_RX_WINSIZE 64
  181. struct mwifiex_ds_rx_reorder_tbl {
  182. u16 tid;
  183. u8 ta[ETH_ALEN];
  184. u32 start_win;
  185. u32 win_size;
  186. u32 buffer[MAX_RX_WINSIZE];
  187. };
  188. struct mwifiex_ds_tx_ba_stream_tbl {
  189. u16 tid;
  190. u8 ra[ETH_ALEN];
  191. };
  192. #define DBG_CMD_NUM 5
  193. struct mwifiex_debug_info {
  194. u32 int_counter;
  195. u32 packets_out[MAX_NUM_TID];
  196. u32 max_tx_buf_size;
  197. u32 tx_buf_size;
  198. u32 curr_tx_buf_size;
  199. u32 tx_tbl_num;
  200. struct mwifiex_ds_tx_ba_stream_tbl
  201. tx_tbl[MWIFIEX_MAX_TX_BASTREAM_SUPPORTED];
  202. u32 rx_tbl_num;
  203. struct mwifiex_ds_rx_reorder_tbl rx_tbl
  204. [MWIFIEX_MAX_RX_BASTREAM_SUPPORTED];
  205. u16 ps_mode;
  206. u32 ps_state;
  207. u8 is_deep_sleep;
  208. u8 pm_wakeup_card_req;
  209. u32 pm_wakeup_fw_try;
  210. u8 is_hs_configured;
  211. u8 hs_activated;
  212. u32 num_cmd_host_to_card_failure;
  213. u32 num_cmd_sleep_cfm_host_to_card_failure;
  214. u32 num_tx_host_to_card_failure;
  215. u32 num_event_deauth;
  216. u32 num_event_disassoc;
  217. u32 num_event_link_lost;
  218. u32 num_cmd_deauth;
  219. u32 num_cmd_assoc_success;
  220. u32 num_cmd_assoc_failure;
  221. u32 num_tx_timeout;
  222. u32 num_cmd_timeout;
  223. u16 timeout_cmd_id;
  224. u16 timeout_cmd_act;
  225. u16 last_cmd_id[DBG_CMD_NUM];
  226. u16 last_cmd_act[DBG_CMD_NUM];
  227. u16 last_cmd_index;
  228. u16 last_cmd_resp_id[DBG_CMD_NUM];
  229. u16 last_cmd_resp_index;
  230. u16 last_event[DBG_CMD_NUM];
  231. u16 last_event_index;
  232. u8 data_sent;
  233. u8 cmd_sent;
  234. u8 cmd_resp_received;
  235. u8 event_received;
  236. };
  237. #define MWIFIEX_KEY_INDEX_UNICAST 0x40000000
  238. #define WAPI_RXPN_LEN 16
  239. struct mwifiex_ds_encrypt_key {
  240. u32 key_disable;
  241. u32 key_index;
  242. u32 key_len;
  243. u8 key_material[WLAN_MAX_KEY_LEN];
  244. u8 mac_addr[ETH_ALEN];
  245. u32 is_wapi_key;
  246. u8 wapi_rxpn[WAPI_RXPN_LEN];
  247. };
  248. struct mwifiex_rate_cfg {
  249. u32 action;
  250. u32 is_rate_auto;
  251. u32 rate;
  252. };
  253. struct mwifiex_data_rate {
  254. u32 tx_data_rate;
  255. u32 rx_data_rate;
  256. };
  257. struct mwifiex_power_cfg {
  258. u32 is_power_auto;
  259. u32 power_level;
  260. };
  261. struct mwifiex_ds_hs_cfg {
  262. u32 is_invoke_hostcmd;
  263. /* Bit0: non-unicast data
  264. * Bit1: unicast data
  265. * Bit2: mac events
  266. * Bit3: magic packet
  267. */
  268. u32 conditions;
  269. u32 gpio;
  270. u32 gap;
  271. };
  272. #define DEEP_SLEEP_ON 1
  273. #define DEEP_SLEEP_OFF 0
  274. #define DEEP_SLEEP_IDLE_TIME 100
  275. struct mwifiex_ds_auto_ds {
  276. u16 auto_ds;
  277. u16 idle_time;
  278. };
  279. #define PS_MODE_UNCHANGED 0
  280. #define PS_MODE_AUTO 1
  281. #define PS_MODE_POLL 2
  282. #define PS_MODE_NULL 3
  283. struct mwifiex_ds_pm_cfg {
  284. union {
  285. u32 ps_mode;
  286. struct mwifiex_ds_hs_cfg hs_cfg;
  287. struct mwifiex_ds_auto_ds auto_deep_sleep;
  288. u32 sleep_period;
  289. } param;
  290. };
  291. struct mwifiex_ioctl_wmm_queue_status_ac {
  292. u8 wmm_acm;
  293. u8 flow_required;
  294. u8 flow_created;
  295. u8 disabled;
  296. };
  297. struct mwifiex_ds_wmm_queue_status {
  298. struct mwifiex_ioctl_wmm_queue_status_ac
  299. ac_status[IEEE80211_MAX_QUEUES];
  300. };
  301. struct mwifiex_ds_11n_tx_cfg {
  302. u16 tx_htcap;
  303. u16 tx_htinfo;
  304. };
  305. struct mwifiex_ds_11n_amsdu_aggr_ctrl {
  306. u16 enable;
  307. u16 curr_buf_size;
  308. };
  309. #define MWIFIEX_NUM_OF_CMD_BUFFER 20
  310. #define MWIFIEX_SIZE_OF_CMD_BUFFER 2048
  311. enum {
  312. MWIFIEX_IE_TYPE_GEN_IE = 0,
  313. MWIFIEX_IE_TYPE_ARP_FILTER,
  314. };
  315. enum {
  316. MWIFIEX_REG_MAC = 1,
  317. MWIFIEX_REG_BBP,
  318. MWIFIEX_REG_RF,
  319. MWIFIEX_REG_PMIC,
  320. MWIFIEX_REG_CAU,
  321. };
  322. struct mwifiex_ds_reg_rw {
  323. __le32 type;
  324. __le32 offset;
  325. __le32 value;
  326. };
  327. #define MAX_EEPROM_DATA 256
  328. struct mwifiex_ds_read_eeprom {
  329. __le16 offset;
  330. __le16 byte_count;
  331. u8 value[MAX_EEPROM_DATA];
  332. };
  333. struct mwifiex_ds_misc_gen_ie {
  334. u32 type;
  335. u32 len;
  336. u8 ie_data[IW_CUSTOM_MAX];
  337. };
  338. struct mwifiex_ds_misc_cmd {
  339. u32 len;
  340. u8 cmd[MWIFIEX_SIZE_OF_CMD_BUFFER];
  341. };
  342. #define MWIFIEX_MAX_VSIE_LEN (256)
  343. #define MWIFIEX_MAX_VSIE_NUM (8)
  344. #define MWIFIEX_VSIE_MASK_SCAN 0x01
  345. #define MWIFIEX_VSIE_MASK_ASSOC 0x02
  346. #define MWIFIEX_VSIE_MASK_ADHOC 0x04
  347. enum {
  348. MWIFIEX_FUNC_INIT = 1,
  349. MWIFIEX_FUNC_SHUTDOWN,
  350. };
  351. #endif /* !_MWIFIEX_IOCTL_H_ */