fw-api-d3.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. /******************************************************************************
  2. *
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of version 2 of the GNU General Public License as
  13. * published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  23. * USA
  24. *
  25. * The full GNU General Public License is included in this distribution
  26. * in the file called COPYING.
  27. *
  28. * Contact Information:
  29. * Intel Linux Wireless <ilw@linux.intel.com>
  30. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  31. *
  32. * BSD LICENSE
  33. *
  34. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  35. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  36. * All rights reserved.
  37. *
  38. * Redistribution and use in source and binary forms, with or without
  39. * modification, are permitted provided that the following conditions
  40. * are met:
  41. *
  42. * * Redistributions of source code must retain the above copyright
  43. * notice, this list of conditions and the following disclaimer.
  44. * * Redistributions in binary form must reproduce the above copyright
  45. * notice, this list of conditions and the following disclaimer in
  46. * the documentation and/or other materials provided with the
  47. * distribution.
  48. * * Neither the name Intel Corporation nor the names of its
  49. * contributors may be used to endorse or promote products derived
  50. * from this software without specific prior written permission.
  51. *
  52. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  53. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  54. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  55. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  56. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  57. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  58. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  59. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  60. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  61. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  62. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  63. *****************************************************************************/
  64. #ifndef __fw_api_d3_h__
  65. #define __fw_api_d3_h__
  66. /**
  67. * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
  68. * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
  69. */
  70. enum iwl_d3_wakeup_flags {
  71. IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
  72. }; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
  73. /**
  74. * struct iwl_d3_manager_config - D3 manager configuration command
  75. * @min_sleep_time: minimum sleep time (in usec)
  76. * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
  77. * @wakeup_host_timer: force wakeup after this many seconds
  78. *
  79. * The structure is used for the D3_CONFIG_CMD command.
  80. */
  81. struct iwl_d3_manager_config {
  82. __le32 min_sleep_time;
  83. __le32 wakeup_flags;
  84. __le32 wakeup_host_timer;
  85. } __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
  86. /* TODO: OFFLOADS_QUERY_API_S_VER_1 */
  87. /**
  88. * enum iwl_d3_proto_offloads - enabled protocol offloads
  89. * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
  90. * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
  91. */
  92. enum iwl_proto_offloads {
  93. IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
  94. IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
  95. };
  96. #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
  97. #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
  98. #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12
  99. #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4
  100. #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12
  101. #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
  102. #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
  103. /**
  104. * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
  105. * @enabled: enable flags
  106. * @remote_ipv4_addr: remote address to answer to (or zero if all)
  107. * @host_ipv4_addr: our IPv4 address to respond to queries for
  108. * @arp_mac_addr: our MAC address for ARP responses
  109. * @reserved: unused
  110. */
  111. struct iwl_proto_offload_cmd_common {
  112. __le32 enabled;
  113. __be32 remote_ipv4_addr;
  114. __be32 host_ipv4_addr;
  115. u8 arp_mac_addr[ETH_ALEN];
  116. __le16 reserved;
  117. } __packed;
  118. /**
  119. * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
  120. * @common: common/IPv4 configuration
  121. * @remote_ipv6_addr: remote address to answer to (or zero if all)
  122. * @solicited_node_ipv6_addr: broken -- solicited node address exists
  123. * for each target address
  124. * @target_ipv6_addr: our target addresses
  125. * @ndp_mac_addr: neighbor solicitation response MAC address
  126. */
  127. struct iwl_proto_offload_cmd_v1 {
  128. struct iwl_proto_offload_cmd_common common;
  129. u8 remote_ipv6_addr[16];
  130. u8 solicited_node_ipv6_addr[16];
  131. u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
  132. u8 ndp_mac_addr[ETH_ALEN];
  133. __le16 reserved2;
  134. } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
  135. /**
  136. * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
  137. * @common: common/IPv4 configuration
  138. * @remote_ipv6_addr: remote address to answer to (or zero if all)
  139. * @solicited_node_ipv6_addr: broken -- solicited node address exists
  140. * for each target address
  141. * @target_ipv6_addr: our target addresses
  142. * @ndp_mac_addr: neighbor solicitation response MAC address
  143. */
  144. struct iwl_proto_offload_cmd_v2 {
  145. struct iwl_proto_offload_cmd_common common;
  146. u8 remote_ipv6_addr[16];
  147. u8 solicited_node_ipv6_addr[16];
  148. u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
  149. u8 ndp_mac_addr[ETH_ALEN];
  150. u8 numValidIPv6Addresses;
  151. u8 reserved2[3];
  152. } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
  153. struct iwl_ns_config {
  154. struct in6_addr source_ipv6_addr;
  155. struct in6_addr dest_ipv6_addr;
  156. u8 target_mac_addr[ETH_ALEN];
  157. __le16 reserved;
  158. } __packed; /* NS_OFFLOAD_CONFIG */
  159. struct iwl_targ_addr {
  160. struct in6_addr addr;
  161. __le32 config_num;
  162. } __packed; /* TARGET_IPV6_ADDRESS */
  163. /**
  164. * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
  165. * @common: common/IPv4 configuration
  166. * @target_ipv6_addr: target IPv6 addresses
  167. * @ns_config: NS offload configurations
  168. */
  169. struct iwl_proto_offload_cmd_v3_small {
  170. struct iwl_proto_offload_cmd_common common;
  171. __le32 num_valid_ipv6_addrs;
  172. struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
  173. struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
  174. } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
  175. /**
  176. * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
  177. * @common: common/IPv4 configuration
  178. * @target_ipv6_addr: target IPv6 addresses
  179. * @ns_config: NS offload configurations
  180. */
  181. struct iwl_proto_offload_cmd_v3_large {
  182. struct iwl_proto_offload_cmd_common common;
  183. __le32 num_valid_ipv6_addrs;
  184. struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
  185. struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
  186. } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
  187. /*
  188. * WOWLAN_PATTERNS
  189. */
  190. #define IWL_WOWLAN_MIN_PATTERN_LEN 16
  191. #define IWL_WOWLAN_MAX_PATTERN_LEN 128
  192. struct iwl_wowlan_pattern {
  193. u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
  194. u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
  195. u8 mask_size;
  196. u8 pattern_size;
  197. __le16 reserved;
  198. } __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
  199. #define IWL_WOWLAN_MAX_PATTERNS 20
  200. struct iwl_wowlan_patterns_cmd {
  201. __le32 n_patterns;
  202. struct iwl_wowlan_pattern patterns[];
  203. } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
  204. enum iwl_wowlan_wakeup_filters {
  205. IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),
  206. IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),
  207. IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),
  208. IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),
  209. IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),
  210. IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),
  211. IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),
  212. IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),
  213. IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),
  214. IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),
  215. IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),
  216. IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11),
  217. IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),
  218. IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13),
  219. IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14),
  220. IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15),
  221. IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16),
  222. }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
  223. struct iwl_wowlan_config_cmd {
  224. __le32 wakeup_filter;
  225. __le16 non_qos_seq;
  226. __le16 qos_seq[8];
  227. u8 wowlan_ba_teardown_tids;
  228. u8 is_11n_connection;
  229. u8 offloading_tid;
  230. u8 reserved[3];
  231. } __packed; /* WOWLAN_CONFIG_API_S_VER_3 */
  232. /*
  233. * WOWLAN_TSC_RSC_PARAMS
  234. */
  235. #define IWL_NUM_RSC 16
  236. struct tkip_sc {
  237. __le16 iv16;
  238. __le16 pad;
  239. __le32 iv32;
  240. } __packed; /* TKIP_SC_API_U_VER_1 */
  241. struct iwl_tkip_rsc_tsc {
  242. struct tkip_sc unicast_rsc[IWL_NUM_RSC];
  243. struct tkip_sc multicast_rsc[IWL_NUM_RSC];
  244. struct tkip_sc tsc;
  245. } __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
  246. struct aes_sc {
  247. __le64 pn;
  248. } __packed; /* TKIP_AES_SC_API_U_VER_1 */
  249. struct iwl_aes_rsc_tsc {
  250. struct aes_sc unicast_rsc[IWL_NUM_RSC];
  251. struct aes_sc multicast_rsc[IWL_NUM_RSC];
  252. struct aes_sc tsc;
  253. } __packed; /* AES_TSC_RSC_API_S_VER_1 */
  254. union iwl_all_tsc_rsc {
  255. struct iwl_tkip_rsc_tsc tkip;
  256. struct iwl_aes_rsc_tsc aes;
  257. }; /* ALL_TSC_RSC_API_S_VER_2 */
  258. struct iwl_wowlan_rsc_tsc_params_cmd {
  259. union iwl_all_tsc_rsc all_tsc_rsc;
  260. } __packed; /* ALL_TSC_RSC_API_S_VER_2 */
  261. #define IWL_MIC_KEY_SIZE 8
  262. struct iwl_mic_keys {
  263. u8 tx[IWL_MIC_KEY_SIZE];
  264. u8 rx_unicast[IWL_MIC_KEY_SIZE];
  265. u8 rx_mcast[IWL_MIC_KEY_SIZE];
  266. } __packed; /* MIC_KEYS_API_S_VER_1 */
  267. #define IWL_P1K_SIZE 5
  268. struct iwl_p1k_cache {
  269. __le16 p1k[IWL_P1K_SIZE];
  270. } __packed;
  271. #define IWL_NUM_RX_P1K_CACHE 2
  272. struct iwl_wowlan_tkip_params_cmd {
  273. struct iwl_mic_keys mic_keys;
  274. struct iwl_p1k_cache tx;
  275. struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
  276. struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
  277. } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
  278. #define IWL_KCK_MAX_SIZE 32
  279. #define IWL_KEK_MAX_SIZE 32
  280. struct iwl_wowlan_kek_kck_material_cmd {
  281. u8 kck[IWL_KCK_MAX_SIZE];
  282. u8 kek[IWL_KEK_MAX_SIZE];
  283. __le16 kck_len;
  284. __le16 kek_len;
  285. __le64 replay_ctr;
  286. } __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
  287. #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
  288. enum iwl_wowlan_rekey_status {
  289. IWL_WOWLAN_REKEY_POST_REKEY = 0,
  290. IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
  291. }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
  292. enum iwl_wowlan_wakeup_reason {
  293. IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,
  294. IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),
  295. IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),
  296. IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
  297. IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),
  298. IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),
  299. IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),
  300. IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),
  301. IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),
  302. IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
  303. IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
  304. IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
  305. IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),
  306. IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
  307. IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13),
  308. IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14),
  309. IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15),
  310. IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16),
  311. }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
  312. struct iwl_wowlan_gtk_status {
  313. u8 key_index;
  314. u8 reserved[3];
  315. u8 decrypt_key[16];
  316. u8 tkip_mic_key[8];
  317. struct iwl_wowlan_rsc_tsc_params_cmd rsc;
  318. } __packed;
  319. struct iwl_wowlan_status {
  320. struct iwl_wowlan_gtk_status gtk;
  321. __le64 replay_ctr;
  322. __le16 pattern_number;
  323. __le16 non_qos_seq_ctr;
  324. __le16 qos_seq_ctr[8];
  325. __le32 wakeup_reasons;
  326. __le32 num_of_gtk_rekeys;
  327. __le32 transmitted_ndps;
  328. __le32 received_beacons;
  329. __le32 wake_packet_length;
  330. __le32 wake_packet_bufsize;
  331. u8 wake_packet[]; /* can be truncated from _length to _bufsize */
  332. } __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
  333. #define IWL_WOWLAN_TCP_MAX_PACKET_LEN 64
  334. #define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN 128
  335. #define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS 2048
  336. struct iwl_tcp_packet_info {
  337. __le16 tcp_pseudo_header_checksum;
  338. __le16 tcp_payload_length;
  339. } __packed; /* TCP_PACKET_INFO_API_S_VER_2 */
  340. struct iwl_tcp_packet {
  341. struct iwl_tcp_packet_info info;
  342. u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
  343. u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN];
  344. } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
  345. struct iwl_remote_wake_packet {
  346. struct iwl_tcp_packet_info info;
  347. u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
  348. u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN];
  349. } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
  350. struct iwl_wowlan_remote_wake_config {
  351. __le32 connection_max_time; /* unused */
  352. /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
  353. u8 max_syn_retries;
  354. u8 max_data_retries;
  355. u8 tcp_syn_ack_timeout;
  356. u8 tcp_ack_timeout;
  357. struct iwl_tcp_packet syn_tx;
  358. struct iwl_tcp_packet synack_rx;
  359. struct iwl_tcp_packet keepalive_ack_rx;
  360. struct iwl_tcp_packet fin_tx;
  361. struct iwl_remote_wake_packet keepalive_tx;
  362. struct iwl_remote_wake_packet wake_rx;
  363. /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
  364. u8 sequence_number_offset;
  365. u8 sequence_number_length;
  366. u8 token_offset;
  367. u8 token_length;
  368. /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
  369. __le32 initial_sequence_number;
  370. __le16 keepalive_interval;
  371. __le16 num_tokens;
  372. u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS];
  373. } __packed; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
  374. /* TODO: NetDetect API */
  375. #endif /* __fw_api_d3_h__ */