Skip to content

Commit ce19801

Browse files
ilanpeer2lucacoelho
authored andcommitted
iwlwifi: mvm: Fix rate scale NSS configuration
The TLC configuration did not take into consideration the station's SMPS configuration, and thus configured rates for 2 NSS even if static SMPS was reported by the station. Fix this. Signed-off-by: Ilan Peer <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20200306151129.b4f940d13eca.Ieebfa889d08205a3a961ae0138fb5832e8a0f9c1@changeid
1 parent 699b760 commit ce19801

File tree

1 file changed

+21
-8
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+21
-8
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* GPL LICENSE SUMMARY
77
*
88
* Copyright(c) 2017 Intel Deutschland GmbH
9-
* Copyright(c) 2018 - 2019 Intel Corporation
9+
* Copyright(c) 2018 - 2020 Intel Corporation
1010
*
1111
* This program is free software; you can redistribute it and/or modify
1212
* it under the terms of version 2 of the GNU General Public License as
@@ -27,7 +27,7 @@
2727
* BSD LICENSE
2828
*
2929
* Copyright(c) 2017 Intel Deutschland GmbH
30-
* Copyright(c) 2018 - 2019 Intel Corporation
30+
* Copyright(c) 2018 - 2020 Intel Corporation
3131
* All rights reserved.
3232
*
3333
* Redistribution and use in source and binary forms, with or without
@@ -195,11 +195,13 @@ rs_fw_vht_set_enabled_rates(const struct ieee80211_sta *sta,
195195
{
196196
u16 supp;
197197
int i, highest_mcs;
198+
u8 nss = sta->rx_nss;
198199

199-
for (i = 0; i < sta->rx_nss; i++) {
200-
if (i == IWL_TLC_NSS_MAX)
201-
break;
200+
/* the station support only a single receive chain */
201+
if (sta->smps_mode == IEEE80211_SMPS_STATIC)
202+
nss = 1;
202203

204+
for (i = 0; i < nss && i < IWL_TLC_NSS_MAX; i++) {
203205
highest_mcs = rs_fw_vht_highest_rx_mcs_index(vht_cap, i + 1);
204206
if (!highest_mcs)
205207
continue;
@@ -245,8 +247,13 @@ rs_fw_he_set_enabled_rates(const struct ieee80211_sta *sta,
245247
u16 tx_mcs_160 =
246248
le16_to_cpu(sband->iftype_data->he_cap.he_mcs_nss_supp.tx_mcs_160);
247249
int i;
250+
u8 nss = sta->rx_nss;
248251

249-
for (i = 0; i < sta->rx_nss && i < IWL_TLC_NSS_MAX; i++) {
252+
/* the station support only a single receive chain */
253+
if (sta->smps_mode == IEEE80211_SMPS_STATIC)
254+
nss = 1;
255+
256+
for (i = 0; i < nss && i < IWL_TLC_NSS_MAX; i++) {
250257
u16 _mcs_160 = (mcs_160 >> (2 * i)) & 0x3;
251258
u16 _mcs_80 = (mcs_80 >> (2 * i)) & 0x3;
252259
u16 _tx_mcs_160 = (tx_mcs_160 >> (2 * i)) & 0x3;
@@ -307,8 +314,14 @@ static void rs_fw_set_supp_rates(struct ieee80211_sta *sta,
307314
cmd->mode = IWL_TLC_MNG_MODE_HT;
308315
cmd->ht_rates[IWL_TLC_NSS_1][IWL_TLC_HT_BW_NONE_160] =
309316
cpu_to_le16(ht_cap->mcs.rx_mask[0]);
310-
cmd->ht_rates[IWL_TLC_NSS_2][IWL_TLC_HT_BW_NONE_160] =
311-
cpu_to_le16(ht_cap->mcs.rx_mask[1]);
317+
318+
/* the station support only a single receive chain */
319+
if (sta->smps_mode == IEEE80211_SMPS_STATIC)
320+
cmd->ht_rates[IWL_TLC_NSS_2][IWL_TLC_HT_BW_NONE_160] =
321+
0;
322+
else
323+
cmd->ht_rates[IWL_TLC_NSS_2][IWL_TLC_HT_BW_NONE_160] =
324+
cpu_to_le16(ht_cap->mcs.rx_mask[1]);
312325
}
313326
}
314327

0 commit comments

Comments
 (0)