Skip to content

Commit 823a970

Browse files
Miriam-Racheljmberg-intel
authored andcommitted
wifi: iwlwifi: fix max number of fw active links
The max active links that are supported by the FW is hard coded. This is wrong since this value is HW-dependent. Fix this by determining according to the actual HW. Also remove a redundant check that the number of active links doesn't exceeds the maximum. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230615094410.e78ad74c6715.I68b26911c0a312d72eaf25344b448d03b1c61f4e@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 6e21e7b commit 823a970

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/link.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -118,24 +118,6 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
118118
if (!link_info->phy_ctxt)
119119
return 0;
120120

121-
/* check there aren't too many active links */
122-
if (!link_info->active && active) {
123-
int i, count = 0;
124-
125-
/* link with phy_ctxt is active in FW */
126-
for_each_mvm_vif_valid_link(mvmvif, i)
127-
if (mvmvif->link[i]->phy_ctxt)
128-
count++;
129-
130-
if (vif->type == NL80211_IFTYPE_AP) {
131-
if (count > mvm->fw->ucode_capa.num_beacons)
132-
return -EOPNOTSUPP;
133-
/* this should be per HW or such */
134-
} else if (count >= IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM) {
135-
return -EOPNOTSUPP;
136-
}
137-
}
138-
139121
/* Catch early if driver tries to activate or deactivate a link
140122
* twice.
141123
*/

drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -900,9 +900,7 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw,
900900
u16 added = new_links & ~old_links;
901901
int err, i;
902902

903-
if (hweight16(new_links) > 2) {
904-
return -EOPNOTSUPP;
905-
} else if (hweight16(new_links) > 1) {
903+
if (hweight16(new_links) > 1) {
906904
unsigned int n_active = 0;
907905

908906
for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
@@ -917,7 +915,7 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw,
917915
if (vif->type == NL80211_IFTYPE_AP) {
918916
if (n_active > mvm->fw->ucode_capa.num_beacons)
919917
return -EOPNOTSUPP;
920-
} else if (n_active > 1) {
918+
} else if (n_active > iwl_mvm_max_active_links(mvm)) {
921919
return -EOPNOTSUPP;
922920
}
923921
}

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,6 +1544,28 @@ static inline bool iwl_mvm_is_ctdp_supported(struct iwl_mvm *mvm)
15441544
IWL_UCODE_TLV_CAPA_CTDP_SUPPORT);
15451545
}
15461546

1547+
static inline bool iwl_mvm_is_esr_supported(struct iwl_trans *trans)
1548+
{
1549+
if ((CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM) &&
1550+
!CSR_HW_RFID_IS_CDB(trans->hw_rf_id))
1551+
/* Step A doesn't support eSR */
1552+
return CSR_HW_RFID_STEP(trans->hw_rf_id);
1553+
1554+
return false;
1555+
}
1556+
1557+
static inline int iwl_mvm_max_active_links(struct iwl_mvm *mvm)
1558+
{
1559+
struct iwl_trans *trans = mvm->fwrt.trans;
1560+
1561+
if (iwl_mvm_is_esr_supported(trans) ||
1562+
(CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM &&
1563+
CSR_HW_RFID_IS_CDB(trans->hw_rf_id)))
1564+
return IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM;
1565+
1566+
return 1;
1567+
}
1568+
15471569
extern const u8 iwl_mvm_ac_to_tx_fifo[];
15481570
extern const u8 iwl_mvm_ac_to_gen2_tx_fifo[];
15491571

0 commit comments

Comments
 (0)