ioctl.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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_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. };
  55. #define MWIFIEX_WPA_PASSHPHRASE_LEN 64
  56. struct wpa_param {
  57. u8 pairwise_cipher_wpa;
  58. u8 pairwise_cipher_wpa2;
  59. u8 group_cipher;
  60. u32 length;
  61. u8 passphrase[MWIFIEX_WPA_PASSHPHRASE_LEN];
  62. };
  63. #define KEY_MGMT_ON_HOST 0x03
  64. #define MWIFIEX_AUTH_MODE_AUTO 0xFF
  65. #define BAND_CONFIG_MANUAL 0x00
  66. struct mwifiex_uap_bss_param {
  67. u8 channel;
  68. u8 band_cfg;
  69. u16 rts_threshold;
  70. u16 frag_threshold;
  71. u8 retry_limit;
  72. struct mwifiex_802_11_ssid ssid;
  73. u8 bcast_ssid_ctl;
  74. u8 radio_ctl;
  75. u8 dtim_period;
  76. u16 beacon_period;
  77. u16 auth_mode;
  78. u16 protocol;
  79. u16 key_mgmt;
  80. u16 key_mgmt_operation;
  81. struct wpa_param wpa_cfg;
  82. };
  83. enum {
  84. ADHOC_IDLE,
  85. ADHOC_STARTED,
  86. ADHOC_JOINED,
  87. ADHOC_COALESCED
  88. };
  89. struct mwifiex_ds_get_stats {
  90. u32 mcast_tx_frame;
  91. u32 failed;
  92. u32 retry;
  93. u32 multi_retry;
  94. u32 frame_dup;
  95. u32 rts_success;
  96. u32 rts_failure;
  97. u32 ack_failure;
  98. u32 rx_frag;
  99. u32 mcast_rx_frame;
  100. u32 fcs_error;
  101. u32 tx_frame;
  102. u32 wep_icv_error[4];
  103. };
  104. #define MWIFIEX_MAX_VER_STR_LEN 128
  105. struct mwifiex_ver_ext {
  106. u32 version_str_sel;
  107. char version_str[MWIFIEX_MAX_VER_STR_LEN];
  108. };
  109. struct mwifiex_bss_info {
  110. u32 bss_mode;
  111. struct cfg80211_ssid ssid;
  112. u32 bss_chan;
  113. u8 country_code[3];
  114. u32 media_connected;
  115. u32 max_power_level;
  116. u32 min_power_level;
  117. u32 adhoc_state;
  118. signed int bcn_nf_last;
  119. u32 wep_status;
  120. u32 is_hs_configured;
  121. u32 is_deep_sleep;
  122. u8 bssid[ETH_ALEN];
  123. };
  124. #define MAX_NUM_TID 8
  125. #define MAX_RX_WINSIZE 64
  126. struct mwifiex_ds_rx_reorder_tbl {
  127. u16 tid;
  128. u8 ta[ETH_ALEN];
  129. u32 start_win;
  130. u32 win_size;
  131. u32 buffer[MAX_RX_WINSIZE];
  132. };
  133. struct mwifiex_ds_tx_ba_stream_tbl {
  134. u16 tid;
  135. u8 ra[ETH_ALEN];
  136. };
  137. #define DBG_CMD_NUM 5
  138. struct mwifiex_debug_info {
  139. u32 int_counter;
  140. u32 packets_out[MAX_NUM_TID];
  141. u32 max_tx_buf_size;
  142. u32 tx_buf_size;
  143. u32 curr_tx_buf_size;
  144. u32 tx_tbl_num;
  145. struct mwifiex_ds_tx_ba_stream_tbl
  146. tx_tbl[MWIFIEX_MAX_TX_BASTREAM_SUPPORTED];
  147. u32 rx_tbl_num;
  148. struct mwifiex_ds_rx_reorder_tbl rx_tbl
  149. [MWIFIEX_MAX_RX_BASTREAM_SUPPORTED];
  150. u16 ps_mode;
  151. u32 ps_state;
  152. u8 is_deep_sleep;
  153. u8 pm_wakeup_card_req;
  154. u32 pm_wakeup_fw_try;
  155. u8 is_hs_configured;
  156. u8 hs_activated;
  157. u32 num_cmd_host_to_card_failure;
  158. u32 num_cmd_sleep_cfm_host_to_card_failure;
  159. u32 num_tx_host_to_card_failure;
  160. u32 num_event_deauth;
  161. u32 num_event_disassoc;
  162. u32 num_event_link_lost;
  163. u32 num_cmd_deauth;
  164. u32 num_cmd_assoc_success;
  165. u32 num_cmd_assoc_failure;
  166. u32 num_tx_timeout;
  167. u32 num_cmd_timeout;
  168. u16 timeout_cmd_id;
  169. u16 timeout_cmd_act;
  170. u16 last_cmd_id[DBG_CMD_NUM];
  171. u16 last_cmd_act[DBG_CMD_NUM];
  172. u16 last_cmd_index;
  173. u16 last_cmd_resp_id[DBG_CMD_NUM];
  174. u16 last_cmd_resp_index;
  175. u16 last_event[DBG_CMD_NUM];
  176. u16 last_event_index;
  177. u8 data_sent;
  178. u8 cmd_sent;
  179. u8 cmd_resp_received;
  180. u8 event_received;
  181. };
  182. #define MWIFIEX_KEY_INDEX_UNICAST 0x40000000
  183. #define WAPI_RXPN_LEN 16
  184. struct mwifiex_ds_encrypt_key {
  185. u32 key_disable;
  186. u32 key_index;
  187. u32 key_len;
  188. u8 key_material[WLAN_MAX_KEY_LEN];
  189. u8 mac_addr[ETH_ALEN];
  190. u32 is_wapi_key;
  191. u8 wapi_rxpn[WAPI_RXPN_LEN];
  192. };
  193. struct mwifiex_rate_cfg {
  194. u32 action;
  195. u32 is_rate_auto;
  196. u32 rate;
  197. };
  198. struct mwifiex_power_cfg {
  199. u32 is_power_auto;
  200. u32 power_level;
  201. };
  202. struct mwifiex_ds_hs_cfg {
  203. u32 is_invoke_hostcmd;
  204. /* Bit0: non-unicast data
  205. * Bit1: unicast data
  206. * Bit2: mac events
  207. * Bit3: magic packet
  208. */
  209. u32 conditions;
  210. u32 gpio;
  211. u32 gap;
  212. };
  213. #define DEEP_SLEEP_ON 1
  214. #define DEEP_SLEEP_OFF 0
  215. #define DEEP_SLEEP_IDLE_TIME 100
  216. #define PS_MODE_AUTO 1
  217. struct mwifiex_ds_auto_ds {
  218. u16 auto_ds;
  219. u16 idle_time;
  220. };
  221. struct mwifiex_ds_pm_cfg {
  222. union {
  223. u32 ps_mode;
  224. struct mwifiex_ds_hs_cfg hs_cfg;
  225. struct mwifiex_ds_auto_ds auto_deep_sleep;
  226. u32 sleep_period;
  227. } param;
  228. };
  229. struct mwifiex_ds_11n_tx_cfg {
  230. u16 tx_htcap;
  231. u16 tx_htinfo;
  232. };
  233. struct mwifiex_ds_11n_amsdu_aggr_ctrl {
  234. u16 enable;
  235. u16 curr_buf_size;
  236. };
  237. #define MWIFIEX_NUM_OF_CMD_BUFFER 20
  238. #define MWIFIEX_SIZE_OF_CMD_BUFFER 2048
  239. enum {
  240. MWIFIEX_IE_TYPE_GEN_IE = 0,
  241. MWIFIEX_IE_TYPE_ARP_FILTER,
  242. };
  243. enum {
  244. MWIFIEX_REG_MAC = 1,
  245. MWIFIEX_REG_BBP,
  246. MWIFIEX_REG_RF,
  247. MWIFIEX_REG_PMIC,
  248. MWIFIEX_REG_CAU,
  249. };
  250. struct mwifiex_ds_reg_rw {
  251. __le32 type;
  252. __le32 offset;
  253. __le32 value;
  254. };
  255. #define MAX_EEPROM_DATA 256
  256. struct mwifiex_ds_read_eeprom {
  257. __le16 offset;
  258. __le16 byte_count;
  259. u8 value[MAX_EEPROM_DATA];
  260. };
  261. #define IEEE_MAX_IE_SIZE 256
  262. #define MWIFIEX_IE_HDR_SIZE (sizeof(struct mwifiex_ie) - IEEE_MAX_IE_SIZE)
  263. struct mwifiex_ds_misc_gen_ie {
  264. u32 type;
  265. u32 len;
  266. u8 ie_data[IEEE_MAX_IE_SIZE];
  267. };
  268. struct mwifiex_ds_misc_cmd {
  269. u32 len;
  270. u8 cmd[MWIFIEX_SIZE_OF_CMD_BUFFER];
  271. };
  272. #define BITMASK_BCN_RSSI_LOW BIT(0)
  273. #define BITMASK_BCN_RSSI_HIGH BIT(4)
  274. enum subsc_evt_rssi_state {
  275. EVENT_HANDLED,
  276. RSSI_LOW_RECVD,
  277. RSSI_HIGH_RECVD
  278. };
  279. struct subsc_evt_cfg {
  280. u8 abs_value;
  281. u8 evt_freq;
  282. };
  283. struct mwifiex_ds_misc_subsc_evt {
  284. u16 action;
  285. u16 events;
  286. struct subsc_evt_cfg bcn_l_rssi_cfg;
  287. struct subsc_evt_cfg bcn_h_rssi_cfg;
  288. };
  289. #define MWIFIEX_MAX_VSIE_LEN (256)
  290. #define MWIFIEX_MAX_VSIE_NUM (8)
  291. #define MWIFIEX_VSIE_MASK_CLEAR 0x00
  292. #define MWIFIEX_VSIE_MASK_SCAN 0x01
  293. #define MWIFIEX_VSIE_MASK_ASSOC 0x02
  294. #define MWIFIEX_VSIE_MASK_ADHOC 0x04
  295. enum {
  296. MWIFIEX_FUNC_INIT = 1,
  297. MWIFIEX_FUNC_SHUTDOWN,
  298. };
  299. #endif /* !_MWIFIEX_IOCTL_H_ */