alive.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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 - 2015 Intel Mobile Communications GmbH
  10. * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of version 2 of the GNU General Public License as
  14. * published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * The full GNU General Public License is included in this distribution
  22. * in the file called COPYING.
  23. *
  24. * Contact Information:
  25. * Intel Linux Wireless <linuxwifi@intel.com>
  26. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  27. *
  28. * BSD LICENSE
  29. *
  30. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  31. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  32. * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
  33. * All rights reserved.
  34. *
  35. * Redistribution and use in source and binary forms, with or without
  36. * modification, are permitted provided that the following conditions
  37. * are met:
  38. *
  39. * * Redistributions of source code must retain the above copyright
  40. * notice, this list of conditions and the following disclaimer.
  41. * * Redistributions in binary form must reproduce the above copyright
  42. * notice, this list of conditions and the following disclaimer in
  43. * the documentation and/or other materials provided with the
  44. * distribution.
  45. * * Neither the name Intel Corporation nor the names of its
  46. * contributors may be used to endorse or promote products derived
  47. * from this software without specific prior written permission.
  48. *
  49. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  50. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  51. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  52. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  53. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  54. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  55. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  56. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  57. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  58. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  59. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  60. *
  61. *****************************************************************************/
  62. #ifndef __iwl_fw_api_alive_h__
  63. #define __iwl_fw_api_alive_h__
  64. /* alive response is_valid values */
  65. #define ALIVE_RESP_UCODE_OK BIT(0)
  66. #define ALIVE_RESP_RFKILL BIT(1)
  67. /* alive response ver_type values */
  68. enum {
  69. FW_TYPE_HW = 0,
  70. FW_TYPE_PROT = 1,
  71. FW_TYPE_AP = 2,
  72. FW_TYPE_WOWLAN = 3,
  73. FW_TYPE_TIMING = 4,
  74. FW_TYPE_WIPAN = 5
  75. };
  76. /* alive response ver_subtype values */
  77. enum {
  78. FW_SUBTYPE_FULL_FEATURE = 0,
  79. FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
  80. FW_SUBTYPE_REDUCED = 2,
  81. FW_SUBTYPE_ALIVE_ONLY = 3,
  82. FW_SUBTYPE_WOWLAN = 4,
  83. FW_SUBTYPE_AP_SUBTYPE = 5,
  84. FW_SUBTYPE_WIPAN = 6,
  85. FW_SUBTYPE_INITIALIZE = 9
  86. };
  87. #define IWL_ALIVE_STATUS_ERR 0xDEAD
  88. #define IWL_ALIVE_STATUS_OK 0xCAFE
  89. #define IWL_ALIVE_FLG_RFKILL BIT(0)
  90. struct iwl_lmac_alive {
  91. __le32 ucode_major;
  92. __le32 ucode_minor;
  93. u8 ver_subtype;
  94. u8 ver_type;
  95. u8 mac;
  96. u8 opt;
  97. __le32 timestamp;
  98. __le32 error_event_table_ptr; /* SRAM address for error log */
  99. __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
  100. __le32 cpu_register_ptr;
  101. __le32 dbgm_config_ptr;
  102. __le32 alive_counter_ptr;
  103. __le32 scd_base_ptr; /* SRAM address for SCD */
  104. __le32 st_fwrd_addr; /* pointer to Store and forward */
  105. __le32 st_fwrd_size;
  106. } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
  107. struct iwl_umac_alive {
  108. __le32 umac_major; /* UMAC version: major */
  109. __le32 umac_minor; /* UMAC version: minor */
  110. __le32 error_info_addr; /* SRAM address for UMAC error log */
  111. __le32 dbg_print_buff_addr;
  112. } __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
  113. struct mvm_alive_resp_v3 {
  114. __le16 status;
  115. __le16 flags;
  116. struct iwl_lmac_alive lmac_data;
  117. struct iwl_umac_alive umac_data;
  118. } __packed; /* ALIVE_RES_API_S_VER_3 */
  119. struct mvm_alive_resp {
  120. __le16 status;
  121. __le16 flags;
  122. struct iwl_lmac_alive lmac_data[2];
  123. struct iwl_umac_alive umac_data;
  124. } __packed; /* ALIVE_RES_API_S_VER_4 */
  125. /**
  126. * enum iwl_extended_cfg_flag - commands driver may send before
  127. * finishing init flow
  128. * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
  129. * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
  130. * @IWL_INIT_PHY: driver is going to send PHY_DB commands
  131. */
  132. enum iwl_extended_cfg_flags {
  133. IWL_INIT_DEBUG_CFG,
  134. IWL_INIT_NVM,
  135. IWL_INIT_PHY,
  136. };
  137. /**
  138. * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
  139. * before finishing init flows
  140. * @init_flags: values from iwl_extended_cfg_flags
  141. */
  142. struct iwl_init_extended_cfg_cmd {
  143. __le32 init_flags;
  144. } __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
  145. /**
  146. * struct iwl_radio_version_notif - information on the radio version
  147. * ( RADIO_VERSION_NOTIFICATION = 0x68 )
  148. * @radio_flavor: radio flavor
  149. * @radio_step: radio version step
  150. * @radio_dash: radio version dash
  151. */
  152. struct iwl_radio_version_notif {
  153. __le32 radio_flavor;
  154. __le32 radio_step;
  155. __le32 radio_dash;
  156. } __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
  157. enum iwl_card_state_flags {
  158. CARD_ENABLED = 0x00,
  159. HW_CARD_DISABLED = 0x01,
  160. SW_CARD_DISABLED = 0x02,
  161. CT_KILL_CARD_DISABLED = 0x04,
  162. HALT_CARD_DISABLED = 0x08,
  163. CARD_DISABLED_MSK = 0x0f,
  164. CARD_IS_RX_ON = 0x10,
  165. };
  166. /**
  167. * struct iwl_radio_version_notif - information on the card state
  168. * ( CARD_STATE_NOTIFICATION = 0xa1 )
  169. * @flags: &enum iwl_card_state_flags
  170. */
  171. struct iwl_card_state_notif {
  172. __le32 flags;
  173. } __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
  174. /**
  175. * struct iwl_fseq_ver_mismatch_nty - Notification about version
  176. *
  177. * This notification does not have a direct impact on the init flow.
  178. * It means that another core (not WiFi) has initiated the FSEQ flow
  179. * and updated the FSEQ version. The driver only prints an error when
  180. * this occurs.
  181. *
  182. * @aux_read_fseq_ver: auxiliary read FSEQ version
  183. * @wifi_fseq_ver: FSEQ version (embedded in WiFi)
  184. */
  185. struct iwl_fseq_ver_mismatch_ntf {
  186. __le32 aux_read_fseq_ver;
  187. __le32 wifi_fseq_ver;
  188. } __packed; /* FSEQ_VER_MISMATCH_NTFY_API_S_VER_1 */
  189. #endif /* __iwl_fw_api_alive_h__ */