aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorLiad Kaufman <liad.kaufman@intel.com>2014-12-01 03:44:18 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-12-28 03:17:41 -0500
commitf53bf4c758c0fbe728c031621f4c5f9979cdb044 (patch)
treeff3f15552349eba7c62c4b052deb7d24efe7bfe5 /drivers/net/wireless/iwlwifi
parente32ec12fd11fbccc1cb4656e34f35ad457e19e29 (diff)
iwlwifi: mvm: add fw runtime stack to dump data
The allocation of the DCCM between the data and the stack can theoretically change without notice to the driver, but the total size is HW-fixed. Since the stack CCM (runtime stack) has also data important to the FW - this patch allows pulling the whole DCCM in one piece and adds it to the dump data. If the size isn't known - just use the data part of the DCCM as it appears in the FW TLVs. 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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-7000.c23
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-8000.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-config.h4
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c15
4 files changed, 44 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c
index e5be2d21868f..9e76799c4750 100644
--- a/drivers/net/wireless/iwlwifi/iwl-7000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-7000.c
@@ -92,6 +92,12 @@
92#define IWL7265D_NVM_VERSION 0x0c11 92#define IWL7265D_NVM_VERSION 0x0c11
93#define IWL7265_TX_POWER_VERSION 0xffff /* meaningless */ 93#define IWL7265_TX_POWER_VERSION 0xffff /* meaningless */
94 94
95/* DCCM offsets and lengths */
96#define IWL7000_DCCM_OFFSET 0x800000
97#define IWL7260_DCCM_LEN 0x14000
98#define IWL3160_DCCM_LEN 0x10000
99#define IWL7265_DCCM_LEN 0x17A00
100
95#define IWL7260_FW_PRE "iwlwifi-7260-" 101#define IWL7260_FW_PRE "iwlwifi-7260-"
96#define IWL7260_MODULE_FIRMWARE(api) IWL7260_FW_PRE __stringify(api) ".ucode" 102#define IWL7260_MODULE_FIRMWARE(api) IWL7260_FW_PRE __stringify(api) ".ucode"
97 103
@@ -138,7 +144,8 @@ static const struct iwl_ht_params iwl7000_ht_params = {
138 .led_mode = IWL_LED_RF_STATE, \ 144 .led_mode = IWL_LED_RF_STATE, \
139 .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_7000, \ 145 .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_7000, \
140 .non_shared_ant = ANT_A, \ 146 .non_shared_ant = ANT_A, \
141 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K 147 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
148 .dccm_offset = IWL7000_DCCM_OFFSET
142 149
143const struct iwl_cfg iwl7260_2ac_cfg = { 150const struct iwl_cfg iwl7260_2ac_cfg = {
144 .name = "Intel(R) Dual Band Wireless AC 7260", 151 .name = "Intel(R) Dual Band Wireless AC 7260",
@@ -149,6 +156,7 @@ const struct iwl_cfg iwl7260_2ac_cfg = {
149 .nvm_calib_ver = IWL7260_TX_POWER_VERSION, 156 .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
150 .host_interrupt_operation_mode = true, 157 .host_interrupt_operation_mode = true,
151 .lp_xtal_workaround = true, 158 .lp_xtal_workaround = true,
159 .dccm_len = IWL7260_DCCM_LEN,
152}; 160};
153 161
154const struct iwl_cfg iwl7260_2ac_cfg_high_temp = { 162const struct iwl_cfg iwl7260_2ac_cfg_high_temp = {
@@ -161,6 +169,7 @@ const struct iwl_cfg iwl7260_2ac_cfg_high_temp = {
161 .high_temp = true, 169 .high_temp = true,
162 .host_interrupt_operation_mode = true, 170 .host_interrupt_operation_mode = true,
163 .lp_xtal_workaround = true, 171 .lp_xtal_workaround = true,
172 .dccm_len = IWL7260_DCCM_LEN,
164}; 173};
165 174
166const struct iwl_cfg iwl7260_2n_cfg = { 175const struct iwl_cfg iwl7260_2n_cfg = {
@@ -172,6 +181,7 @@ const struct iwl_cfg iwl7260_2n_cfg = {
172 .nvm_calib_ver = IWL7260_TX_POWER_VERSION, 181 .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
173 .host_interrupt_operation_mode = true, 182 .host_interrupt_operation_mode = true,
174 .lp_xtal_workaround = true, 183 .lp_xtal_workaround = true,
184 .dccm_len = IWL7260_DCCM_LEN,
175}; 185};
176 186
177const struct iwl_cfg iwl7260_n_cfg = { 187const struct iwl_cfg iwl7260_n_cfg = {
@@ -183,6 +193,7 @@ const struct iwl_cfg iwl7260_n_cfg = {
183 .nvm_calib_ver = IWL7260_TX_POWER_VERSION, 193 .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
184 .host_interrupt_operation_mode = true, 194 .host_interrupt_operation_mode = true,
185 .lp_xtal_workaround = true, 195 .lp_xtal_workaround = true,
196 .dccm_len = IWL7260_DCCM_LEN,
186}; 197};
187 198
188const struct iwl_cfg iwl3160_2ac_cfg = { 199const struct iwl_cfg iwl3160_2ac_cfg = {
@@ -193,6 +204,7 @@ const struct iwl_cfg iwl3160_2ac_cfg = {
193 .nvm_ver = IWL3160_NVM_VERSION, 204 .nvm_ver = IWL3160_NVM_VERSION,
194 .nvm_calib_ver = IWL3160_TX_POWER_VERSION, 205 .nvm_calib_ver = IWL3160_TX_POWER_VERSION,
195 .host_interrupt_operation_mode = true, 206 .host_interrupt_operation_mode = true,
207 .dccm_len = IWL3160_DCCM_LEN,
196}; 208};
197 209
198const struct iwl_cfg iwl3160_2n_cfg = { 210const struct iwl_cfg iwl3160_2n_cfg = {
@@ -203,6 +215,7 @@ const struct iwl_cfg iwl3160_2n_cfg = {
203 .nvm_ver = IWL3160_NVM_VERSION, 215 .nvm_ver = IWL3160_NVM_VERSION,
204 .nvm_calib_ver = IWL3160_TX_POWER_VERSION, 216 .nvm_calib_ver = IWL3160_TX_POWER_VERSION,
205 .host_interrupt_operation_mode = true, 217 .host_interrupt_operation_mode = true,
218 .dccm_len = IWL3160_DCCM_LEN,
206}; 219};
207 220
208const struct iwl_cfg iwl3160_n_cfg = { 221const struct iwl_cfg iwl3160_n_cfg = {
@@ -213,6 +226,7 @@ const struct iwl_cfg iwl3160_n_cfg = {
213 .nvm_ver = IWL3160_NVM_VERSION, 226 .nvm_ver = IWL3160_NVM_VERSION,
214 .nvm_calib_ver = IWL3160_TX_POWER_VERSION, 227 .nvm_calib_ver = IWL3160_TX_POWER_VERSION,
215 .host_interrupt_operation_mode = true, 228 .host_interrupt_operation_mode = true,
229 .dccm_len = IWL3160_DCCM_LEN,
216}; 230};
217 231
218static const struct iwl_pwr_tx_backoff iwl7265_pwr_tx_backoffs[] = { 232static const struct iwl_pwr_tx_backoff iwl7265_pwr_tx_backoffs[] = {
@@ -240,6 +254,7 @@ const struct iwl_cfg iwl3165_2ac_cfg = {
240 .nvm_ver = IWL3165_NVM_VERSION, 254 .nvm_ver = IWL3165_NVM_VERSION,
241 .nvm_calib_ver = IWL3165_TX_POWER_VERSION, 255 .nvm_calib_ver = IWL3165_TX_POWER_VERSION,
242 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 256 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
257 .dccm_len = IWL7265_DCCM_LEN,
243}; 258};
244 259
245const struct iwl_cfg iwl7265_2ac_cfg = { 260const struct iwl_cfg iwl7265_2ac_cfg = {
@@ -250,6 +265,7 @@ const struct iwl_cfg iwl7265_2ac_cfg = {
250 .nvm_ver = IWL7265_NVM_VERSION, 265 .nvm_ver = IWL7265_NVM_VERSION,
251 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 266 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
252 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 267 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
268 .dccm_len = IWL7265_DCCM_LEN,
253}; 269};
254 270
255const struct iwl_cfg iwl7265_2n_cfg = { 271const struct iwl_cfg iwl7265_2n_cfg = {
@@ -260,6 +276,7 @@ const struct iwl_cfg iwl7265_2n_cfg = {
260 .nvm_ver = IWL7265_NVM_VERSION, 276 .nvm_ver = IWL7265_NVM_VERSION,
261 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 277 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
262 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 278 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
279 .dccm_len = IWL7265_DCCM_LEN,
263}; 280};
264 281
265const struct iwl_cfg iwl7265_n_cfg = { 282const struct iwl_cfg iwl7265_n_cfg = {
@@ -270,6 +287,7 @@ const struct iwl_cfg iwl7265_n_cfg = {
270 .nvm_ver = IWL7265_NVM_VERSION, 287 .nvm_ver = IWL7265_NVM_VERSION,
271 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 288 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
272 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 289 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
290 .dccm_len = IWL7265_DCCM_LEN,
273}; 291};
274 292
275const struct iwl_cfg iwl7265d_2ac_cfg = { 293const struct iwl_cfg iwl7265d_2ac_cfg = {
@@ -280,6 +298,7 @@ const struct iwl_cfg iwl7265d_2ac_cfg = {
280 .nvm_ver = IWL7265D_NVM_VERSION, 298 .nvm_ver = IWL7265D_NVM_VERSION,
281 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 299 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
282 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 300 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
301 .dccm_len = IWL7265_DCCM_LEN,
283}; 302};
284 303
285const struct iwl_cfg iwl7265d_2n_cfg = { 304const struct iwl_cfg iwl7265d_2n_cfg = {
@@ -290,6 +309,7 @@ const struct iwl_cfg iwl7265d_2n_cfg = {
290 .nvm_ver = IWL7265D_NVM_VERSION, 309 .nvm_ver = IWL7265D_NVM_VERSION,
291 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 310 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
292 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 311 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
312 .dccm_len = IWL7265_DCCM_LEN,
293}; 313};
294 314
295const struct iwl_cfg iwl7265d_n_cfg = { 315const struct iwl_cfg iwl7265d_n_cfg = {
@@ -300,6 +320,7 @@ const struct iwl_cfg iwl7265d_n_cfg = {
300 .nvm_ver = IWL7265D_NVM_VERSION, 320 .nvm_ver = IWL7265D_NVM_VERSION,
301 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 321 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
302 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 322 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
323 .dccm_len = IWL7265_DCCM_LEN,
303}; 324};
304 325
305MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 326MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
diff --git a/drivers/net/wireless/iwlwifi/iwl-8000.c b/drivers/net/wireless/iwlwifi/iwl-8000.c
index bf0a95cb7153..6c5c55856a35 100644
--- a/drivers/net/wireless/iwlwifi/iwl-8000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-8000.c
@@ -81,6 +81,10 @@
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 */
85#define IWL8260_DCCM_OFFSET 0x800000
86#define IWL8260_DCCM_LEN 0x18000
87
84#define IWL8000_FW_PRE "iwlwifi-8000" 88#define IWL8000_FW_PRE "iwlwifi-8000"
85#define IWL8000_MODULE_FIRMWARE(api) \ 89#define IWL8000_MODULE_FIRMWARE(api) \
86 IWL8000_FW_PRE "-" __stringify(api) ".ucode" 90 IWL8000_FW_PRE "-" __stringify(api) ".ucode"
@@ -124,7 +128,9 @@ static const struct iwl_ht_params iwl8000_ht_params = {
124 .led_mode = IWL_LED_RF_STATE, \ 128 .led_mode = IWL_LED_RF_STATE, \
125 .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_8000, \ 129 .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_8000, \
126 .d0i3 = true, \ 130 .d0i3 = true, \
127 .non_shared_ant = ANT_A 131 .non_shared_ant = ANT_A, \
132 .dccm_offset = IWL8260_DCCM_OFFSET, \
133 .dccm_len = IWL8260_DCCM_LEN
128 134
129const struct iwl_cfg iwl8260_2n_cfg = { 135const struct iwl_cfg iwl8260_2n_cfg = {
130 .name = "Intel(R) Dual Band Wireless N 8260", 136 .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 3a4b9c7fc083..31c67dfabf55 100644
--- a/drivers/net/wireless/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/iwlwifi/iwl-config.h
@@ -261,6 +261,8 @@ struct iwl_pwr_tx_backoff {
261 * station can receive in HT 261 * station can receive in HT
262 * @max_vht_ampdu_exponent: the exponent of the max length of A-MPDU that the 262 * @max_vht_ampdu_exponent: the exponent of the max length of A-MPDU that the
263 * station can receive in VHT 263 * station can receive in VHT
264 * @dccm_offset: offset from which DCCM begins
265 * @dccm_len: length of DCCM (including runtime stack CCM)
264 * 266 *
265 * We enable the driver to be backward compatible wrt. hardware features. 267 * We enable the driver to be backward compatible wrt. hardware features.
266 * API differences in uCode shouldn't be handled here but through TLVs 268 * API differences in uCode shouldn't be handled here but through TLVs
@@ -303,6 +305,8 @@ struct iwl_cfg {
303 unsigned int max_tx_agg_size; 305 unsigned int max_tx_agg_size;
304 unsigned int max_ht_ampdu_exponent; 306 unsigned int max_ht_ampdu_exponent;
305 unsigned int max_vht_ampdu_exponent; 307 unsigned int max_vht_ampdu_exponent;
308 const u32 dccm_offset;
309 const u32 dccm_len;
306}; 310};
307 311
308/* 312/*
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 31a5b3f4266c..2d62b5617a56 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -767,7 +767,6 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)
767 struct iwl_fw_error_dump_data *dump_data; 767 struct iwl_fw_error_dump_data *dump_data;
768 struct iwl_fw_error_dump_info *dump_info; 768 struct iwl_fw_error_dump_info *dump_info;
769 struct iwl_mvm_dump_ptrs *fw_error_dump; 769 struct iwl_mvm_dump_ptrs *fw_error_dump;
770 const struct fw_img *img;
771 u32 sram_len, sram_ofs; 770 u32 sram_len, sram_ofs;
772 u32 file_len, rxf_len; 771 u32 file_len, rxf_len;
773 unsigned long flags; 772 unsigned long flags;
@@ -779,9 +778,17 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)
779 if (!fw_error_dump) 778 if (!fw_error_dump)
780 return; 779 return;
781 780
782 img = &mvm->fw->img[mvm->cur_ucode]; 781 /* SRAM - include stack CCM if driver knows the values for it */
783 sram_ofs = img->sec[IWL_UCODE_SECTION_DATA].offset; 782 if (!mvm->cfg->dccm_offset || !mvm->cfg->dccm_len) {
784 sram_len = img->sec[IWL_UCODE_SECTION_DATA].len; 783 const struct fw_img *img;
784
785 img = &mvm->fw->img[mvm->cur_ucode];
786 sram_ofs = img->sec[IWL_UCODE_SECTION_DATA].offset;
787 sram_len = img->sec[IWL_UCODE_SECTION_DATA].len;
788 } else {
789 sram_ofs = mvm->cfg->dccm_offset;
790 sram_len = mvm->cfg->dccm_len;
791 }
785 792
786 /* reading buffer size */ 793 /* reading buffer size */
787 reg_val = iwl_trans_read_prph(mvm->trans, RXF_SIZE_ADDR); 794 reg_val = iwl_trans_read_prph(mvm->trans, RXF_SIZE_ADDR);