Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
0002 /*
0003  * Copyright (C) 2012-2014, 2018, 2020-2021 Intel Corporation
0004  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
0005  * Copyright (C) 2016-2017 Intel Deutschland GmbH
0006  */
0007 #ifndef __iwl_fw_api_alive_h__
0008 #define __iwl_fw_api_alive_h__
0009 
0010 /* alive response is_valid values */
0011 #define ALIVE_RESP_UCODE_OK BIT(0)
0012 #define ALIVE_RESP_RFKILL   BIT(1)
0013 
0014 /* alive response ver_type values */
0015 enum {
0016     FW_TYPE_HW = 0,
0017     FW_TYPE_PROT = 1,
0018     FW_TYPE_AP = 2,
0019     FW_TYPE_WOWLAN = 3,
0020     FW_TYPE_TIMING = 4,
0021     FW_TYPE_WIPAN = 5
0022 };
0023 
0024 /* alive response ver_subtype values */
0025 enum {
0026     FW_SUBTYPE_FULL_FEATURE = 0,
0027     FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
0028     FW_SUBTYPE_REDUCED = 2,
0029     FW_SUBTYPE_ALIVE_ONLY = 3,
0030     FW_SUBTYPE_WOWLAN = 4,
0031     FW_SUBTYPE_AP_SUBTYPE = 5,
0032     FW_SUBTYPE_WIPAN = 6,
0033     FW_SUBTYPE_INITIALIZE = 9
0034 };
0035 
0036 #define IWL_ALIVE_STATUS_ERR 0xDEAD
0037 #define IWL_ALIVE_STATUS_OK 0xCAFE
0038 
0039 #define IWL_ALIVE_FLG_RFKILL    BIT(0)
0040 
0041 struct iwl_lmac_debug_addrs {
0042     __le32 error_event_table_ptr;   /* SRAM address for error log */
0043     __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
0044     __le32 cpu_register_ptr;
0045     __le32 dbgm_config_ptr;
0046     __le32 alive_counter_ptr;
0047     __le32 scd_base_ptr;        /* SRAM address for SCD */
0048     __le32 st_fwrd_addr;        /* pointer to Store and forward */
0049     __le32 st_fwrd_size;
0050 } __packed; /* UCODE_DEBUG_ADDRS_API_S_VER_2 */
0051 
0052 struct iwl_lmac_alive {
0053     __le32 ucode_major;
0054     __le32 ucode_minor;
0055     u8 ver_subtype;
0056     u8 ver_type;
0057     u8 mac;
0058     u8 opt;
0059     __le32 timestamp;
0060     struct iwl_lmac_debug_addrs dbg_ptrs;
0061 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
0062 
0063 struct iwl_umac_debug_addrs {
0064     __le32 error_info_addr;     /* SRAM address for UMAC error log */
0065     __le32 dbg_print_buff_addr;
0066 } __packed; /* UMAC_DEBUG_ADDRS_API_S_VER_1 */
0067 
0068 struct iwl_umac_alive {
0069     __le32 umac_major;      /* UMAC version: major */
0070     __le32 umac_minor;      /* UMAC version: minor */
0071     struct iwl_umac_debug_addrs dbg_ptrs;
0072 } __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
0073 
0074 struct iwl_sku_id {
0075     __le32 data[3];
0076 } __packed; /* SKU_ID_API_S_VER_1 */
0077 
0078 struct iwl_alive_ntf_v3 {
0079     __le16 status;
0080     __le16 flags;
0081     struct iwl_lmac_alive lmac_data;
0082     struct iwl_umac_alive umac_data;
0083 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
0084 
0085 struct iwl_alive_ntf_v4 {
0086     __le16 status;
0087     __le16 flags;
0088     struct iwl_lmac_alive lmac_data[2];
0089     struct iwl_umac_alive umac_data;
0090 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_4 */
0091 
0092 struct iwl_alive_ntf_v5 {
0093     __le16 status;
0094     __le16 flags;
0095     struct iwl_lmac_alive lmac_data[2];
0096     struct iwl_umac_alive umac_data;
0097     struct iwl_sku_id sku_id;
0098 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_5 */
0099 
0100 struct iwl_imr_alive_info {
0101     __le64 base_addr;
0102     __le32 size;
0103     __le32 enabled;
0104 } __packed; /* IMR_ALIVE_INFO_API_S_VER_1 */
0105 
0106 struct iwl_alive_ntf_v6 {
0107     __le16 status;
0108     __le16 flags;
0109     struct iwl_lmac_alive lmac_data[2];
0110     struct iwl_umac_alive umac_data;
0111     struct iwl_sku_id sku_id;
0112     struct iwl_imr_alive_info imr;
0113 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_6 */
0114 
0115 /**
0116  * enum iwl_extended_cfg_flag - commands driver may send before
0117  *  finishing init flow
0118  * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
0119  * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
0120  * @IWL_INIT_PHY: driver is going to send PHY_DB commands
0121  */
0122 enum iwl_extended_cfg_flags {
0123     IWL_INIT_DEBUG_CFG,
0124     IWL_INIT_NVM,
0125     IWL_INIT_PHY,
0126 };
0127 
0128 /**
0129  * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
0130  * before finishing init flows
0131  * @init_flags: values from iwl_extended_cfg_flags
0132  */
0133 struct iwl_init_extended_cfg_cmd {
0134     __le32 init_flags;
0135 } __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
0136 
0137 /**
0138  * struct iwl_radio_version_notif - information on the radio version
0139  * ( RADIO_VERSION_NOTIFICATION = 0x68 )
0140  * @radio_flavor: radio flavor
0141  * @radio_step: radio version step
0142  * @radio_dash: radio version dash
0143  */
0144 struct iwl_radio_version_notif {
0145     __le32 radio_flavor;
0146     __le32 radio_step;
0147     __le32 radio_dash;
0148 } __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
0149 
0150 enum iwl_card_state_flags {
0151     CARD_ENABLED        = 0x00,
0152     HW_CARD_DISABLED    = 0x01,
0153     SW_CARD_DISABLED    = 0x02,
0154     CT_KILL_CARD_DISABLED   = 0x04,
0155     HALT_CARD_DISABLED  = 0x08,
0156     CARD_DISABLED_MSK   = 0x0f,
0157     CARD_IS_RX_ON       = 0x10,
0158 };
0159 
0160 /**
0161  * enum iwl_error_recovery_flags - flags for error recovery cmd
0162  * @ERROR_RECOVERY_UPDATE_DB: update db from blob sent
0163  * @ERROR_RECOVERY_END_OF_RECOVERY: end of recovery
0164  */
0165 enum iwl_error_recovery_flags {
0166     ERROR_RECOVERY_UPDATE_DB = BIT(0),
0167     ERROR_RECOVERY_END_OF_RECOVERY = BIT(1),
0168 };
0169 
0170 /**
0171  * struct iwl_fw_error_recovery_cmd - recovery cmd sent upon assert
0172  * @flags: &enum iwl_error_recovery_flags
0173  * @buf_size: db buffer size in bytes
0174  */
0175 struct iwl_fw_error_recovery_cmd {
0176     __le32 flags;
0177     __le32 buf_size;
0178 } __packed; /* ERROR_RECOVERY_CMD_HDR_API_S_VER_1 */
0179 
0180 #endif /* __iwl_fw_api_alive_h__ */