fw-api-d3.h 12 KB

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