alive.h 6.2 KB

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