ioctl.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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 <linux/wireless.h>
  22. #include <net/mac80211.h>
  23. enum {
  24. MWIFIEX_SCAN_TYPE_UNCHANGED = 0,
  25. MWIFIEX_SCAN_TYPE_ACTIVE,
  26. MWIFIEX_SCAN_TYPE_PASSIVE
  27. };
  28. struct mwifiex_user_scan {
  29. u32 scan_cfg_len;
  30. u8 scan_cfg_buf[1];
  31. };
  32. #define MWIFIEX_PROMISC_MODE 1
  33. #define MWIFIEX_MULTICAST_MODE 2
  34. #define MWIFIEX_ALL_MULTI_MODE 4
  35. #define MWIFIEX_MAX_MULTICAST_LIST_SIZE 32
  36. struct mwifiex_multicast_list {
  37. u32 mode;
  38. u32 num_multicast_addr;
  39. u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
  40. };
  41. struct mwifiex_chan_freq {
  42. u32 channel;
  43. u32 freq;
  44. };
  45. struct mwifiex_ssid_bssid {
  46. struct mwifiex_802_11_ssid ssid;
  47. u8 bssid[ETH_ALEN];
  48. };
  49. enum {
  50. BAND_B = 1,
  51. BAND_G = 2,
  52. BAND_A = 4,
  53. BAND_GN = 8,
  54. BAND_AN = 16,
  55. };
  56. #define NO_SEC_CHANNEL 0
  57. #define SEC_CHANNEL_ABOVE 1
  58. #define SEC_CHANNEL_BELOW 3
  59. struct mwifiex_ds_band_cfg {
  60. u32 config_bands;
  61. u32 adhoc_start_band;
  62. u32 adhoc_channel;
  63. u32 sec_chan_offset;
  64. };
  65. enum {
  66. ADHOC_IDLE,
  67. ADHOC_STARTED,
  68. ADHOC_JOINED,
  69. ADHOC_COALESCED
  70. };
  71. struct mwifiex_ds_get_stats {
  72. u32 mcast_tx_frame;
  73. u32 failed;
  74. u32 retry;
  75. u32 multi_retry;
  76. u32 frame_dup;
  77. u32 rts_success;
  78. u32 rts_failure;
  79. u32 ack_failure;
  80. u32 rx_frag;
  81. u32 mcast_rx_frame;
  82. u32 fcs_error;
  83. u32 tx_frame;
  84. u32 wep_icv_error[4];
  85. };
  86. #define BCN_RSSI_AVG_MASK 0x00000002
  87. #define BCN_NF_AVG_MASK 0x00000200
  88. #define ALL_RSSI_INFO_MASK 0x00000fff
  89. struct mwifiex_ds_get_signal {
  90. /*
  91. * Bit0: Last Beacon RSSI, Bit1: Average Beacon RSSI,
  92. * Bit2: Last Data RSSI, Bit3: Average Data RSSI,
  93. * Bit4: Last Beacon SNR, Bit5: Average Beacon SNR,
  94. * Bit6: Last Data SNR, Bit7: Average Data SNR,
  95. * Bit8: Last Beacon NF, Bit9: Average Beacon NF,
  96. * Bit10: Last Data NF, Bit11: Average Data NF
  97. */
  98. u16 selector;
  99. s16 bcn_rssi_last;
  100. s16 bcn_rssi_avg;
  101. s16 data_rssi_last;
  102. s16 data_rssi_avg;
  103. s16 bcn_snr_last;
  104. s16 bcn_snr_avg;
  105. s16 data_snr_last;
  106. s16 data_snr_avg;
  107. s16 bcn_nf_last;
  108. s16 bcn_nf_avg;
  109. s16 data_nf_last;
  110. s16 data_nf_avg;
  111. };
  112. #define MWIFIEX_MAX_VER_STR_LEN 128
  113. struct mwifiex_ver_ext {
  114. u32 version_str_sel;
  115. char version_str[MWIFIEX_MAX_VER_STR_LEN];
  116. };
  117. struct mwifiex_bss_info {
  118. u32 bss_mode;
  119. struct mwifiex_802_11_ssid ssid;
  120. u32 scan_table_idx;
  121. u32 bss_chan;
  122. u32 region_code;
  123. u32 media_connected;
  124. u32 max_power_level;
  125. u32 min_power_level;
  126. u32 adhoc_state;
  127. signed int bcn_nf_last;
  128. u32 wep_status;
  129. u32 is_hs_configured;
  130. u32 is_deep_sleep;
  131. u8 bssid[ETH_ALEN];
  132. };
  133. #define MAX_NUM_TID 8
  134. #define MAX_RX_WINSIZE 64
  135. struct mwifiex_ds_rx_reorder_tbl {
  136. u16 tid;
  137. u8 ta[ETH_ALEN];
  138. u32 start_win;
  139. u32 win_size;
  140. u32 buffer[MAX_RX_WINSIZE];
  141. };
  142. struct mwifiex_ds_tx_ba_stream_tbl {
  143. u16 tid;
  144. u8 ra[ETH_ALEN];
  145. };
  146. #define DBG_CMD_NUM 5
  147. struct mwifiex_debug_info {
  148. u32 int_counter;
  149. u32 packets_out[MAX_NUM_TID];
  150. u32 max_tx_buf_size;
  151. u32 tx_buf_size;
  152. u32 curr_tx_buf_size;
  153. u32 tx_tbl_num;
  154. struct mwifiex_ds_tx_ba_stream_tbl
  155. tx_tbl[MWIFIEX_MAX_TX_BASTREAM_SUPPORTED];
  156. u32 rx_tbl_num;
  157. struct mwifiex_ds_rx_reorder_tbl rx_tbl
  158. [MWIFIEX_MAX_RX_BASTREAM_SUPPORTED];
  159. u16 ps_mode;
  160. u32 ps_state;
  161. u8 is_deep_sleep;
  162. u8 pm_wakeup_card_req;
  163. u32 pm_wakeup_fw_try;
  164. u8 is_hs_configured;
  165. u8 hs_activated;
  166. u32 num_cmd_host_to_card_failure;
  167. u32 num_cmd_sleep_cfm_host_to_card_failure;
  168. u32 num_tx_host_to_card_failure;
  169. u32 num_event_deauth;
  170. u32 num_event_disassoc;
  171. u32 num_event_link_lost;
  172. u32 num_cmd_deauth;
  173. u32 num_cmd_assoc_success;
  174. u32 num_cmd_assoc_failure;
  175. u32 num_tx_timeout;
  176. u32 num_cmd_timeout;
  177. u16 timeout_cmd_id;
  178. u16 timeout_cmd_act;
  179. u16 last_cmd_id[DBG_CMD_NUM];
  180. u16 last_cmd_act[DBG_CMD_NUM];
  181. u16 last_cmd_index;
  182. u16 last_cmd_resp_id[DBG_CMD_NUM];
  183. u16 last_cmd_resp_index;
  184. u16 last_event[DBG_CMD_NUM];
  185. u16 last_event_index;
  186. u8 data_sent;
  187. u8 cmd_sent;
  188. u8 cmd_resp_received;
  189. u8 event_received;
  190. };
  191. #define MWIFIEX_KEY_INDEX_UNICAST 0x40000000
  192. #define WAPI_RXPN_LEN 16
  193. struct mwifiex_ds_encrypt_key {
  194. u32 key_disable;
  195. u32 key_index;
  196. u32 key_len;
  197. u8 key_material[WLAN_MAX_KEY_LEN];
  198. u8 mac_addr[ETH_ALEN];
  199. u32 is_wapi_key;
  200. u8 wapi_rxpn[WAPI_RXPN_LEN];
  201. };
  202. struct mwifiex_rate_cfg {
  203. u32 action;
  204. u32 is_rate_auto;
  205. u32 rate;
  206. };
  207. struct mwifiex_power_cfg {
  208. u32 is_power_auto;
  209. u32 power_level;
  210. };
  211. struct mwifiex_ds_hs_cfg {
  212. u32 is_invoke_hostcmd;
  213. /* Bit0: non-unicast data
  214. * Bit1: unicast data
  215. * Bit2: mac events
  216. * Bit3: magic packet
  217. */
  218. u32 conditions;
  219. u32 gpio;
  220. u32 gap;
  221. };
  222. #define DEEP_SLEEP_ON 1
  223. #define DEEP_SLEEP_OFF 0
  224. #define DEEP_SLEEP_IDLE_TIME 100
  225. #define PS_MODE_AUTO 1
  226. struct mwifiex_ds_auto_ds {
  227. u16 auto_ds;
  228. u16 idle_time;
  229. };
  230. struct mwifiex_ds_pm_cfg {
  231. union {
  232. u32 ps_mode;
  233. struct mwifiex_ds_hs_cfg hs_cfg;
  234. struct mwifiex_ds_auto_ds auto_deep_sleep;
  235. u32 sleep_period;
  236. } param;
  237. };
  238. struct mwifiex_ds_11n_tx_cfg {
  239. u16 tx_htcap;
  240. u16 tx_htinfo;
  241. };
  242. struct mwifiex_ds_11n_amsdu_aggr_ctrl {
  243. u16 enable;
  244. u16 curr_buf_size;
  245. };
  246. #define MWIFIEX_NUM_OF_CMD_BUFFER 20
  247. #define MWIFIEX_SIZE_OF_CMD_BUFFER 2048
  248. enum {
  249. MWIFIEX_IE_TYPE_GEN_IE = 0,
  250. MWIFIEX_IE_TYPE_ARP_FILTER,
  251. };
  252. enum {
  253. MWIFIEX_REG_MAC = 1,
  254. MWIFIEX_REG_BBP,
  255. MWIFIEX_REG_RF,
  256. MWIFIEX_REG_PMIC,
  257. MWIFIEX_REG_CAU,
  258. };
  259. struct mwifiex_ds_reg_rw {
  260. __le32 type;
  261. __le32 offset;
  262. __le32 value;
  263. };
  264. #define MAX_EEPROM_DATA 256
  265. struct mwifiex_ds_read_eeprom {
  266. __le16 offset;
  267. __le16 byte_count;
  268. u8 value[MAX_EEPROM_DATA];
  269. };
  270. struct mwifiex_ds_misc_gen_ie {
  271. u32 type;
  272. u32 len;
  273. u8 ie_data[IW_CUSTOM_MAX];
  274. };
  275. struct mwifiex_ds_misc_cmd {
  276. u32 len;
  277. u8 cmd[MWIFIEX_SIZE_OF_CMD_BUFFER];
  278. };
  279. #define MWIFIEX_MAX_VSIE_LEN (256)
  280. #define MWIFIEX_MAX_VSIE_NUM (8)
  281. #define MWIFIEX_VSIE_MASK_SCAN 0x01
  282. #define MWIFIEX_VSIE_MASK_ASSOC 0x02
  283. #define MWIFIEX_VSIE_MASK_ADHOC 0x04
  284. enum {
  285. MWIFIEX_FUNC_INIT = 1,
  286. MWIFIEX_FUNC_SHUTDOWN,
  287. };
  288. #endif /* !_MWIFIEX_IOCTL_H_ */