ioctl.h 7.2 KB

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