diff options
author | Kalle Valo <kvalo@codeaurora.org> | 2017-10-09 10:31:39 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-10-09 10:31:39 -0400 |
commit | a6127b4440d1f74f26b64006b2f50c9dc6d66efc (patch) | |
tree | 4a4fe25e07e97c4c0b8fb6807d573923e3404008 | |
parent | c503dd38f850be28867ef7a42d9abe5ade81a9bd (diff) | |
parent | 44fd09dad5d2b78efbabbbbf623774e561e36cca (diff) |
Merge tag 'iwlwifi-for-kalle-2017-10-06' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes
Second set of iwlwifi fixes for 4.14
* Fix support for 3168 device series;
* Fix a potential crash when using FW debugging recording;
* Improve channel flags parsing to avoid warnings on too long traces;
* Return -ENODATA when the temperature is not available, since the
-EIO we were returning was causing fatal errors in userspace;
* Avoid printing too many messages in dmesg when using monitor mode,
since this can become very noisy and completely flood the logs;
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/cfg/7000.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/cfg/8000.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/cfg/9000.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/cfg/a000.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 15 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-config.h | 16 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 137 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 2 |
15 files changed, 132 insertions, 95 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/7000.c b/drivers/net/wireless/intel/iwlwifi/cfg/7000.c index 45e2efc70d19..ce741beec1fc 100644 --- a/drivers/net/wireless/intel/iwlwifi/cfg/7000.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/7000.c | |||
@@ -309,6 +309,7 @@ const struct iwl_cfg iwl3168_2ac_cfg = { | |||
309 | .nvm_calib_ver = IWL3168_TX_POWER_VERSION, | 309 | .nvm_calib_ver = IWL3168_TX_POWER_VERSION, |
310 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, | 310 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, |
311 | .dccm_len = IWL7265_DCCM_LEN, | 311 | .dccm_len = IWL7265_DCCM_LEN, |
312 | .nvm_type = IWL_NVM_SDP, | ||
312 | }; | 313 | }; |
313 | 314 | ||
314 | const struct iwl_cfg iwl7265_2ac_cfg = { | 315 | const struct iwl_cfg iwl7265_2ac_cfg = { |
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/8000.c b/drivers/net/wireless/intel/iwlwifi/cfg/8000.c index 2e6c52664cee..c2a5936ccede 100644 --- a/drivers/net/wireless/intel/iwlwifi/cfg/8000.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/8000.c | |||
@@ -164,7 +164,7 @@ static const struct iwl_tt_params iwl8000_tt_params = { | |||
164 | .default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C, \ | 164 | .default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C, \ |
165 | .thermal_params = &iwl8000_tt_params, \ | 165 | .thermal_params = &iwl8000_tt_params, \ |
166 | .apmg_not_supported = true, \ | 166 | .apmg_not_supported = true, \ |
167 | .ext_nvm = true, \ | 167 | .nvm_type = IWL_NVM_EXT, \ |
168 | .dbgc_supported = true | 168 | .dbgc_supported = true |
169 | 169 | ||
170 | #define IWL_DEVICE_8000 \ | 170 | #define IWL_DEVICE_8000 \ |
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/9000.c b/drivers/net/wireless/intel/iwlwifi/cfg/9000.c index 2babe0a1f18b..e8b5ff42f5a8 100644 --- a/drivers/net/wireless/intel/iwlwifi/cfg/9000.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/9000.c | |||
@@ -148,7 +148,7 @@ static const struct iwl_tt_params iwl9000_tt_params = { | |||
148 | .vht_mu_mimo_supported = true, \ | 148 | .vht_mu_mimo_supported = true, \ |
149 | .mac_addr_from_csr = true, \ | 149 | .mac_addr_from_csr = true, \ |
150 | .rf_id = true, \ | 150 | .rf_id = true, \ |
151 | .ext_nvm = true, \ | 151 | .nvm_type = IWL_NVM_EXT, \ |
152 | .dbgc_supported = true | 152 | .dbgc_supported = true |
153 | 153 | ||
154 | const struct iwl_cfg iwl9160_2ac_cfg = { | 154 | const struct iwl_cfg iwl9160_2ac_cfg = { |
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/a000.c b/drivers/net/wireless/intel/iwlwifi/cfg/a000.c index 76ba1f8bc72f..a440140ed8dd 100644 --- a/drivers/net/wireless/intel/iwlwifi/cfg/a000.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/a000.c | |||
@@ -133,7 +133,7 @@ static const struct iwl_ht_params iwl_a000_ht_params = { | |||
133 | .use_tfh = true, \ | 133 | .use_tfh = true, \ |
134 | .rf_id = true, \ | 134 | .rf_id = true, \ |
135 | .gen2 = true, \ | 135 | .gen2 = true, \ |
136 | .ext_nvm = true, \ | 136 | .nvm_type = IWL_NVM_EXT, \ |
137 | .dbgc_supported = true | 137 | .dbgc_supported = true |
138 | 138 | ||
139 | const struct iwl_cfg iwla000_2ac_cfg_hr = { | 139 | const struct iwl_cfg iwla000_2ac_cfg_hr = { |
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h index 00bc7a25dece..3fd07bc80f54 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h | |||
@@ -108,6 +108,7 @@ enum iwl_nvm_access_target { | |||
108 | * @NVM_SECTION_TYPE_REGULATORY: regulatory section | 108 | * @NVM_SECTION_TYPE_REGULATORY: regulatory section |
109 | * @NVM_SECTION_TYPE_CALIBRATION: calibration section | 109 | * @NVM_SECTION_TYPE_CALIBRATION: calibration section |
110 | * @NVM_SECTION_TYPE_PRODUCTION: production section | 110 | * @NVM_SECTION_TYPE_PRODUCTION: production section |
111 | * @NVM_SECTION_TYPE_REGULATORY_SDP: regulatory section used by 3168 series | ||
111 | * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section | 112 | * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section |
112 | * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section | 113 | * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section |
113 | * @NVM_MAX_NUM_SECTIONS: number of sections | 114 | * @NVM_MAX_NUM_SECTIONS: number of sections |
@@ -117,6 +118,7 @@ enum iwl_nvm_section_type { | |||
117 | NVM_SECTION_TYPE_REGULATORY = 3, | 118 | NVM_SECTION_TYPE_REGULATORY = 3, |
118 | NVM_SECTION_TYPE_CALIBRATION = 4, | 119 | NVM_SECTION_TYPE_CALIBRATION = 4, |
119 | NVM_SECTION_TYPE_PRODUCTION = 5, | 120 | NVM_SECTION_TYPE_PRODUCTION = 5, |
121 | NVM_SECTION_TYPE_REGULATORY_SDP = 8, | ||
120 | NVM_SECTION_TYPE_MAC_OVERRIDE = 11, | 122 | NVM_SECTION_TYPE_MAC_OVERRIDE = 11, |
121 | NVM_SECTION_TYPE_PHY_SKU = 12, | 123 | NVM_SECTION_TYPE_PHY_SKU = 12, |
122 | NVM_MAX_NUM_SECTIONS = 13, | 124 | NVM_MAX_NUM_SECTIONS = 13, |
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index 6afc7a799892..f5dd7d83cd0a 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c | |||
@@ -1086,7 +1086,7 @@ void iwl_fw_error_dump_wk(struct work_struct *work) | |||
1086 | 1086 | ||
1087 | if (fwrt->trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) { | 1087 | if (fwrt->trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) { |
1088 | /* stop recording */ | 1088 | /* stop recording */ |
1089 | iwl_set_bits_prph(fwrt->trans, MON_BUFF_SAMPLE_CTL, 0x100); | 1089 | iwl_fw_dbg_stop_recording(fwrt); |
1090 | 1090 | ||
1091 | iwl_fw_error_dump(fwrt); | 1091 | iwl_fw_error_dump(fwrt); |
1092 | 1092 | ||
@@ -1104,10 +1104,7 @@ void iwl_fw_error_dump_wk(struct work_struct *work) | |||
1104 | u32 in_sample = iwl_read_prph(fwrt->trans, DBGC_IN_SAMPLE); | 1104 | u32 in_sample = iwl_read_prph(fwrt->trans, DBGC_IN_SAMPLE); |
1105 | u32 out_ctrl = iwl_read_prph(fwrt->trans, DBGC_OUT_CTRL); | 1105 | u32 out_ctrl = iwl_read_prph(fwrt->trans, DBGC_OUT_CTRL); |
1106 | 1106 | ||
1107 | /* stop recording */ | 1107 | iwl_fw_dbg_stop_recording(fwrt); |
1108 | iwl_write_prph(fwrt->trans, DBGC_IN_SAMPLE, 0); | ||
1109 | udelay(100); | ||
1110 | iwl_write_prph(fwrt->trans, DBGC_OUT_CTRL, 0); | ||
1111 | /* wait before we collect the data till the DBGC stop */ | 1108 | /* wait before we collect the data till the DBGC stop */ |
1112 | udelay(500); | 1109 | udelay(500); |
1113 | 1110 | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h index 0f810ea89d31..9c889a32fe24 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h | |||
@@ -68,6 +68,8 @@ | |||
68 | #include <linux/workqueue.h> | 68 | #include <linux/workqueue.h> |
69 | #include <net/cfg80211.h> | 69 | #include <net/cfg80211.h> |
70 | #include "runtime.h" | 70 | #include "runtime.h" |
71 | #include "iwl-prph.h" | ||
72 | #include "iwl-io.h" | ||
71 | #include "file.h" | 73 | #include "file.h" |
72 | #include "error-dump.h" | 74 | #include "error-dump.h" |
73 | 75 | ||
@@ -194,8 +196,21 @@ _iwl_fw_dbg_trigger_simple_stop(struct iwl_fw_runtime *fwrt, | |||
194 | iwl_fw_dbg_get_trigger((fwrt)->fw,\ | 196 | iwl_fw_dbg_get_trigger((fwrt)->fw,\ |
195 | (trig))) | 197 | (trig))) |
196 | 198 | ||
199 | static inline void iwl_fw_dbg_stop_recording(struct iwl_fw_runtime *fwrt) | ||
200 | { | ||
201 | if (fwrt->trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) { | ||
202 | iwl_set_bits_prph(fwrt->trans, MON_BUFF_SAMPLE_CTL, 0x100); | ||
203 | } else { | ||
204 | iwl_write_prph(fwrt->trans, DBGC_IN_SAMPLE, 0); | ||
205 | udelay(100); | ||
206 | iwl_write_prph(fwrt->trans, DBGC_OUT_CTRL, 0); | ||
207 | } | ||
208 | } | ||
209 | |||
197 | static inline void iwl_fw_dump_conf_clear(struct iwl_fw_runtime *fwrt) | 210 | static inline void iwl_fw_dump_conf_clear(struct iwl_fw_runtime *fwrt) |
198 | { | 211 | { |
212 | iwl_fw_dbg_stop_recording(fwrt); | ||
213 | |||
199 | fwrt->dump.conf = FW_DBG_INVALID; | 214 | fwrt->dump.conf = FW_DBG_INVALID; |
200 | } | 215 | } |
201 | 216 | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h index 3e057b539d5b..71cb1ecde0f7 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h | |||
@@ -108,6 +108,18 @@ enum iwl_led_mode { | |||
108 | IWL_LED_DISABLE, | 108 | IWL_LED_DISABLE, |
109 | }; | 109 | }; |
110 | 110 | ||
111 | /** | ||
112 | * enum iwl_nvm_type - nvm formats | ||
113 | * @IWL_NVM: the regular format | ||
114 | * @IWL_NVM_EXT: extended NVM format | ||
115 | * @IWL_NVM_SDP: NVM format used by 3168 series | ||
116 | */ | ||
117 | enum iwl_nvm_type { | ||
118 | IWL_NVM, | ||
119 | IWL_NVM_EXT, | ||
120 | IWL_NVM_SDP, | ||
121 | }; | ||
122 | |||
111 | /* | 123 | /* |
112 | * This is the threshold value of plcp error rate per 100mSecs. It is | 124 | * This is the threshold value of plcp error rate per 100mSecs. It is |
113 | * used to set and check for the validity of plcp_delta. | 125 | * used to set and check for the validity of plcp_delta. |
@@ -320,7 +332,7 @@ struct iwl_pwr_tx_backoff { | |||
320 | * @integrated: discrete or integrated | 332 | * @integrated: discrete or integrated |
321 | * @gen2: a000 and on transport operation | 333 | * @gen2: a000 and on transport operation |
322 | * @cdb: CDB support | 334 | * @cdb: CDB support |
323 | * @ext_nvm: extended NVM format | 335 | * @nvm_type: see &enum iwl_nvm_type |
324 | * | 336 | * |
325 | * We enable the driver to be backward compatible wrt. hardware features. | 337 | * We enable the driver to be backward compatible wrt. hardware features. |
326 | * API differences in uCode shouldn't be handled here but through TLVs | 338 | * API differences in uCode shouldn't be handled here but through TLVs |
@@ -342,6 +354,7 @@ struct iwl_cfg { | |||
342 | const struct iwl_tt_params *thermal_params; | 354 | const struct iwl_tt_params *thermal_params; |
343 | enum iwl_device_family device_family; | 355 | enum iwl_device_family device_family; |
344 | enum iwl_led_mode led_mode; | 356 | enum iwl_led_mode led_mode; |
357 | enum iwl_nvm_type nvm_type; | ||
345 | u32 max_data_size; | 358 | u32 max_data_size; |
346 | u32 max_inst_size; | 359 | u32 max_inst_size; |
347 | netdev_features_t features; | 360 | netdev_features_t features; |
@@ -369,7 +382,6 @@ struct iwl_cfg { | |||
369 | use_tfh:1, | 382 | use_tfh:1, |
370 | gen2:1, | 383 | gen2:1, |
371 | cdb:1, | 384 | cdb:1, |
372 | ext_nvm:1, | ||
373 | dbgc_supported:1; | 385 | dbgc_supported:1; |
374 | u8 valid_tx_ant; | 386 | u8 valid_tx_ant; |
375 | u8 valid_rx_ant; | 387 | u8 valid_rx_ant; |
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c index 3014beef4873..c3a5d8ccc95e 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | |||
@@ -77,7 +77,7 @@ | |||
77 | #include "iwl-csr.h" | 77 | #include "iwl-csr.h" |
78 | 78 | ||
79 | /* NVM offsets (in words) definitions */ | 79 | /* NVM offsets (in words) definitions */ |
80 | enum wkp_nvm_offsets { | 80 | enum nvm_offsets { |
81 | /* NVM HW-Section offset (in words) definitions */ | 81 | /* NVM HW-Section offset (in words) definitions */ |
82 | SUBSYSTEM_ID = 0x0A, | 82 | SUBSYSTEM_ID = 0x0A, |
83 | HW_ADDR = 0x15, | 83 | HW_ADDR = 0x15, |
@@ -92,7 +92,10 @@ enum wkp_nvm_offsets { | |||
92 | 92 | ||
93 | /* NVM calibration section offset (in words) definitions */ | 93 | /* NVM calibration section offset (in words) definitions */ |
94 | NVM_CALIB_SECTION = 0x2B8, | 94 | NVM_CALIB_SECTION = 0x2B8, |
95 | XTAL_CALIB = 0x316 - NVM_CALIB_SECTION | 95 | XTAL_CALIB = 0x316 - NVM_CALIB_SECTION, |
96 | |||
97 | /* NVM REGULATORY -Section offset (in words) definitions */ | ||
98 | NVM_CHANNELS_SDP = 0, | ||
96 | }; | 99 | }; |
97 | 100 | ||
98 | enum ext_nvm_offsets { | 101 | enum ext_nvm_offsets { |
@@ -206,8 +209,36 @@ enum iwl_nvm_channel_flags { | |||
206 | NVM_CHANNEL_DC_HIGH = BIT(12), | 209 | NVM_CHANNEL_DC_HIGH = BIT(12), |
207 | }; | 210 | }; |
208 | 211 | ||
212 | static inline void iwl_nvm_print_channel_flags(struct device *dev, u32 level, | ||
213 | int chan, u16 flags) | ||
214 | { | ||
209 | #define CHECK_AND_PRINT_I(x) \ | 215 | #define CHECK_AND_PRINT_I(x) \ |
210 | ((ch_flags & NVM_CHANNEL_##x) ? # x " " : "") | 216 | ((flags & NVM_CHANNEL_##x) ? " " #x : "") |
217 | |||
218 | if (!(flags & NVM_CHANNEL_VALID)) { | ||
219 | IWL_DEBUG_DEV(dev, level, "Ch. %d: 0x%x: No traffic\n", | ||
220 | chan, flags); | ||
221 | return; | ||
222 | } | ||
223 | |||
224 | /* Note: already can print up to 101 characters, 110 is the limit! */ | ||
225 | IWL_DEBUG_DEV(dev, level, | ||
226 | "Ch. %d: 0x%x:%s%s%s%s%s%s%s%s%s%s%s%s\n", | ||
227 | chan, flags, | ||
228 | CHECK_AND_PRINT_I(VALID), | ||
229 | CHECK_AND_PRINT_I(IBSS), | ||
230 | CHECK_AND_PRINT_I(ACTIVE), | ||
231 | CHECK_AND_PRINT_I(RADAR), | ||
232 | CHECK_AND_PRINT_I(INDOOR_ONLY), | ||
233 | CHECK_AND_PRINT_I(GO_CONCURRENT), | ||
234 | CHECK_AND_PRINT_I(UNIFORM), | ||
235 | CHECK_AND_PRINT_I(20MHZ), | ||
236 | CHECK_AND_PRINT_I(40MHZ), | ||
237 | CHECK_AND_PRINT_I(80MHZ), | ||
238 | CHECK_AND_PRINT_I(160MHZ), | ||
239 | CHECK_AND_PRINT_I(DC_HIGH)); | ||
240 | #undef CHECK_AND_PRINT_I | ||
241 | } | ||
211 | 242 | ||
212 | static u32 iwl_get_channel_flags(u8 ch_num, int ch_idx, bool is_5ghz, | 243 | static u32 iwl_get_channel_flags(u8 ch_num, int ch_idx, bool is_5ghz, |
213 | u16 nvm_flags, const struct iwl_cfg *cfg) | 244 | u16 nvm_flags, const struct iwl_cfg *cfg) |
@@ -215,7 +246,7 @@ static u32 iwl_get_channel_flags(u8 ch_num, int ch_idx, bool is_5ghz, | |||
215 | u32 flags = IEEE80211_CHAN_NO_HT40; | 246 | u32 flags = IEEE80211_CHAN_NO_HT40; |
216 | u32 last_5ghz_ht = LAST_5GHZ_HT; | 247 | u32 last_5ghz_ht = LAST_5GHZ_HT; |
217 | 248 | ||
218 | if (cfg->ext_nvm) | 249 | if (cfg->nvm_type == IWL_NVM_EXT) |
219 | last_5ghz_ht = LAST_5GHZ_HT_FAMILY_8000; | 250 | last_5ghz_ht = LAST_5GHZ_HT_FAMILY_8000; |
220 | 251 | ||
221 | if (!is_5ghz && (nvm_flags & NVM_CHANNEL_40MHZ)) { | 252 | if (!is_5ghz && (nvm_flags & NVM_CHANNEL_40MHZ)) { |
@@ -268,7 +299,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, | |||
268 | int num_of_ch, num_2ghz_channels; | 299 | int num_of_ch, num_2ghz_channels; |
269 | const u8 *nvm_chan; | 300 | const u8 *nvm_chan; |
270 | 301 | ||
271 | if (!cfg->ext_nvm) { | 302 | if (cfg->nvm_type != IWL_NVM_EXT) { |
272 | num_of_ch = IWL_NUM_CHANNELS; | 303 | num_of_ch = IWL_NUM_CHANNELS; |
273 | nvm_chan = &iwl_nvm_channels[0]; | 304 | nvm_chan = &iwl_nvm_channels[0]; |
274 | num_2ghz_channels = NUM_2GHZ_CHANNELS; | 305 | num_2ghz_channels = NUM_2GHZ_CHANNELS; |
@@ -302,12 +333,8 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, | |||
302 | * supported, hence we still want to add them to | 333 | * supported, hence we still want to add them to |
303 | * the list of supported channels to cfg80211. | 334 | * the list of supported channels to cfg80211. |
304 | */ | 335 | */ |
305 | IWL_DEBUG_EEPROM(dev, | 336 | iwl_nvm_print_channel_flags(dev, IWL_DL_EEPROM, |
306 | "Ch. %d Flags %x [%sGHz] - No traffic\n", | 337 | nvm_chan[ch_idx], ch_flags); |
307 | nvm_chan[ch_idx], | ||
308 | ch_flags, | ||
309 | (ch_idx >= num_2ghz_channels) ? | ||
310 | "5.2" : "2.4"); | ||
311 | continue; | 338 | continue; |
312 | } | 339 | } |
313 | 340 | ||
@@ -337,27 +364,10 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, | |||
337 | else | 364 | else |
338 | channel->flags = 0; | 365 | channel->flags = 0; |
339 | 366 | ||
340 | IWL_DEBUG_EEPROM(dev, | 367 | iwl_nvm_print_channel_flags(dev, IWL_DL_EEPROM, |
341 | "Ch. %d [%sGHz] flags 0x%x %s%s%s%s%s%s%s%s%s%s%s%s(%ddBm): Ad-Hoc %ssupported\n", | 368 | channel->hw_value, ch_flags); |
342 | channel->hw_value, | 369 | IWL_DEBUG_EEPROM(dev, "Ch. %d: %ddBm\n", |
343 | is_5ghz ? "5.2" : "2.4", | 370 | channel->hw_value, channel->max_power); |
344 | ch_flags, | ||
345 | CHECK_AND_PRINT_I(VALID), | ||
346 | CHECK_AND_PRINT_I(IBSS), | ||
347 | CHECK_AND_PRINT_I(ACTIVE), | ||
348 | CHECK_AND_PRINT_I(RADAR), | ||
349 | CHECK_AND_PRINT_I(INDOOR_ONLY), | ||
350 | CHECK_AND_PRINT_I(GO_CONCURRENT), | ||
351 | CHECK_AND_PRINT_I(UNIFORM), | ||
352 | CHECK_AND_PRINT_I(20MHZ), | ||
353 | CHECK_AND_PRINT_I(40MHZ), | ||
354 | CHECK_AND_PRINT_I(80MHZ), | ||
355 | CHECK_AND_PRINT_I(160MHZ), | ||
356 | CHECK_AND_PRINT_I(DC_HIGH), | ||
357 | channel->max_power, | ||
358 | ((ch_flags & NVM_CHANNEL_IBSS) && | ||
359 | !(ch_flags & NVM_CHANNEL_RADAR)) | ||
360 | ? "" : "not "); | ||
361 | } | 371 | } |
362 | 372 | ||
363 | return n_channels; | 373 | return n_channels; |
@@ -484,7 +494,7 @@ IWL_EXPORT_SYMBOL(iwl_init_sbands); | |||
484 | static int iwl_get_sku(const struct iwl_cfg *cfg, const __le16 *nvm_sw, | 494 | static int iwl_get_sku(const struct iwl_cfg *cfg, const __le16 *nvm_sw, |
485 | const __le16 *phy_sku) | 495 | const __le16 *phy_sku) |
486 | { | 496 | { |
487 | if (!cfg->ext_nvm) | 497 | if (cfg->nvm_type != IWL_NVM_EXT) |
488 | return le16_to_cpup(nvm_sw + SKU); | 498 | return le16_to_cpup(nvm_sw + SKU); |
489 | 499 | ||
490 | return le32_to_cpup((__le32 *)(phy_sku + SKU_FAMILY_8000)); | 500 | return le32_to_cpup((__le32 *)(phy_sku + SKU_FAMILY_8000)); |
@@ -492,7 +502,7 @@ static int iwl_get_sku(const struct iwl_cfg *cfg, const __le16 *nvm_sw, | |||
492 | 502 | ||
493 | static int iwl_get_nvm_version(const struct iwl_cfg *cfg, const __le16 *nvm_sw) | 503 | static int iwl_get_nvm_version(const struct iwl_cfg *cfg, const __le16 *nvm_sw) |
494 | { | 504 | { |
495 | if (!cfg->ext_nvm) | 505 | if (cfg->nvm_type != IWL_NVM_EXT) |
496 | return le16_to_cpup(nvm_sw + NVM_VERSION); | 506 | return le16_to_cpup(nvm_sw + NVM_VERSION); |
497 | else | 507 | else |
498 | return le32_to_cpup((__le32 *)(nvm_sw + | 508 | return le32_to_cpup((__le32 *)(nvm_sw + |
@@ -502,7 +512,7 @@ static int iwl_get_nvm_version(const struct iwl_cfg *cfg, const __le16 *nvm_sw) | |||
502 | static int iwl_get_radio_cfg(const struct iwl_cfg *cfg, const __le16 *nvm_sw, | 512 | static int iwl_get_radio_cfg(const struct iwl_cfg *cfg, const __le16 *nvm_sw, |
503 | const __le16 *phy_sku) | 513 | const __le16 *phy_sku) |
504 | { | 514 | { |
505 | if (!cfg->ext_nvm) | 515 | if (cfg->nvm_type != IWL_NVM_EXT) |
506 | return le16_to_cpup(nvm_sw + RADIO_CFG); | 516 | return le16_to_cpup(nvm_sw + RADIO_CFG); |
507 | 517 | ||
508 | return le32_to_cpup((__le32 *)(phy_sku + RADIO_CFG_FAMILY_EXT_NVM)); | 518 | return le32_to_cpup((__le32 *)(phy_sku + RADIO_CFG_FAMILY_EXT_NVM)); |
@@ -513,7 +523,7 @@ static int iwl_get_n_hw_addrs(const struct iwl_cfg *cfg, const __le16 *nvm_sw) | |||
513 | { | 523 | { |
514 | int n_hw_addr; | 524 | int n_hw_addr; |
515 | 525 | ||
516 | if (!cfg->ext_nvm) | 526 | if (cfg->nvm_type != IWL_NVM_EXT) |
517 | return le16_to_cpup(nvm_sw + N_HW_ADDRS); | 527 | return le16_to_cpup(nvm_sw + N_HW_ADDRS); |
518 | 528 | ||
519 | n_hw_addr = le32_to_cpup((__le32 *)(nvm_sw + N_HW_ADDRS_FAMILY_8000)); | 529 | n_hw_addr = le32_to_cpup((__le32 *)(nvm_sw + N_HW_ADDRS_FAMILY_8000)); |
@@ -525,7 +535,7 @@ static void iwl_set_radio_cfg(const struct iwl_cfg *cfg, | |||
525 | struct iwl_nvm_data *data, | 535 | struct iwl_nvm_data *data, |
526 | u32 radio_cfg) | 536 | u32 radio_cfg) |
527 | { | 537 | { |
528 | if (!cfg->ext_nvm) { | 538 | if (cfg->nvm_type != IWL_NVM_EXT) { |
529 | data->radio_cfg_type = NVM_RF_CFG_TYPE_MSK(radio_cfg); | 539 | data->radio_cfg_type = NVM_RF_CFG_TYPE_MSK(radio_cfg); |
530 | data->radio_cfg_step = NVM_RF_CFG_STEP_MSK(radio_cfg); | 540 | data->radio_cfg_step = NVM_RF_CFG_STEP_MSK(radio_cfg); |
531 | data->radio_cfg_dash = NVM_RF_CFG_DASH_MSK(radio_cfg); | 541 | data->radio_cfg_dash = NVM_RF_CFG_DASH_MSK(radio_cfg); |
@@ -634,7 +644,7 @@ static int iwl_set_hw_address(struct iwl_trans *trans, | |||
634 | { | 644 | { |
635 | if (cfg->mac_addr_from_csr) { | 645 | if (cfg->mac_addr_from_csr) { |
636 | iwl_set_hw_address_from_csr(trans, data); | 646 | iwl_set_hw_address_from_csr(trans, data); |
637 | } else if (!cfg->ext_nvm) { | 647 | } else if (cfg->nvm_type != IWL_NVM_EXT) { |
638 | const u8 *hw_addr = (const u8 *)(nvm_hw + HW_ADDR); | 648 | const u8 *hw_addr = (const u8 *)(nvm_hw + HW_ADDR); |
639 | 649 | ||
640 | /* The byte order is little endian 16 bit, meaning 214365 */ | 650 | /* The byte order is little endian 16 bit, meaning 214365 */ |
@@ -706,7 +716,7 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg, | |||
706 | u16 lar_config; | 716 | u16 lar_config; |
707 | const __le16 *ch_section; | 717 | const __le16 *ch_section; |
708 | 718 | ||
709 | if (!cfg->ext_nvm) | 719 | if (cfg->nvm_type != IWL_NVM_EXT) |
710 | data = kzalloc(sizeof(*data) + | 720 | data = kzalloc(sizeof(*data) + |
711 | sizeof(struct ieee80211_channel) * | 721 | sizeof(struct ieee80211_channel) * |
712 | IWL_NUM_CHANNELS, | 722 | IWL_NUM_CHANNELS, |
@@ -740,7 +750,7 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg, | |||
740 | 750 | ||
741 | data->n_hw_addrs = iwl_get_n_hw_addrs(cfg, nvm_sw); | 751 | data->n_hw_addrs = iwl_get_n_hw_addrs(cfg, nvm_sw); |
742 | 752 | ||
743 | if (!cfg->ext_nvm) { | 753 | if (cfg->nvm_type != IWL_NVM_EXT) { |
744 | /* Checking for required sections */ | 754 | /* Checking for required sections */ |
745 | if (!nvm_calib) { | 755 | if (!nvm_calib) { |
746 | IWL_ERR(trans, | 756 | IWL_ERR(trans, |
@@ -748,11 +758,15 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg, | |||
748 | kfree(data); | 758 | kfree(data); |
749 | return NULL; | 759 | return NULL; |
750 | } | 760 | } |
761 | |||
762 | ch_section = cfg->nvm_type == IWL_NVM_SDP ? | ||
763 | ®ulatory[NVM_CHANNELS_SDP] : | ||
764 | &nvm_sw[NVM_CHANNELS]; | ||
765 | |||
751 | /* in family 8000 Xtal calibration values moved to OTP */ | 766 | /* in family 8000 Xtal calibration values moved to OTP */ |
752 | data->xtal_calib[0] = *(nvm_calib + XTAL_CALIB); | 767 | data->xtal_calib[0] = *(nvm_calib + XTAL_CALIB); |
753 | data->xtal_calib[1] = *(nvm_calib + XTAL_CALIB + 1); | 768 | data->xtal_calib[1] = *(nvm_calib + XTAL_CALIB + 1); |
754 | lar_enabled = true; | 769 | lar_enabled = true; |
755 | ch_section = &nvm_sw[NVM_CHANNELS]; | ||
756 | } else { | 770 | } else { |
757 | u16 lar_offset = data->nvm_version < 0xE39 ? | 771 | u16 lar_offset = data->nvm_version < 0xE39 ? |
758 | NVM_LAR_OFFSET_OLD : | 772 | NVM_LAR_OFFSET_OLD : |
@@ -786,7 +800,7 @@ static u32 iwl_nvm_get_regdom_bw_flags(const u8 *nvm_chan, | |||
786 | u32 flags = NL80211_RRF_NO_HT40; | 800 | u32 flags = NL80211_RRF_NO_HT40; |
787 | u32 last_5ghz_ht = LAST_5GHZ_HT; | 801 | u32 last_5ghz_ht = LAST_5GHZ_HT; |
788 | 802 | ||
789 | if (cfg->ext_nvm) | 803 | if (cfg->nvm_type == IWL_NVM_EXT) |
790 | last_5ghz_ht = LAST_5GHZ_HT_FAMILY_8000; | 804 | last_5ghz_ht = LAST_5GHZ_HT_FAMILY_8000; |
791 | 805 | ||
792 | if (ch_idx < NUM_2GHZ_CHANNELS && | 806 | if (ch_idx < NUM_2GHZ_CHANNELS && |
@@ -834,7 +848,7 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, | |||
834 | int ch_idx; | 848 | int ch_idx; |
835 | u16 ch_flags; | 849 | u16 ch_flags; |
836 | u32 reg_rule_flags, prev_reg_rule_flags = 0; | 850 | u32 reg_rule_flags, prev_reg_rule_flags = 0; |
837 | const u8 *nvm_chan = cfg->ext_nvm ? | 851 | const u8 *nvm_chan = cfg->nvm_type == IWL_NVM_EXT ? |
838 | iwl_ext_nvm_channels : iwl_nvm_channels; | 852 | iwl_ext_nvm_channels : iwl_nvm_channels; |
839 | struct ieee80211_regdomain *regd; | 853 | struct ieee80211_regdomain *regd; |
840 | int size_of_regd; | 854 | int size_of_regd; |
@@ -843,7 +857,7 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, | |||
843 | int center_freq, prev_center_freq = 0; | 857 | int center_freq, prev_center_freq = 0; |
844 | int valid_rules = 0; | 858 | int valid_rules = 0; |
845 | bool new_rule; | 859 | bool new_rule; |
846 | int max_num_ch = cfg->ext_nvm ? | 860 | int max_num_ch = cfg->nvm_type == IWL_NVM_EXT ? |
847 | IWL_NUM_CHANNELS_EXT : IWL_NUM_CHANNELS; | 861 | IWL_NUM_CHANNELS_EXT : IWL_NUM_CHANNELS; |
848 | 862 | ||
849 | if (WARN_ON_ONCE(num_of_ch > NL80211_MAX_SUPP_REG_RULES)) | 863 | if (WARN_ON_ONCE(num_of_ch > NL80211_MAX_SUPP_REG_RULES)) |
@@ -873,12 +887,8 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, | |||
873 | new_rule = false; | 887 | new_rule = false; |
874 | 888 | ||
875 | if (!(ch_flags & NVM_CHANNEL_VALID)) { | 889 | if (!(ch_flags & NVM_CHANNEL_VALID)) { |
876 | IWL_DEBUG_DEV(dev, IWL_DL_LAR, | 890 | iwl_nvm_print_channel_flags(dev, IWL_DL_LAR, |
877 | "Ch. %d Flags %x [%sGHz] - No traffic\n", | 891 | nvm_chan[ch_idx], ch_flags); |
878 | nvm_chan[ch_idx], | ||
879 | ch_flags, | ||
880 | (ch_idx >= NUM_2GHZ_CHANNELS) ? | ||
881 | "5.2" : "2.4"); | ||
882 | continue; | 892 | continue; |
883 | } | 893 | } |
884 | 894 | ||
@@ -914,31 +924,8 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, | |||
914 | prev_center_freq = center_freq; | 924 | prev_center_freq = center_freq; |
915 | prev_reg_rule_flags = reg_rule_flags; | 925 | prev_reg_rule_flags = reg_rule_flags; |
916 | 926 | ||
917 | IWL_DEBUG_DEV(dev, IWL_DL_LAR, | 927 | iwl_nvm_print_channel_flags(dev, IWL_DL_LAR, |
918 | "Ch. %d [%sGHz] %s%s%s%s%s%s%s%s%s%s%s%s(0x%02x)\n", | 928 | nvm_chan[ch_idx], ch_flags); |
919 | center_freq, | ||
920 | band == NL80211_BAND_5GHZ ? "5.2" : "2.4", | ||
921 | CHECK_AND_PRINT_I(VALID), | ||
922 | CHECK_AND_PRINT_I(IBSS), | ||
923 | CHECK_AND_PRINT_I(ACTIVE), | ||
924 | CHECK_AND_PRINT_I(RADAR), | ||
925 | CHECK_AND_PRINT_I(INDOOR_ONLY), | ||
926 | CHECK_AND_PRINT_I(GO_CONCURRENT), | ||
927 | CHECK_AND_PRINT_I(UNIFORM), | ||
928 | CHECK_AND_PRINT_I(20MHZ), | ||
929 | CHECK_AND_PRINT_I(40MHZ), | ||
930 | CHECK_AND_PRINT_I(80MHZ), | ||
931 | CHECK_AND_PRINT_I(160MHZ), | ||
932 | CHECK_AND_PRINT_I(DC_HIGH), | ||
933 | ch_flags); | ||
934 | IWL_DEBUG_DEV(dev, IWL_DL_LAR, | ||
935 | "Ch. %d [%sGHz] reg_flags 0x%x: %s\n", | ||
936 | center_freq, | ||
937 | band == NL80211_BAND_5GHZ ? "5.2" : "2.4", | ||
938 | reg_rule_flags, | ||
939 | ((ch_flags & NVM_CHANNEL_ACTIVE) && | ||
940 | !(ch_flags & NVM_CHANNEL_RADAR)) | ||
941 | ? "Ad-Hoc" : ""); | ||
942 | } | 929 | } |
943 | 930 | ||
944 | regd->n_reg_rules = valid_rules; | 931 | regd->n_reg_rules = valid_rules; |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 3bcaa82f59b2..a9ac872226fd 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | |||
@@ -1077,6 +1077,7 @@ static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm) | |||
1077 | mvm->vif_count = 0; | 1077 | mvm->vif_count = 0; |
1078 | mvm->rx_ba_sessions = 0; | 1078 | mvm->rx_ba_sessions = 0; |
1079 | mvm->fwrt.dump.conf = FW_DBG_INVALID; | 1079 | mvm->fwrt.dump.conf = FW_DBG_INVALID; |
1080 | mvm->monitor_on = false; | ||
1080 | 1081 | ||
1081 | /* keep statistics ticking */ | 1082 | /* keep statistics ticking */ |
1082 | iwl_mvm_accu_radio_stats(mvm); | 1083 | iwl_mvm_accu_radio_stats(mvm); |
@@ -1437,6 +1438,9 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, | |||
1437 | mvm->p2p_device_vif = vif; | 1438 | mvm->p2p_device_vif = vif; |
1438 | } | 1439 | } |
1439 | 1440 | ||
1441 | if (vif->type == NL80211_IFTYPE_MONITOR) | ||
1442 | mvm->monitor_on = true; | ||
1443 | |||
1440 | iwl_mvm_vif_dbgfs_register(mvm, vif); | 1444 | iwl_mvm_vif_dbgfs_register(mvm, vif); |
1441 | goto out_unlock; | 1445 | goto out_unlock; |
1442 | 1446 | ||
@@ -1526,6 +1530,9 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw, | |||
1526 | iwl_mvm_power_update_mac(mvm); | 1530 | iwl_mvm_power_update_mac(mvm); |
1527 | iwl_mvm_mac_ctxt_remove(mvm, vif); | 1531 | iwl_mvm_mac_ctxt_remove(mvm, vif); |
1528 | 1532 | ||
1533 | if (vif->type == NL80211_IFTYPE_MONITOR) | ||
1534 | mvm->monitor_on = false; | ||
1535 | |||
1529 | out_release: | 1536 | out_release: |
1530 | mutex_unlock(&mvm->mutex); | 1537 | mutex_unlock(&mvm->mutex); |
1531 | } | 1538 | } |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 83303bac0e4b..949e63418299 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | |||
@@ -1015,6 +1015,9 @@ struct iwl_mvm { | |||
1015 | bool drop_bcn_ap_mode; | 1015 | bool drop_bcn_ap_mode; |
1016 | 1016 | ||
1017 | struct delayed_work cs_tx_unblock_dwork; | 1017 | struct delayed_work cs_tx_unblock_dwork; |
1018 | |||
1019 | /* does a monitor vif exist (only one can exist hence bool) */ | ||
1020 | bool monitor_on; | ||
1018 | #ifdef CONFIG_ACPI | 1021 | #ifdef CONFIG_ACPI |
1019 | struct iwl_mvm_sar_profile sar_profiles[IWL_MVM_SAR_PROFILE_NUM]; | 1022 | struct iwl_mvm_sar_profile sar_profiles[IWL_MVM_SAR_PROFILE_NUM]; |
1020 | struct iwl_mvm_geo_profile geo_profiles[IWL_NUM_GEO_PROFILES]; | 1023 | struct iwl_mvm_geo_profile geo_profiles[IWL_NUM_GEO_PROFILES]; |
@@ -1159,7 +1162,7 @@ static inline bool iwl_mvm_is_lar_supported(struct iwl_mvm *mvm) | |||
1159 | * Enable LAR only if it is supported by the FW (TLV) && | 1162 | * Enable LAR only if it is supported by the FW (TLV) && |
1160 | * enabled in the NVM | 1163 | * enabled in the NVM |
1161 | */ | 1164 | */ |
1162 | if (mvm->cfg->ext_nvm) | 1165 | if (mvm->cfg->nvm_type == IWL_NVM_EXT) |
1163 | return nvm_lar && tlv_lar; | 1166 | return nvm_lar && tlv_lar; |
1164 | else | 1167 | else |
1165 | return tlv_lar; | 1168 | return tlv_lar; |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c index 422aa6be9932..fb25b6f29323 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | |||
@@ -295,18 +295,24 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) | |||
295 | const __be16 *hw; | 295 | const __be16 *hw; |
296 | const __le16 *sw, *calib, *regulatory, *mac_override, *phy_sku; | 296 | const __le16 *sw, *calib, *regulatory, *mac_override, *phy_sku; |
297 | bool lar_enabled; | 297 | bool lar_enabled; |
298 | int regulatory_type; | ||
298 | 299 | ||
299 | /* Checking for required sections */ | 300 | /* Checking for required sections */ |
300 | if (!mvm->trans->cfg->ext_nvm) { | 301 | if (mvm->trans->cfg->nvm_type != IWL_NVM_EXT) { |
301 | if (!mvm->nvm_sections[NVM_SECTION_TYPE_SW].data || | 302 | if (!mvm->nvm_sections[NVM_SECTION_TYPE_SW].data || |
302 | !mvm->nvm_sections[mvm->cfg->nvm_hw_section_num].data) { | 303 | !mvm->nvm_sections[mvm->cfg->nvm_hw_section_num].data) { |
303 | IWL_ERR(mvm, "Can't parse empty OTP/NVM sections\n"); | 304 | IWL_ERR(mvm, "Can't parse empty OTP/NVM sections\n"); |
304 | return NULL; | 305 | return NULL; |
305 | } | 306 | } |
306 | } else { | 307 | } else { |
308 | if (mvm->trans->cfg->nvm_type == IWL_NVM_SDP) | ||
309 | regulatory_type = NVM_SECTION_TYPE_REGULATORY_SDP; | ||
310 | else | ||
311 | regulatory_type = NVM_SECTION_TYPE_REGULATORY; | ||
312 | |||
307 | /* SW and REGULATORY sections are mandatory */ | 313 | /* SW and REGULATORY sections are mandatory */ |
308 | if (!mvm->nvm_sections[NVM_SECTION_TYPE_SW].data || | 314 | if (!mvm->nvm_sections[NVM_SECTION_TYPE_SW].data || |
309 | !mvm->nvm_sections[NVM_SECTION_TYPE_REGULATORY].data) { | 315 | !mvm->nvm_sections[regulatory_type].data) { |
310 | IWL_ERR(mvm, | 316 | IWL_ERR(mvm, |
311 | "Can't parse empty family 8000 OTP/NVM sections\n"); | 317 | "Can't parse empty family 8000 OTP/NVM sections\n"); |
312 | return NULL; | 318 | return NULL; |
@@ -330,11 +336,14 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) | |||
330 | hw = (const __be16 *)sections[mvm->cfg->nvm_hw_section_num].data; | 336 | hw = (const __be16 *)sections[mvm->cfg->nvm_hw_section_num].data; |
331 | sw = (const __le16 *)sections[NVM_SECTION_TYPE_SW].data; | 337 | sw = (const __le16 *)sections[NVM_SECTION_TYPE_SW].data; |
332 | calib = (const __le16 *)sections[NVM_SECTION_TYPE_CALIBRATION].data; | 338 | calib = (const __le16 *)sections[NVM_SECTION_TYPE_CALIBRATION].data; |
333 | regulatory = (const __le16 *)sections[NVM_SECTION_TYPE_REGULATORY].data; | ||
334 | mac_override = | 339 | mac_override = |
335 | (const __le16 *)sections[NVM_SECTION_TYPE_MAC_OVERRIDE].data; | 340 | (const __le16 *)sections[NVM_SECTION_TYPE_MAC_OVERRIDE].data; |
336 | phy_sku = (const __le16 *)sections[NVM_SECTION_TYPE_PHY_SKU].data; | 341 | phy_sku = (const __le16 *)sections[NVM_SECTION_TYPE_PHY_SKU].data; |
337 | 342 | ||
343 | regulatory = mvm->trans->cfg->nvm_type == IWL_NVM_SDP ? | ||
344 | (const __le16 *)sections[NVM_SECTION_TYPE_REGULATORY_SDP].data : | ||
345 | (const __le16 *)sections[NVM_SECTION_TYPE_REGULATORY].data; | ||
346 | |||
338 | lar_enabled = !iwlwifi_mod_params.lar_disable && | 347 | lar_enabled = !iwlwifi_mod_params.lar_disable && |
339 | fw_has_capa(&mvm->fw->ucode_capa, | 348 | fw_has_capa(&mvm->fw->ucode_capa, |
340 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT); | 349 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT); |
@@ -394,7 +403,7 @@ int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm) | |||
394 | IWL_DEBUG_EEPROM(mvm->trans->dev, "Read from external NVM\n"); | 403 | IWL_DEBUG_EEPROM(mvm->trans->dev, "Read from external NVM\n"); |
395 | 404 | ||
396 | /* Maximal size depends on NVM version */ | 405 | /* Maximal size depends on NVM version */ |
397 | if (!mvm->trans->cfg->ext_nvm) | 406 | if (mvm->trans->cfg->nvm_type != IWL_NVM_EXT) |
398 | max_section_size = IWL_MAX_NVM_SECTION_SIZE; | 407 | max_section_size = IWL_MAX_NVM_SECTION_SIZE; |
399 | else | 408 | else |
400 | max_section_size = IWL_MAX_EXT_NVM_SECTION_SIZE; | 409 | max_section_size = IWL_MAX_EXT_NVM_SECTION_SIZE; |
@@ -465,7 +474,7 @@ int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm) | |||
465 | break; | 474 | break; |
466 | } | 475 | } |
467 | 476 | ||
468 | if (!mvm->trans->cfg->ext_nvm) { | 477 | if (mvm->trans->cfg->nvm_type != IWL_NVM_EXT) { |
469 | section_size = | 478 | section_size = |
470 | 2 * NVM_WORD1_LEN(le16_to_cpu(file_sec->word1)); | 479 | 2 * NVM_WORD1_LEN(le16_to_cpu(file_sec->word1)); |
471 | section_id = NVM_WORD2_ID(le16_to_cpu(file_sec->word2)); | 480 | section_id = NVM_WORD2_ID(le16_to_cpu(file_sec->word2)); |
@@ -740,7 +749,7 @@ int iwl_mvm_init_mcc(struct iwl_mvm *mvm) | |||
740 | struct ieee80211_regdomain *regd; | 749 | struct ieee80211_regdomain *regd; |
741 | char mcc[3]; | 750 | char mcc[3]; |
742 | 751 | ||
743 | if (mvm->cfg->ext_nvm) { | 752 | if (mvm->cfg->nvm_type == IWL_NVM_EXT) { |
744 | tlv_lar = fw_has_capa(&mvm->fw->ucode_capa, | 753 | tlv_lar = fw_has_capa(&mvm->fw->ucode_capa, |
745 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT); | 754 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT); |
746 | nvm_lar = mvm->nvm_data->lar_enabled; | 755 | nvm_lar = mvm->nvm_data->lar_enabled; |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c index 184c749766f2..2d14a58cbdd7 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c | |||
@@ -244,7 +244,9 @@ static u32 iwl_mvm_set_mac80211_rx_flag(struct iwl_mvm *mvm, | |||
244 | return 0; | 244 | return 0; |
245 | 245 | ||
246 | default: | 246 | default: |
247 | IWL_ERR(mvm, "Unhandled alg: 0x%x\n", rx_pkt_status); | 247 | /* Expected in monitor (not having the keys) */ |
248 | if (!mvm->monitor_on) | ||
249 | IWL_ERR(mvm, "Unhandled alg: 0x%x\n", rx_pkt_status); | ||
248 | } | 250 | } |
249 | 251 | ||
250 | return 0; | 252 | return 0; |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c index 77f77bc5d083..248699c2c4bf 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | |||
@@ -277,7 +277,9 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr, | |||
277 | stats->flag |= RX_FLAG_DECRYPTED; | 277 | stats->flag |= RX_FLAG_DECRYPTED; |
278 | return 0; | 278 | return 0; |
279 | default: | 279 | default: |
280 | IWL_ERR(mvm, "Unhandled alg: 0x%x\n", status); | 280 | /* Expected in monitor (not having the keys) */ |
281 | if (!mvm->monitor_on) | ||
282 | IWL_ERR(mvm, "Unhandled alg: 0x%x\n", status); | ||
281 | } | 283 | } |
282 | 284 | ||
283 | return 0; | 285 | return 0; |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c index 4d907f60bce9..1232f63278eb 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c | |||
@@ -631,7 +631,7 @@ static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device, | |||
631 | 631 | ||
632 | if (!iwl_mvm_firmware_running(mvm) || | 632 | if (!iwl_mvm_firmware_running(mvm) || |
633 | mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) { | 633 | mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) { |
634 | ret = -EIO; | 634 | ret = -ENODATA; |
635 | goto out; | 635 | goto out; |
636 | } | 636 | } |
637 | 637 | ||