fw-api-d3.h 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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 LICENSE.GPL.
  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. *
  76. * The structure is used for the D3_CONFIG_CMD command.
  77. */
  78. struct iwl_d3_manager_config {
  79. __le32 min_sleep_time;
  80. __le32 wakeup_flags;
  81. } __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_3 */
  82. /* TODO: OFFLOADS_QUERY_API_S_VER_1 */
  83. /**
  84. * enum iwl_d3_proto_offloads - enabled protocol offloads
  85. * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
  86. * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
  87. */
  88. enum iwl_proto_offloads {
  89. IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
  90. IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
  91. };
  92. #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS 2
  93. /**
  94. * struct iwl_proto_offload_cmd - ARP/NS offload configuration
  95. * @enabled: enable flags
  96. * @remote_ipv4_addr: remote address to answer to (or zero if all)
  97. * @host_ipv4_addr: our IPv4 address to respond to queries for
  98. * @arp_mac_addr: our MAC address for ARP responses
  99. * @remote_ipv6_addr: remote address to answer to (or zero if all)
  100. * @solicited_node_ipv6_addr: broken -- solicited node address exists
  101. * for each target address
  102. * @target_ipv6_addr: our target addresses
  103. * @ndp_mac_addr: neighbor soliciation response MAC address
  104. */
  105. struct iwl_proto_offload_cmd {
  106. __le32 enabled;
  107. __be32 remote_ipv4_addr;
  108. __be32 host_ipv4_addr;
  109. u8 arp_mac_addr[ETH_ALEN];
  110. __le16 reserved1;
  111. u8 remote_ipv6_addr[16];
  112. u8 solicited_node_ipv6_addr[16];
  113. u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS][16];
  114. u8 ndp_mac_addr[ETH_ALEN];
  115. __le16 reserved2;
  116. } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
  117. /*
  118. * WOWLAN_PATTERNS
  119. */
  120. #define IWL_WOWLAN_MIN_PATTERN_LEN 16
  121. #define IWL_WOWLAN_MAX_PATTERN_LEN 128
  122. struct iwl_wowlan_pattern {
  123. u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
  124. u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
  125. u8 mask_size;
  126. u8 pattern_size;
  127. __le16 reserved;
  128. } __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
  129. #define IWL_WOWLAN_MAX_PATTERNS 20
  130. struct iwl_wowlan_patterns_cmd {
  131. __le32 n_patterns;
  132. struct iwl_wowlan_pattern patterns[];
  133. } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
  134. enum iwl_wowlan_wakeup_filters {
  135. IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),
  136. IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),
  137. IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),
  138. IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),
  139. IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),
  140. IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),
  141. IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),
  142. IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),
  143. IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),
  144. IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),
  145. IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),
  146. /* BIT(11) reserved */
  147. IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),
  148. }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
  149. struct iwl_wowlan_config_cmd {
  150. __le32 wakeup_filter;
  151. __le16 non_qos_seq;
  152. __le16 qos_seq[8];
  153. u8 wowlan_ba_teardown_tids;
  154. u8 is_11n_connection;
  155. } __packed; /* WOWLAN_CONFIG_API_S_VER_2 */
  156. /*
  157. * WOWLAN_TSC_RSC_PARAMS
  158. */
  159. #define IWL_NUM_RSC 16
  160. struct tkip_sc {
  161. __le16 iv16;
  162. __le16 pad;
  163. __le32 iv32;
  164. } __packed; /* TKIP_SC_API_U_VER_1 */
  165. struct iwl_tkip_rsc_tsc {
  166. struct tkip_sc unicast_rsc[IWL_NUM_RSC];
  167. struct tkip_sc multicast_rsc[IWL_NUM_RSC];
  168. struct tkip_sc tsc;
  169. } __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
  170. struct aes_sc {
  171. __le64 pn;
  172. } __packed; /* TKIP_AES_SC_API_U_VER_1 */
  173. struct iwl_aes_rsc_tsc {
  174. struct aes_sc unicast_rsc[IWL_NUM_RSC];
  175. struct aes_sc multicast_rsc[IWL_NUM_RSC];
  176. struct aes_sc tsc;
  177. } __packed; /* AES_TSC_RSC_API_S_VER_1 */
  178. union iwl_all_tsc_rsc {
  179. struct iwl_tkip_rsc_tsc tkip;
  180. struct iwl_aes_rsc_tsc aes;
  181. }; /* ALL_TSC_RSC_API_S_VER_2 */
  182. struct iwl_wowlan_rsc_tsc_params_cmd {
  183. union iwl_all_tsc_rsc all_tsc_rsc;
  184. } __packed; /* ALL_TSC_RSC_API_S_VER_2 */
  185. #define IWL_MIC_KEY_SIZE 8
  186. struct iwl_mic_keys {
  187. u8 tx[IWL_MIC_KEY_SIZE];
  188. u8 rx_unicast[IWL_MIC_KEY_SIZE];
  189. u8 rx_mcast[IWL_MIC_KEY_SIZE];
  190. } __packed; /* MIC_KEYS_API_S_VER_1 */
  191. #define IWL_P1K_SIZE 5
  192. struct iwl_p1k_cache {
  193. __le16 p1k[IWL_P1K_SIZE];
  194. } __packed;
  195. #define IWL_NUM_RX_P1K_CACHE 2
  196. struct iwl_wowlan_tkip_params_cmd {
  197. struct iwl_mic_keys mic_keys;
  198. struct iwl_p1k_cache tx;
  199. struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
  200. struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
  201. } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
  202. #define IWL_KCK_MAX_SIZE 32
  203. #define IWL_KEK_MAX_SIZE 32
  204. struct iwl_wowlan_kek_kck_material_cmd {
  205. u8 kck[IWL_KCK_MAX_SIZE];
  206. u8 kek[IWL_KEK_MAX_SIZE];
  207. __le16 kck_len;
  208. __le16 kek_len;
  209. __le64 replay_ctr;
  210. } __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
  211. #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
  212. enum iwl_wowlan_rekey_status {
  213. IWL_WOWLAN_REKEY_POST_REKEY = 0,
  214. IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
  215. }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
  216. enum iwl_wowlan_wakeup_reason {
  217. IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,
  218. IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),
  219. IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),
  220. IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
  221. IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),
  222. IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),
  223. IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),
  224. IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),
  225. IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),
  226. IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
  227. IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
  228. IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
  229. IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),
  230. IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
  231. }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
  232. struct iwl_wowlan_status {
  233. __le64 replay_ctr;
  234. __le16 pattern_number;
  235. __le16 non_qos_seq_ctr;
  236. __le16 qos_seq_ctr[8];
  237. __le32 wakeup_reasons;
  238. __le32 rekey_status;
  239. __le32 num_of_gtk_rekeys;
  240. __le32 transmitted_ndps;
  241. __le32 received_beacons;
  242. __le32 wake_packet_length;
  243. __le32 wake_packet_bufsize;
  244. u8 wake_packet[]; /* can be truncated from _length to _bufsize */
  245. } __packed; /* WOWLAN_STATUSES_API_S_VER_4 */
  246. /* TODO: NetDetect API */
  247. #endif /* __fw_api_d3_h__ */