Skip to content

Commit eb9f75d

Browse files
author
Kalle Valo
committed
* fix ROC removal - avoids a firmware crash * fix throughput regression on iwldvm devices * fix panic in BT Coex * fixes in rate control * fixes in scan
2 parents c8f0345 + 4cd4b50 commit eb9f75d

File tree

10 files changed

+91
-39
lines changed

10 files changed

+91
-39
lines changed

drivers/net/wireless/iwlwifi/iwl-1000.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ static const struct iwl_eeprom_params iwl1000_eeprom_params = {
9595
.nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
9696
.base_params = &iwl1000_base_params, \
9797
.eeprom_params = &iwl1000_eeprom_params, \
98-
.led_mode = IWL_LED_BLINK
98+
.led_mode = IWL_LED_BLINK, \
99+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
99100

100101
const struct iwl_cfg iwl1000_bgn_cfg = {
101102
.name = "Intel(R) Centrino(R) Wireless-N 1000 BGN",
@@ -121,7 +122,8 @@ const struct iwl_cfg iwl1000_bg_cfg = {
121122
.base_params = &iwl1000_base_params, \
122123
.eeprom_params = &iwl1000_eeprom_params, \
123124
.led_mode = IWL_LED_RF_STATE, \
124-
.rx_with_siso_diversity = true
125+
.rx_with_siso_diversity = true, \
126+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
125127

126128
const struct iwl_cfg iwl100_bgn_cfg = {
127129
.name = "Intel(R) Centrino(R) Wireless-N 100 BGN",

drivers/net/wireless/iwlwifi/iwl-2000.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
123123
.nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
124124
.base_params = &iwl2000_base_params, \
125125
.eeprom_params = &iwl20x0_eeprom_params, \
126-
.led_mode = IWL_LED_RF_STATE
126+
.led_mode = IWL_LED_RF_STATE, \
127+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
128+
127129

128130
const struct iwl_cfg iwl2000_2bgn_cfg = {
129131
.name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
@@ -149,7 +151,8 @@ const struct iwl_cfg iwl2000_2bgn_d_cfg = {
149151
.nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
150152
.base_params = &iwl2030_base_params, \
151153
.eeprom_params = &iwl20x0_eeprom_params, \
152-
.led_mode = IWL_LED_RF_STATE
154+
.led_mode = IWL_LED_RF_STATE, \
155+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
153156

154157
const struct iwl_cfg iwl2030_2bgn_cfg = {
155158
.name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
@@ -170,7 +173,8 @@ const struct iwl_cfg iwl2030_2bgn_cfg = {
170173
.base_params = &iwl2000_base_params, \
171174
.eeprom_params = &iwl20x0_eeprom_params, \
172175
.led_mode = IWL_LED_RF_STATE, \
173-
.rx_with_siso_diversity = true
176+
.rx_with_siso_diversity = true, \
177+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
174178

175179
const struct iwl_cfg iwl105_bgn_cfg = {
176180
.name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
@@ -197,7 +201,8 @@ const struct iwl_cfg iwl105_bgn_d_cfg = {
197201
.base_params = &iwl2030_base_params, \
198202
.eeprom_params = &iwl20x0_eeprom_params, \
199203
.led_mode = IWL_LED_RF_STATE, \
200-
.rx_with_siso_diversity = true
204+
.rx_with_siso_diversity = true, \
205+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
201206

202207
const struct iwl_cfg iwl135_bgn_cfg = {
203208
.name = "Intel(R) Centrino(R) Wireless-N 135 BGN",

drivers/net/wireless/iwlwifi/iwl-5000.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ static const struct iwl_eeprom_params iwl5000_eeprom_params = {
9393
.nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
9494
.base_params = &iwl5000_base_params, \
9595
.eeprom_params = &iwl5000_eeprom_params, \
96-
.led_mode = IWL_LED_BLINK
96+
.led_mode = IWL_LED_BLINK, \
97+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
9798

9899
const struct iwl_cfg iwl5300_agn_cfg = {
99100
.name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
@@ -158,7 +159,8 @@ const struct iwl_cfg iwl5350_agn_cfg = {
158159
.base_params = &iwl5000_base_params, \
159160
.eeprom_params = &iwl5000_eeprom_params, \
160161
.led_mode = IWL_LED_BLINK, \
161-
.internal_wimax_coex = true
162+
.internal_wimax_coex = true, \
163+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
162164

163165
const struct iwl_cfg iwl5150_agn_cfg = {
164166
.name = "Intel(R) WiMAX/WiFi Link 5150 AGN",

drivers/net/wireless/iwlwifi/iwl-6000.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ static const struct iwl_eeprom_params iwl6000_eeprom_params = {
145145
.nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
146146
.base_params = &iwl6000_g2_base_params, \
147147
.eeprom_params = &iwl6000_eeprom_params, \
148-
.led_mode = IWL_LED_RF_STATE
148+
.led_mode = IWL_LED_RF_STATE, \
149+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
149150

150151
const struct iwl_cfg iwl6005_2agn_cfg = {
151152
.name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
@@ -199,7 +200,8 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
199200
.nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
200201
.base_params = &iwl6000_g2_base_params, \
201202
.eeprom_params = &iwl6000_eeprom_params, \
202-
.led_mode = IWL_LED_RF_STATE
203+
.led_mode = IWL_LED_RF_STATE, \
204+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
203205

204206
const struct iwl_cfg iwl6030_2agn_cfg = {
205207
.name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
@@ -235,7 +237,8 @@ const struct iwl_cfg iwl6030_2bg_cfg = {
235237
.nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
236238
.base_params = &iwl6000_g2_base_params, \
237239
.eeprom_params = &iwl6000_eeprom_params, \
238-
.led_mode = IWL_LED_RF_STATE
240+
.led_mode = IWL_LED_RF_STATE, \
241+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
239242

240243
const struct iwl_cfg iwl6035_2agn_cfg = {
241244
.name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
@@ -290,7 +293,8 @@ const struct iwl_cfg iwl130_bg_cfg = {
290293
.nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
291294
.base_params = &iwl6000_base_params, \
292295
.eeprom_params = &iwl6000_eeprom_params, \
293-
.led_mode = IWL_LED_BLINK
296+
.led_mode = IWL_LED_BLINK, \
297+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
294298

295299
const struct iwl_cfg iwl6000i_2agn_cfg = {
296300
.name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
@@ -322,7 +326,8 @@ const struct iwl_cfg iwl6000i_2bg_cfg = {
322326
.base_params = &iwl6050_base_params, \
323327
.eeprom_params = &iwl6000_eeprom_params, \
324328
.led_mode = IWL_LED_BLINK, \
325-
.internal_wimax_coex = true
329+
.internal_wimax_coex = true, \
330+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
326331

327332
const struct iwl_cfg iwl6050_2agn_cfg = {
328333
.name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
@@ -347,7 +352,8 @@ const struct iwl_cfg iwl6050_2abg_cfg = {
347352
.base_params = &iwl6050_base_params, \
348353
.eeprom_params = &iwl6000_eeprom_params, \
349354
.led_mode = IWL_LED_BLINK, \
350-
.internal_wimax_coex = true
355+
.internal_wimax_coex = true, \
356+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
351357

352358
const struct iwl_cfg iwl6150_bgn_cfg = {
353359
.name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",

drivers/net/wireless/iwlwifi/mvm/coex.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,8 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac,
793793
if (!vif->bss_conf.assoc)
794794
smps_mode = IEEE80211_SMPS_AUTOMATIC;
795795

796-
if (IWL_COEX_IS_RRC_ON(mvm->last_bt_notif.ttc_rrc_status,
796+
if (mvmvif->phy_ctxt &&
797+
IWL_COEX_IS_RRC_ON(mvm->last_bt_notif.ttc_rrc_status,
797798
mvmvif->phy_ctxt->id))
798799
smps_mode = IEEE80211_SMPS_AUTOMATIC;
799800

drivers/net/wireless/iwlwifi/mvm/coex_legacy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,8 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac,
832832
if (!vif->bss_conf.assoc)
833833
smps_mode = IEEE80211_SMPS_AUTOMATIC;
834834

835-
if (data->notif->rrc_enabled & BIT(mvmvif->phy_ctxt->id))
835+
if (mvmvif->phy_ctxt &&
836+
data->notif->rrc_enabled & BIT(mvmvif->phy_ctxt->id))
836837
smps_mode = IEEE80211_SMPS_AUTOMATIC;
837838

838839
IWL_DEBUG_COEX(data->mvm,

drivers/net/wireless/iwlwifi/mvm/mac80211.c

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,10 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
405405
hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
406406
&mvm->nvm_data->bands[IEEE80211_BAND_5GHZ];
407407

408-
if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_BEAMFORMER)
408+
if ((mvm->fw->ucode_capa.capa[0] &
409+
IWL_UCODE_TLV_CAPA_BEAMFORMER) &&
410+
(mvm->fw->ucode_capa.api[0] &
411+
IWL_UCODE_TLV_API_LQ_SS_PARAMS))
409412
hw->wiphy->bands[IEEE80211_BAND_5GHZ]->vht_cap.cap |=
410413
IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE;
411414
}
@@ -2215,7 +2218,19 @@ static void iwl_mvm_mac_cancel_hw_scan(struct ieee80211_hw *hw,
22152218

22162219
mutex_lock(&mvm->mutex);
22172220

2218-
iwl_mvm_cancel_scan(mvm);
2221+
/* Due to a race condition, it's possible that mac80211 asks
2222+
* us to stop a hw_scan when it's already stopped. This can
2223+
* happen, for instance, if we stopped the scan ourselves,
2224+
* called ieee80211_scan_completed() and the userspace called
2225+
* cancel scan scan before ieee80211_scan_work() could run.
2226+
* To handle that, simply return if the scan is not running.
2227+
*/
2228+
/* FIXME: for now, we ignore this race for UMAC scans, since
2229+
* they don't set the scan_status.
2230+
*/
2231+
if ((mvm->scan_status == IWL_MVM_SCAN_OS) ||
2232+
(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN))
2233+
iwl_mvm_cancel_scan(mvm);
22192234

22202235
mutex_unlock(&mvm->mutex);
22212236
}
@@ -2559,12 +2574,29 @@ static int iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw,
25592574
int ret;
25602575

25612576
mutex_lock(&mvm->mutex);
2577+
2578+
/* Due to a race condition, it's possible that mac80211 asks
2579+
* us to stop a sched_scan when it's already stopped. This
2580+
* can happen, for instance, if we stopped the scan ourselves,
2581+
* called ieee80211_sched_scan_stopped() and the userspace called
2582+
* stop sched scan scan before ieee80211_sched_scan_stopped_work()
2583+
* could run. To handle this, simply return if the scan is
2584+
* not running.
2585+
*/
2586+
/* FIXME: for now, we ignore this race for UMAC scans, since
2587+
* they don't set the scan_status.
2588+
*/
2589+
if (mvm->scan_status != IWL_MVM_SCAN_SCHED &&
2590+
!(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)) {
2591+
mutex_unlock(&mvm->mutex);
2592+
return 0;
2593+
}
2594+
25622595
ret = iwl_mvm_scan_offload_stop(mvm, false);
25632596
mutex_unlock(&mvm->mutex);
25642597
iwl_mvm_wait_for_async_handlers(mvm);
25652598

25662599
return ret;
2567-
25682600
}
25692601

25702602
static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,

drivers/net/wireless/iwlwifi/mvm/rs.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,12 @@ enum rs_column_mode {
134134
#define MAX_NEXT_COLUMNS 7
135135
#define MAX_COLUMN_CHECKS 3
136136

137+
struct rs_tx_column;
138+
137139
typedef bool (*allow_column_func_t) (struct iwl_mvm *mvm,
138140
struct ieee80211_sta *sta,
139-
struct iwl_scale_tbl_info *tbl);
141+
struct iwl_scale_tbl_info *tbl,
142+
const struct rs_tx_column *next_col);
140143

141144
struct rs_tx_column {
142145
enum rs_column_mode mode;
@@ -147,13 +150,15 @@ struct rs_tx_column {
147150
};
148151

149152
static bool rs_ant_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
150-
struct iwl_scale_tbl_info *tbl)
153+
struct iwl_scale_tbl_info *tbl,
154+
const struct rs_tx_column *next_col)
151155
{
152-
return iwl_mvm_bt_coex_is_ant_avail(mvm, tbl->rate.ant);
156+
return iwl_mvm_bt_coex_is_ant_avail(mvm, next_col->ant);
153157
}
154158

155159
static bool rs_mimo_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
156-
struct iwl_scale_tbl_info *tbl)
160+
struct iwl_scale_tbl_info *tbl,
161+
const struct rs_tx_column *next_col)
157162
{
158163
if (!sta->ht_cap.ht_supported)
159164
return false;
@@ -171,7 +176,8 @@ static bool rs_mimo_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
171176
}
172177

173178
static bool rs_siso_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
174-
struct iwl_scale_tbl_info *tbl)
179+
struct iwl_scale_tbl_info *tbl,
180+
const struct rs_tx_column *next_col)
175181
{
176182
if (!sta->ht_cap.ht_supported)
177183
return false;
@@ -180,7 +186,8 @@ static bool rs_siso_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
180186
}
181187

182188
static bool rs_sgi_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
183-
struct iwl_scale_tbl_info *tbl)
189+
struct iwl_scale_tbl_info *tbl,
190+
const struct rs_tx_column *next_col)
184191
{
185192
struct rs_rate *rate = &tbl->rate;
186193
struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
@@ -1590,7 +1597,7 @@ static enum rs_column rs_get_next_column(struct iwl_mvm *mvm,
15901597

15911598
for (j = 0; j < MAX_COLUMN_CHECKS; j++) {
15921599
allow_func = next_col->checks[j];
1593-
if (allow_func && !allow_func(mvm, sta, tbl))
1600+
if (allow_func && !allow_func(mvm, sta, tbl, next_col))
15941601
break;
15951602
}
15961603

drivers/net/wireless/iwlwifi/mvm/scan.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,10 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
11281128
if (mvm->scan_status == IWL_MVM_SCAN_NONE)
11291129
return 0;
11301130

1131-
if (iwl_mvm_is_radio_killed(mvm))
1131+
if (iwl_mvm_is_radio_killed(mvm)) {
1132+
ret = 0;
11321133
goto out;
1134+
}
11331135

11341136
if (mvm->scan_status != IWL_MVM_SCAN_SCHED &&
11351137
(!(mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_LMAC_SCAN) ||
@@ -1148,16 +1150,14 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
11481150
IWL_DEBUG_SCAN(mvm, "Send stop %sscan failed %d\n",
11491151
sched ? "offloaded " : "", ret);
11501152
iwl_remove_notification(&mvm->notif_wait, &wait_scan_done);
1151-
return ret;
1153+
goto out;
11521154
}
11531155

11541156
IWL_DEBUG_SCAN(mvm, "Successfully sent stop %sscan\n",
11551157
sched ? "offloaded " : "");
11561158

11571159
ret = iwl_wait_notification(&mvm->notif_wait, &wait_scan_done, 1 * HZ);
1158-
if (ret)
1159-
return ret;
1160-
1160+
out:
11611161
/*
11621162
* Clear the scan status so the next scan requests will succeed. This
11631163
* also ensures the Rx handler doesn't do anything, as the scan was
@@ -1167,7 +1167,6 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
11671167
if (mvm->scan_status == IWL_MVM_SCAN_OS)
11681168
iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
11691169

1170-
out:
11711170
mvm->scan_status = IWL_MVM_SCAN_NONE;
11721171

11731172
if (notify) {
@@ -1177,7 +1176,7 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
11771176
ieee80211_scan_completed(mvm->hw, true);
11781177
}
11791178

1180-
return 0;
1179+
return ret;
11811180
}
11821181

11831182
static void iwl_mvm_unified_scan_fill_tx_cmd(struct iwl_mvm *mvm,

drivers/net/wireless/iwlwifi/mvm/time-event.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,7 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm)
750750
* request
751751
*/
752752
list_for_each_entry(te_data, &mvm->time_event_list, list) {
753-
if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE &&
754-
te_data->running) {
753+
if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) {
755754
mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
756755
is_p2p = true;
757756
goto remove_te;
@@ -766,10 +765,8 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm)
766765
* request
767766
*/
768767
list_for_each_entry(te_data, &mvm->aux_roc_te_list, list) {
769-
if (te_data->running) {
770-
mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
771-
goto remove_te;
772-
}
768+
mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
769+
goto remove_te;
773770
}
774771

775772
remove_te:

0 commit comments

Comments
 (0)