diff options
author | Liad Kaufman <liad.kaufman@intel.com> | 2014-12-02 04:16:04 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-12-28 13:00:16 -0500 |
commit | addfaada8fd044ad8cb365a792a09b1b3265376f (patch) | |
tree | 7d1569580caf9307d76b1bac3e288852827e92cb | |
parent | 363039be5b9dcbb9df9136c7106d8775f71e43c6 (diff) |
iwlwifi: mvm: add smem content to dump data
In NICs that have SMEM - add its content to the dump data
for later debug.
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-8000.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-config.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 19 |
4 files changed, 31 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-8000.c b/drivers/net/wireless/iwlwifi/iwl-8000.c index 8f64928aeb42..46e9c9ac6ba2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-8000.c +++ b/drivers/net/wireless/iwlwifi/iwl-8000.c | |||
@@ -81,9 +81,11 @@ | |||
81 | #define IWL8000_NVM_VERSION 0x0a1d | 81 | #define IWL8000_NVM_VERSION 0x0a1d |
82 | #define IWL8000_TX_POWER_VERSION 0xffff /* meaningless */ | 82 | #define IWL8000_TX_POWER_VERSION 0xffff /* meaningless */ |
83 | 83 | ||
84 | /* DCCM offsets and lengths */ | 84 | /* Memory offsets and lengths */ |
85 | #define IWL8260_DCCM_OFFSET 0x800000 | 85 | #define IWL8260_DCCM_OFFSET 0x800000 |
86 | #define IWL8260_DCCM_LEN 0x18000 | 86 | #define IWL8260_DCCM_LEN 0x18000 |
87 | #define IWL8260_SMEM_OFFSET 0x400000 | ||
88 | #define IWL8260_SMEM_LEN 0x68000 | ||
87 | 89 | ||
88 | #define IWL8000_FW_PRE "iwlwifi-8000" | 90 | #define IWL8000_FW_PRE "iwlwifi-8000" |
89 | #define IWL8000_MODULE_FIRMWARE(api) \ | 91 | #define IWL8000_MODULE_FIRMWARE(api) \ |
@@ -131,7 +133,9 @@ static const struct iwl_ht_params iwl8000_ht_params = { | |||
131 | .d0i3 = true, \ | 133 | .d0i3 = true, \ |
132 | .non_shared_ant = ANT_A, \ | 134 | .non_shared_ant = ANT_A, \ |
133 | .dccm_offset = IWL8260_DCCM_OFFSET, \ | 135 | .dccm_offset = IWL8260_DCCM_OFFSET, \ |
134 | .dccm_len = IWL8260_DCCM_LEN | 136 | .dccm_len = IWL8260_DCCM_LEN, \ |
137 | .smem_offset = IWL8260_SMEM_OFFSET, \ | ||
138 | .smem_len = IWL8260_SMEM_LEN | ||
135 | 139 | ||
136 | const struct iwl_cfg iwl8260_2n_cfg = { | 140 | const struct iwl_cfg iwl8260_2n_cfg = { |
137 | .name = "Intel(R) Dual Band Wireless N 8260", | 141 | .name = "Intel(R) Dual Band Wireless N 8260", |
diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h index 2daabab7ec3f..398505121b59 100644 --- a/drivers/net/wireless/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/iwlwifi/iwl-config.h | |||
@@ -263,6 +263,8 @@ struct iwl_pwr_tx_backoff { | |||
263 | * station can receive in VHT | 263 | * station can receive in VHT |
264 | * @dccm_offset: offset from which DCCM begins | 264 | * @dccm_offset: offset from which DCCM begins |
265 | * @dccm_len: length of DCCM (including runtime stack CCM) | 265 | * @dccm_len: length of DCCM (including runtime stack CCM) |
266 | * @smem_offset: offset from which the SMEM begins | ||
267 | * @smem_len: the length of SMEM | ||
266 | * | 268 | * |
267 | * We enable the driver to be backward compatible wrt. hardware features. | 269 | * We enable the driver to be backward compatible wrt. hardware features. |
268 | * API differences in uCode shouldn't be handled here but through TLVs | 270 | * API differences in uCode shouldn't be handled here but through TLVs |
@@ -308,6 +310,8 @@ struct iwl_cfg { | |||
308 | unsigned int max_vht_ampdu_exponent; | 310 | unsigned int max_vht_ampdu_exponent; |
309 | const u32 dccm_offset; | 311 | const u32 dccm_offset; |
310 | const u32 dccm_len; | 312 | const u32 dccm_len; |
313 | const u32 smem_offset; | ||
314 | const u32 smem_len; | ||
311 | }; | 315 | }; |
312 | 316 | ||
313 | /* | 317 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h b/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h index 20a8a64c9fe3..c6a81a760cf6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h | |||
@@ -82,6 +82,7 @@ | |||
82 | * @IWL_FW_ERROR_DUMP_PRPH: range of periphery registers - there can be several | 82 | * @IWL_FW_ERROR_DUMP_PRPH: range of periphery registers - there can be several |
83 | * sections like this in a single file. | 83 | * sections like this in a single file. |
84 | * @IWL_FW_ERROR_DUMP_FH_REGS: range of FH registers | 84 | * @IWL_FW_ERROR_DUMP_FH_REGS: range of FH registers |
85 | * @IWL_FW_ERROR_DUMP_SMEM: | ||
85 | */ | 86 | */ |
86 | enum iwl_fw_error_dump_type { | 87 | enum iwl_fw_error_dump_type { |
87 | IWL_FW_ERROR_DUMP_SRAM = 0, | 88 | IWL_FW_ERROR_DUMP_SRAM = 0, |
@@ -93,6 +94,7 @@ enum iwl_fw_error_dump_type { | |||
93 | IWL_FW_ERROR_DUMP_PRPH = 6, | 94 | IWL_FW_ERROR_DUMP_PRPH = 6, |
94 | IWL_FW_ERROR_DUMP_TXF = 7, | 95 | IWL_FW_ERROR_DUMP_TXF = 7, |
95 | IWL_FW_ERROR_DUMP_FH_REGS = 8, | 96 | IWL_FW_ERROR_DUMP_FH_REGS = 8, |
97 | IWL_FW_ERROR_DUMP_SMEM = 9, | ||
96 | 98 | ||
97 | IWL_FW_ERROR_DUMP_MAX, | 99 | IWL_FW_ERROR_DUMP_MAX, |
98 | }; | 100 | }; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index f53bfd6e8df8..d5d1cdaa0310 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -774,9 +774,16 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) | |||
774 | u32 file_len, rxf_len; | 774 | u32 file_len, rxf_len; |
775 | unsigned long flags; | 775 | unsigned long flags; |
776 | int reg_val; | 776 | int reg_val; |
777 | u32 smem_len = mvm->cfg->smem_len; | ||
777 | 778 | ||
778 | lockdep_assert_held(&mvm->mutex); | 779 | lockdep_assert_held(&mvm->mutex); |
779 | 780 | ||
781 | /* W/A for 8000 HW family A-step */ | ||
782 | if (mvm->cfg->smem_len && | ||
783 | mvm->cfg->device_family == IWL_DEVICE_FAMILY_8000 && | ||
784 | CSR_HW_REV_STEP(mvm->trans->hw_rev) == SILICON_A_STEP) | ||
785 | smem_len = 0x38000; | ||
786 | |||
780 | fw_error_dump = kzalloc(sizeof(*fw_error_dump), GFP_KERNEL); | 787 | fw_error_dump = kzalloc(sizeof(*fw_error_dump), GFP_KERNEL); |
781 | if (!fw_error_dump) | 788 | if (!fw_error_dump) |
782 | return; | 789 | return; |
@@ -806,6 +813,10 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) | |||
806 | rxf_len + | 813 | rxf_len + |
807 | sizeof(*dump_info); | 814 | sizeof(*dump_info); |
808 | 815 | ||
816 | /* Make room for the SMEM, if it exists */ | ||
817 | if (smem_len) | ||
818 | file_len += sizeof(*dump_data) + smem_len; | ||
819 | |||
809 | dump_file = vzalloc(file_len); | 820 | dump_file = vzalloc(file_len); |
810 | if (!dump_file) { | 821 | if (!dump_file) { |
811 | kfree(fw_error_dump); | 822 | kfree(fw_error_dump); |
@@ -856,6 +867,14 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) | |||
856 | iwl_trans_read_mem_bytes(mvm->trans, sram_ofs, dump_data->data, | 867 | iwl_trans_read_mem_bytes(mvm->trans, sram_ofs, dump_data->data, |
857 | sram_len); | 868 | sram_len); |
858 | 869 | ||
870 | if (smem_len) { | ||
871 | dump_data = iwl_fw_error_next_data(dump_data); | ||
872 | dump_data->type = cpu_to_le32(IWL_FW_ERROR_DUMP_SMEM); | ||
873 | dump_data->len = cpu_to_le32(smem_len); | ||
874 | iwl_trans_read_mem_bytes(mvm->trans, mvm->cfg->smem_offset, | ||
875 | dump_data->data, smem_len); | ||
876 | } | ||
877 | |||
859 | fw_error_dump->trans_ptr = iwl_trans_dump_data(mvm->trans); | 878 | fw_error_dump->trans_ptr = iwl_trans_dump_data(mvm->trans); |
860 | fw_error_dump->op_mode_len = file_len; | 879 | fw_error_dump->op_mode_len = file_len; |
861 | if (fw_error_dump->trans_ptr) | 880 | if (fw_error_dump->trans_ptr) |