wifi: iwlwifi: updates intended for v6.4 2023-04-16
cover wifi: iwlwifi: updates intended for v6.4 2023-04-16
From: Gregory Greenman <[email protected]>
Hi,
Here's one more set of iwlwifi patches for v6.4. Same as few patch sets before, this set contains the ususal developement, small improvements, cleanups and bugfixes. It bumps FW API to 77 as well.
Thanks,
Gregory
Avraham Stern (1):
wifi: iwlwifi: mvm: avoid iterating over an un-initialized list
Emmanuel Grumbach (1):
wifi: iwlwifi: make the loop for card preparation effective
Golan Ben Ami (1):
wifi: iwlwifi: move debug buffer allocation failure to info verbosity
Gregory Greenman (2):
wifi: iwlwifi: call napi_synchronize() before freeing rx/tx queues
wifi: iwlwifi: bump FW API to 77 for AX devices
Ilan Peer (1):
wifi: iwlwifi: mvm: Fix _iwl_mvm_get_scan_type()
Johannes Berg (9):
wifi: iwlwifi: nvm-parse: add full BW UL MU-MIMO support
wifi: iwlwifi: mvm: fix getting lowest TX rate for MLO
wifi: iwlwifi: mvm: properly implement HE AP support
wifi: iwlwifi: mvm: factor out iwl_mvm_sta_fw_id_mask()
wifi: iwlwifi: mvm: use correct sta mask to remove queue
wifi: iwlwifi: mvm: track station mask for BAIDs
wifi: iwlwifi: mvm: implement BAID link switching
wifi: iwlwifi: mvm: implement key link switching
wifi: iwlwifi: mvm: allow number of beacons from FW
.../net/wireless/intel/iwlwifi/cfg/22000.c | 2 +- .../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 4 +- drivers/net/wireless/intel/iwlwifi/fw/file.h | 1 + drivers/net/wireless/intel/iwlwifi/fw/img.h | 1 + .../net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 2 +- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 7 + .../wireless/intel/iwlwifi/iwl-nvm-parse.c | 4 + drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 2 - .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 31 +++- .../net/wireless/intel/iwlwifi/mvm/mld-key.c | 86 +++++++---- .../net/wireless/intel/iwlwifi/mvm/mld-mac.c | 14 +- .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 5 +- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 133 ++++++++++++++++-- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 9 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 34 +++-- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 5 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 23 +-- drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 2 + .../wireless/intel/iwlwifi/pcie/internal.h | 1 + drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 18 ++- .../wireless/intel/iwlwifi/pcie/trans-gen2.c | 1 + .../net/wireless/intel/iwlwifi/pcie/trans.c | 4 +- 23 files changed, 308 insertions(+), 83 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/15 wifi: iwlwifi: nvm-parse: add full BW UL MU-MIMO support
From: Johannes Berg <[email protected]>
For some devices, in client mode, we support full bandwidth uplink multi-user MIMO. Add the necessary capability.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +4 -0
@@ -938,6 +938,10 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans, } } +if (trans->trans_cfg->device_family >=IWL_DEVICE_FAMILY_AX210 && !is_ap) + iftype_data->he_cap.he_cap_elem.phy_cap_info[2 ] |= +IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO ; +switch (CSR_HW_RFID_TYPE (trans->hw_rf_id)) {case IWL_CFG_RF_TYPE_GF :case IWL_CFG_RF_TYPE_MR :
Signature · 1 line
2.38.1
PATCH 2/15 wifi: iwlwifi: call napi_synchronize() before freeing rx/tx queues
In reply to [email protected]From: Gregory Greenman <[email protected]>
When rx/tx queues are being freed, on a different CPU there could be still rx flow running. Call napi_synchronize() to prevent such a race.
--- .../net/wireless/intel/iwlwifi/pcie/internal.h | 1 + drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 18 +++++++++++++++++- .../wireless/intel/iwlwifi/pcie/trans-gen2.c | 1 + .../net/wireless/intel/iwlwifi/pcie/trans.c | 1 + 4 files changed, 20 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/internal.h +1 -0
@@ -497,6 +497,7 @@ int iwl_pcie_rx_stop(struct iwl_trans *trans);void iwl_pcie_rx_free (struct iwl_trans *trans);void iwl_pcie_free_rbs_pool (struct iwl_trans *trans);void iwl_pcie_rx_init_rxb_lists (struct iwl_rxq *rxq); +void iwl_pcie_rx_napi_sync (struct iwl_trans *trans);void iwl_pcie_rxq_alloc_rbs (struct iwl_trans *trans,gfp_t priority,struct iwl_rxq *rxq);
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +17 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* -* Copyright (C) 2003-2014, 2018-2022 Intel Corporation +* Copyright (C) 2003-2014, 2018-2023 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */
@@ -1053,6 +1053,22 @@ static int iwl_pcie_napi_poll_msix(struct napi_struct *napi, int budget)return ret; } +void iwl_pcie_rx_napi_sync (struct iwl_trans *trans) +{ +struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); +int i; + +if (unlikely (!trans_pcie->rxq)) +return ; + +for (i =0 ; i < trans->num_rx_queues; i++) { +struct iwl_rxq *rxq = &trans_pcie->rxq[i]; + +if (rxq && rxq->napi.poll) +napi_synchronize (&rxq->napi); + } +} +static int _iwl_pcie_rx_init (struct iwl_trans *trans) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c +1 -0
@@ -156,6 +156,7 @@ void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans)if (test_and_clear_bit (STATUS_DEVICE_ENABLED , &trans->status)) {IWL_DEBUG_INFO (trans,"DEVICE_ENABLED bit was set and is now cleared\n" ); +iwl_pcie_rx_napi_sync (trans);iwl_txq_gen2_tx_free (trans);iwl_pcie_rx_stop (trans); }
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +1 -0
@@ -1260,6 +1260,7 @@ static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans)if (test_and_clear_bit (STATUS_DEVICE_ENABLED , &trans->status)) {IWL_DEBUG_INFO (trans,"DEVICE_ENABLED bit was set and is now cleared\n" ); +iwl_pcie_rx_napi_sync (trans);iwl_pcie_tx_stop (trans);iwl_pcie_rx_stop (trans);
Signature · 1 line
2.38.1
PATCH 3/15 wifi: iwlwifi: mvm: fix getting lowest TX rate for MLO
In reply to [email protected]From: Johannes Berg <[email protected]>
In iwl_mvm_mac_ctxt_get_lowest_rate() we were still accessing vif->bss_conf without any multi-link provisions, and also the info->band, both of which isn't valid in MLO.
Fix the code to look at the correct link. In case of EAPOL transmissions for the initial 4-way-HS, look up the correct link here as well, and warn if multiple are active.
--- .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +29 -2
@@ -874,13 +874,40 @@ u8 iwl_mvm_mac_ctxt_get_lowest_rate(struct iwl_mvm *mvm,struct ieee80211_tx_info *info, struct ieee80211_vif *vif) { + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);struct ieee80211_supported_band *sband;unsigned long basic = vif->bss_conf.basic_rates;u16 lowest_cck =IWL_RATE_COUNT , lowest_ofdm =IWL_RATE_COUNT ; +u32 link_id =u32_get_bits (info->control.flags, +IEEE80211_TX_CTRL_MLO_LINK ); +u8 band = info->band;u8 rate;u32 i; - sband = mvm->hw->wiphy->bands[info->band]; +if (link_id ==IEEE80211_LINK_UNSPECIFIED && vif->valid_links) { +for (i =0 ; i <ARRAY_SIZE (mvmvif->link); i++) { +if (!mvmvif->link[i]) +continue ; +/* shouldn't do this when >1 link is active */ +WARN_ON_ONCE (link_id !=IEEE80211_LINK_UNSPECIFIED ); + link_id = i; + } + } + +if (link_id <IEEE80211_LINK_UNSPECIFIED ) { +struct ieee80211_bss_conf *link_conf; + +rcu_read_lock (); + link_conf =rcu_dereference (vif->link_conf[link_id]); +if (link_conf) { + basic = link_conf->basic_rates; +if (link_conf->chandef.chan) + band = link_conf->chandef.chan->band; + } +rcu_read_unlock (); + } + + sband = mvm->hw->wiphy->bands[band];for_each_set_bit (i, &basic,BITS_PER_LONG ) {u16 hw = sband->bitrates[i].hw_value;
@@ -892,7 +919,7 @@ u8 iwl_mvm_mac_ctxt_get_lowest_rate(struct iwl_mvm *mvm, } } -if (info->band ==NL80211_BAND_2GHZ && !vif->p2p && +if (band ==NL80211_BAND_2GHZ && !vif->p2p && vif->type !=NL80211_IFTYPE_P2P_DEVICE && !(info->flags &IEEE80211_TX_CTL_NO_CCK_RATE )) {if (lowest_cck !=IWL_RATE_COUNT )
Signature · 1 line
2.38.1
PATCH 4/15 wifi: iwlwifi: mvm: Fix _iwl_mvm_get_scan_type()
In reply to [email protected]From: Ilan Peer <[email protected]>
The usage of the 'dtim_period' value was wrong, as it is only a multiplier of the beacon interval, and thus, beacon interval should also be considered. Fix it.
--- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +3 -2
@@ -240,8 +240,9 @@ iwl_mvm_scan_type _iwl_mvm_get_scan_type(struct iwl_mvm *mvm,* set all scan requests as fast-balance scan */ if (vif && vif->type ==NL80211_IFTYPE_STATION && - vif->bss_conf.dtim_period <220 && - data.is_dcm_with_p2p_go) + data.is_dcm_with_p2p_go && + ((vif->bss_conf.beacon_int * + vif->bss_conf.dtim_period) <220 ))return IWL_SCAN_TYPE_FAST_BALANCE ; }
Signature · 1 line
2.38.1
PATCH 5/15 wifi: iwlwifi: mvm: properly implement HE AP support
In reply to [email protected]From: Johannes Berg <[email protected]>
The firmware split the HE support field into HE and "pseudo HE", the latter is really for AP and doesn't implement trigger frame handling for example.
Use the new field for AP mode.
--- .../net/wireless/intel/iwlwifi/fw/api/mac-cfg.h | 4 +++- drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h +3 -1
@@ -278,6 +278,7 @@ enum iwl_mac_config_filter_flags {* @reserved_for_local_mld_addr: reserved * @filter_flags: combination of &enum iwl_mac_config_filter_flags * @he_support: does this MAC support HE +* @he_ap_support: HE AP enabled, "pseudo HE", no trigger frame handling * @eht_support: does this MAC support EHT. Requires he_support * @nic_not_ack_enabled: mark that the NIC doesn't support receiving * ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).
@@ -296,7 +297,8 @@ struct iwl_mac_config_cmd {u8 local_mld_addr[6 ];__le16 reserved_for_local_mld_addr;__le32 filter_flags; -__le32 he_support; +__le16 he_support; +__le16 he_ap_support;__le32 eht_support;__le32 nic_not_ack_enabled;/* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_1 */
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c +12 -2
@@ -4,6 +4,16 @@*/ #include "mvm.h" +static void iwl_mvm_mld_set_he_support (struct iwl_mvm *mvm, +struct ieee80211_vif *vif, +struct iwl_mac_config_cmd *cmd) +{ +if (vif->type ==NL80211_IFTYPE_AP ) + cmd->he_ap_support =cpu_to_le16 (1 ); +else + cmd->he_support =cpu_to_le16 (1 ); +} + static void iwl_mvm_mld_mac_ctxt_cmd_common(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct iwl_mac_config_cmd *cmd,
@@ -41,7 +51,7 @@ static void iwl_mvm_mld_mac_ctxt_cmd_common(struct iwl_mvm *mvm,* and enable both when we have MLO. */ if (vif->valid_links) { - cmd->he_support =cpu_to_le32 (1 ); +iwl_mvm_mld_set_he_support (mvm, vif, cmd); cmd->eht_support =cpu_to_le32 (1 );return ; }
@@ -53,7 +63,7 @@ static void iwl_mvm_mld_mac_ctxt_cmd_common(struct iwl_mvm *mvm,continue ;if (link_conf->he_support) - cmd->he_support =cpu_to_le32 (1 ); +iwl_mvm_mld_set_he_support (mvm, vif, cmd);/* it's not reasonable to have EHT without HE and FW API doesn't * support it. Ignore EHT in this case.
Signature · 1 line
2.38.1
PATCH 6/15 wifi: iwlwifi: mvm: factor out iwl_mvm_sta_fw_id_mask()
In reply to [email protected]From: Johannes Berg <[email protected]>
We are going to need this in more places than just the key code, so factor out the functionality of getting the FW station ID mask (filtered to a specific link if needed) to a separate function that can now be called both under RCU and mvm->mutex protection.
--- .../net/wireless/intel/iwlwifi/mvm/mld-key.c | 33 ++--------------- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 37 +++++++++++++++++++ drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 2 + 3 files changed, 42 insertions(+), 30 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +3 -30
@@ -15,10 +15,6 @@ static u32 iwl_mvm_get_sec_sta_mask(struct iwl_mvm *mvm, {struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif);struct iwl_mvm_vif_link_info *link_info = &mvmvif->deflink; -struct iwl_mvm_link_sta *link_sta; -struct iwl_mvm_sta *mvmsta; -u32 result =0 ; -int link_id;lockdep_assert_held (&mvm->mutex);
@@ -49,33 +45,10 @@ static u32 iwl_mvm_get_sec_sta_mask(struct iwl_mvm *mvm,if (!sta && (keyconf->link_id >=0 || !vif->valid_links))return BIT (link_info->ap_sta_id); -/* this shouldn't happen now */ -if (!sta) -return 0 ; +/* STA should be non-NULL now, but iwl_mvm_sta_fw_id_mask() checks */ - mvmsta =iwl_mvm_sta_from_mac80211 (sta); - -/* it's easy when the STA is not an MLD */ -if (!sta->valid_links) -return BIT (mvmsta->deflink.sta_id); - -/* but if it is an MLD, get the mask of all the FW STAs it has ... */ -for (link_id =0 ; link_id <ARRAY_SIZE (mvmsta->link); link_id++) { -/* unless we have a specific link in mind (GTK on client) */ -if (keyconf->link_id >=0 && - keyconf->link_id != link_id) -continue ; - - link_sta = -rcu_dereference_protected (mvmsta->link[link_id], -lockdep_is_held (&mvm->mutex)); -if (!link_sta) -continue ; - - result |=BIT (link_sta->sta_id); - } - -return result; +/* pass link_id to filter by it if not -1 (GTK on client) */ +return iwl_mvm_sta_fw_id_mask (mvm, sta, keyconf->link_id); } static u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm,
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +37 -0
@@ -4,6 +4,43 @@*/ #include "mvm.h" #include "time-sync.h" +#include "sta.h" + +u32 iwl_mvm_sta_fw_id_mask (struct iwl_mvm *mvm,struct ieee80211_sta *sta, +int filter_link_id) +{ +struct iwl_mvm_sta *mvmsta; +unsigned int link_id; +u32 result =0 ; + +if (!sta) +return 0 ; + + mvmsta =iwl_mvm_sta_from_mac80211 (sta); + +/* it's easy when the STA is not an MLD */ +if (!sta->valid_links) +return BIT (mvmsta->deflink.sta_id); + +/* but if it is an MLD, get the mask of all the FW STAs it has ... */ +for (link_id =0 ; link_id <ARRAY_SIZE (mvmsta->link); link_id++) { +struct iwl_mvm_link_sta *link_sta; + +/* unless we have a specific link in mind */ +if (filter_link_id >=0 && link_id != filter_link_id) +continue ; + + link_sta = +rcu_dereference_check (mvmsta->link[link_id], +lockdep_is_held (&mvm->mutex)); +if (!link_sta) +continue ; + + result |=BIT (link_sta->sta_id); + } + +return result; +}static int iwl_mvm_mld_send_sta_cmd (struct iwl_mvm *mvm,struct iwl_mvm_sta_cfg_cmd *cmd)
drivers/net/wireless/intel/iwlwifi/mvm/sta.h +2 -0
@@ -642,6 +642,8 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm,struct ieee80211_vif *vif, struct ieee80211_sta *sta, u16 old_links, u16 new_links); +u32 iwl_mvm_sta_fw_id_mask (struct iwl_mvm *mvm,struct ieee80211_sta *sta, +int filter_link_id);/* Queues */ void iwl_mvm_mld_modify_all_sta_disable_tx(struct iwl_mvm *mvm,
Signature · 1 line
2.38.1
PATCH 7/15 wifi: iwlwifi: mvm: avoid iterating over an un-initialized list
In reply to [email protected]From: Avraham Stern <[email protected]>
The initiator smooth list is initialized only in iwl_mvm_up(), but is cleared in iwl_mvm_mac_stop. This may result in iterating over the list before it was initialized in case iwl_mvm_up() failed early. Fix it by moving the list initialization to an earlier stage.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 2 -- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +0 -2
@@ -1727,8 +1727,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm)iwl_mvm_tas_init (mvm);iwl_mvm_leds_sync (mvm); -iwl_mvm_ftm_initiator_smooth_config (mvm); -if (fw_has_capa (&mvm->fw->ucode_capa,IWL_UCODE_TLV_CAPA_RFIM_SUPPORT )) {if (iwl_mvm_eval_dsm_rfi (mvm) ==DSM_VALUE_RFI_ENABLE )
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +2 -0
@@ -1367,6 +1367,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,else memset (&mvm->rx_stats,0 ,sizeof (struct mvm_statistics_rx )); +iwl_mvm_ftm_initiator_smooth_config (mvm); +iwl_mvm_init_time_sync (&mvm->time_sync); mvm->debugfs_dir = dbgfs_dir;
Signature · 1 line
2.38.1
PATCH 8/15 wifi: iwlwifi: mvm: use correct sta mask to remove queue
In reply to [email protected]From: Johannes Berg <[email protected]>
When we remove a queue we need to use the currently active firmware stations in the mask, not the deflink one. Fix that.
--- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +5 -4
@@ -299,7 +299,7 @@ int iwl_mvm_mld_add_aux_sta(struct iwl_mvm *mvm, u32 lmac_id) IWL_MAX_TID_COUNT, NULL); } -static int iwl_mvm_mld_disable_txq (struct iwl_mvm *mvm,int sta_id, +static int iwl_mvm_mld_disable_txq (struct iwl_mvm *mvm,u32 sta_mask,u16 *queueptr,u8 tid) {int queue = *queueptr;
@@ -314,7 +314,7 @@ static int iwl_mvm_mld_disable_txq(struct iwl_mvm *mvm, int sta_id,struct iwl_scd_queue_cfg_cmd remove_cmd = { .operation =cpu_to_le32 (IWL_SCD_QUEUE_REMOVE ), .u.remove.tid =cpu_to_le32 (tid), - .u.remove.sta_mask =cpu_to_le32 (BIT (sta_id)), + .u.remove.sta_mask =cpu_to_le32 (sta_mask), }; ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0,
@@ -344,7 +344,7 @@ static int iwl_mvm_mld_rm_int_sta(struct iwl_mvm *mvm,if (flush)iwl_mvm_flush_sta (mvm, int_sta, true); -iwl_mvm_mld_disable_txq (mvm, int_sta->sta_id, queuptr, tid); +iwl_mvm_mld_disable_txq (mvm,BIT (int_sta->sta_id), queuptr, tid); ret =iwl_mvm_mld_rm_sta_from_fw (mvm, int_sta->sta_id);if (ret)
@@ -760,6 +760,7 @@ static void iwl_mvm_mld_disable_sta_queues(struct iwl_mvm *mvm, struct ieee80211_sta *sta) {struct iwl_mvm_sta *mvm_sta =iwl_mvm_sta_from_mac80211 (sta); +u32 sta_mask =iwl_mvm_sta_fw_id_mask (mvm, sta,-1 );int i;lockdep_assert_held (&mvm->mutex);
@@ -768,7 +769,7 @@ static void iwl_mvm_mld_disable_sta_queues(struct iwl_mvm *mvm,if (mvm_sta->tid_data[i].txq_id ==IWL_MVM_INVALID_QUEUE )continue ; -iwl_mvm_mld_disable_txq (mvm, mvm_sta->deflink.sta_id, +iwl_mvm_mld_disable_txq (mvm, sta_mask, &mvm_sta->tid_data[i].txq_id, i); mvm_sta->tid_data[i].txq_id =IWL_MVM_INVALID_QUEUE ; }
Signature · 1 line
2.38.1
PATCH 9/15 wifi: iwlwifi: bump FW API to 77 for AX devices
In reply to [email protected]From: Gregory Greenman <[email protected]>
Start supporting API version 77 for AX devices.
--- drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/cfg/22000.c +1 -1
@@ -10,7 +10,7 @@#include "fw/api/txq.h" /* Highest firmware API version supported */ -#define IWL_22000_UCODE_API_MAX 75 +#define IWL_22000_UCODE_API_MAX 77/* Lowest firmware API version supported */ #define IWL_22000_UCODE_API_MIN 39
Signature · 1 line
2.38.1
PATCH 10/15 wifi: iwlwifi: mvm: track station mask for BAIDs
In reply to [email protected]From: Johannes Berg <[email protected]>
When we have MLO connections, a BAID applies to multiple firmware stations. Track the station mask instead of the station ID, getting rid of a few more deflink cases and preparing for handling link switching for BAIDs.
--- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 4 +-- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 34 ++++++++++++------- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 23 +++++++------ 3 files changed, 36 insertions(+), 25 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +2 -2
@@ -680,7 +680,7 @@ __aligned(roundup_pow_of_two(sizeof(struct _iwl_mvm_reorder_buf_entry)))/** * struct iwl_mvm_baid_data - BA session data -* @sta_id: station id +* @sta_mask: current station mask for the BAID * @tid: tid of the session * @baid baid of the session * @timeout: the timeout set in the addba request
@@ -694,7 +694,7 @@ __aligned(roundup_pow_of_two(sizeof(struct _iwl_mvm_reorder_buf_entry)))*/ struct iwl_mvm_baid_data {struct rcu_head rcu_head; -u8 sta_id; +u32 sta_mask;u8 tid;u8 baid;u16 timeout;
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +21 -13
@@ -705,7 +705,7 @@ void iwl_mvm_reorder_timer_expired(struct timer_list *t)if (expired) {struct ieee80211_sta *sta;struct iwl_mvm_sta *mvmsta; -u8 sta_id = baid_data->sta_id; +u8 sta_id =ffs (baid_data->sta_mask) -1 ;rcu_read_lock (); sta =rcu_dereference (buf->mvm->fw_id_to_mac_id[sta_id]);
@@ -740,6 +740,7 @@ static void iwl_mvm_del_ba(struct iwl_mvm *mvm, int queue,struct ieee80211_sta *sta;struct iwl_mvm_reorder_buffer *reorder_buf;u8 baid = data->baid; +u32 sta_id;if (WARN_ONCE (baid >=IWL_MAX_BAID ,"invalid BAID: %x\n" , baid))return ;
@@ -750,7 +751,9 @@ static void iwl_mvm_del_ba(struct iwl_mvm *mvm, int queue,if (WARN_ON_ONCE (!ba_data)) goto out; - sta =rcu_dereference (mvm->fw_id_to_mac_id[ba_data->sta_id]); +/* pick any STA ID to find the pointer */ + sta_id =ffs (ba_data->sta_mask) -1 ; + sta =rcu_dereference (mvm->fw_id_to_mac_id[sta_id]);if (WARN_ON_ONCE (IS_ERR_OR_NULL (sta))) goto out;
@@ -777,6 +780,7 @@ static void iwl_mvm_release_frames_from_notif(struct iwl_mvm *mvm,struct ieee80211_sta *sta;struct iwl_mvm_reorder_buffer *reorder_buf;struct iwl_mvm_baid_data *ba_data; +u32 sta_id;IWL_DEBUG_HT (mvm,"Frame release notification for BAID %u, NSSN %d\n" , baid, nssn);
@@ -794,7 +798,9 @@ static void iwl_mvm_release_frames_from_notif(struct iwl_mvm *mvm, goto out; } - sta =rcu_dereference (mvm->fw_id_to_mac_id[ba_data->sta_id]); +/* pick any STA ID to find the pointer */ + sta_id =ffs (ba_data->sta_mask) -1 ; + sta =rcu_dereference (mvm->fw_id_to_mac_id[sta_id]);if (WARN_ON_ONCE (IS_ERR_OR_NULL (sta))) goto out;
@@ -935,7 +941,6 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, {struct ieee80211_rx_status *rx_status =IEEE80211_SKB_RXCB (skb);struct ieee80211_hdr *hdr = (void *)skb_mac_header (skb); -struct iwl_mvm_sta *mvm_sta;struct iwl_mvm_baid_data *baid_data;struct iwl_mvm_reorder_buffer *buffer;struct sk_buff *tail;
@@ -947,6 +952,7 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,u8 sub_frame_idx = desc->amsdu_info &IWL_RX_MPDU_AMSDU_SUBFRAME_IDX_MASK ;struct iwl_mvm_reorder_buf_entry *entries; +u32 sta_mask;int index;u16 nssn, sn;u8 baid;
@@ -969,8 +975,6 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, "Got valid BAID without a valid station assigned\n"))return false; - mvm_sta =iwl_mvm_sta_from_mac80211 (sta); -/* not a data packet or a bar */ if (!ieee80211_is_back_req(hdr->frame_control) && (!ieee80211_is_data_qos(hdr->frame_control) ||
@@ -988,11 +992,14 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,return false; } +rcu_read_lock (); + sta_mask =iwl_mvm_sta_fw_id_mask (mvm, sta,-1 ); +rcu_read_unlock (); +if (WARN (tid != baid_data->tid || - mvm_sta->deflink.sta_id != baid_data->sta_id, -"baid 0x%x is mapped to sta:%d tid:%d, but was received for sta:%d tid:%d\n" , - baid, baid_data->sta_id, baid_data->tid, mvm_sta->deflink.sta_id, - tid)) + !(sta_mask & baid_data->sta_mask), +"baid 0x%x is mapped to sta_mask:0x%x tid:%d, but was received for sta_mask:0x%x tid:%d\n" , + baid, baid_data->sta_mask, baid_data->tid, sta_mask, tid))return false; nssn = reorder &IWL_RX_MPDU_REORDER_NSSN_MASK ;
@@ -2776,9 +2783,10 @@ void iwl_mvm_rx_bar_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi, goto out; } -if (WARN (tid != baid_data->tid || sta_id != baid_data->sta_id, -"baid 0x%x is mapped to sta:%d tid:%d, but BAR release received for sta:%d tid:%d\n" , - baid, baid_data->sta_id, baid_data->tid, sta_id, +if (WARN (tid != baid_data->tid || sta_id >IWL_MVM_STATION_COUNT_MAX || + !(baid_data->sta_mask &BIT (sta_id)), +"baid 0x%x is mapped to sta_mask:0x%x tid:%d, but BAR release received for sta:%d tid:%d\n" , + baid, baid_data->sta_mask, baid_data->tid, sta_id, tid)) goto out;
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +13 -10
@@ -251,6 +251,7 @@ static void iwl_mvm_rx_agg_session_expired(struct timer_list *t)struct ieee80211_sta *sta;struct iwl_mvm_sta *mvm_sta;unsigned long timeout; +unsigned int sta_id;rcu_read_lock ();
@@ -269,7 +270,8 @@ static void iwl_mvm_rx_agg_session_expired(struct timer_list *t) }/* Timer expired */ - sta =rcu_dereference (ba_data->mvm->fw_id_to_mac_id[ba_data->sta_id]); + sta_id =ffs (ba_data->sta_mask) -1 ;/* don't care which one */ + sta =rcu_dereference (ba_data->mvm->fw_id_to_mac_id[sta_id]);/* * sta should be valid unless the following happens:
@@ -2756,10 +2758,11 @@ static void iwl_mvm_init_reorder_buffer(struct iwl_mvm *mvm, }static int iwl_mvm_fw_baid_op_sta (struct iwl_mvm *mvm, -struct iwl_mvm_sta *mvm_sta, +struct ieee80211_sta *sta,bool start,int tid,u16 ssn,u16 buf_size) { +struct iwl_mvm_sta *mvm_sta =iwl_mvm_sta_from_mac80211 (sta);struct iwl_mvm_add_sta_cmd cmd = { .mac_id_n_color =cpu_to_le32 (mvm_sta->mac_id_n_color), .sta_id = mvm_sta->deflink.sta_id,
@@ -2804,7 +2807,7 @@ static int iwl_mvm_fw_baid_op_sta(struct iwl_mvm *mvm, }static int iwl_mvm_fw_baid_op_cmd (struct iwl_mvm *mvm, -struct iwl_mvm_sta *mvm_sta, +struct ieee80211_sta *sta,bool start,int tid,u16 ssn,u16 buf_size,int baid) {
@@ -2819,7 +2822,7 @@ static int iwl_mvm_fw_baid_op_cmd(struct iwl_mvm *mvm,if (start) { cmd.alloc.sta_id_mask = -cpu_to_le32 (BIT (mvm_sta->deflink.sta_id)); +cpu_to_le32 (iwl_mvm_sta_fw_id_mask (mvm, sta,-1 )); cmd.alloc.tid = tid; cmd.alloc.ssn =cpu_to_le16 (ssn); cmd.alloc.win_size =cpu_to_le16 (buf_size);
@@ -2829,7 +2832,7 @@ static int iwl_mvm_fw_baid_op_cmd(struct iwl_mvm *mvm,BUILD_BUG_ON (sizeof (cmd.remove_v1) >sizeof (cmd.remove)); }else { cmd.remove.sta_id_mask = -cpu_to_le32 (BIT (mvm_sta->deflink.sta_id)); +cpu_to_le32 (iwl_mvm_sta_fw_id_mask (mvm, sta,-1 )); cmd.remove.tid =cpu_to_le32 (tid); }
@@ -2852,16 +2855,16 @@ static int iwl_mvm_fw_baid_op_cmd(struct iwl_mvm *mvm,return baid; } -static int iwl_mvm_fw_baid_op (struct iwl_mvm *mvm,struct iwl_mvm_sta *mvm_sta, +static int iwl_mvm_fw_baid_op (struct iwl_mvm *mvm,struct ieee80211_sta *sta,bool start,int tid,u16 ssn,u16 buf_size,int baid) {if (fw_has_capa (&mvm->fw->ucode_capa,IWL_UCODE_TLV_CAPA_BAID_ML_SUPPORT )) -return iwl_mvm_fw_baid_op_cmd (mvm, mvm_sta, start, +return iwl_mvm_fw_baid_op_cmd (mvm, sta, start, tid, ssn, buf_size, baid); -return iwl_mvm_fw_baid_op_sta (mvm, mvm_sta, start, +return iwl_mvm_fw_baid_op_sta (mvm, sta, start, tid, ssn, buf_size); }
@@ -2931,7 +2934,7 @@ int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta,/* Don't send command to remove (start=0) BAID during restart */ if (start || !test_bit (IWL_MVM_STATUS_IN_HW_RESTART , &mvm->status)) - baid =iwl_mvm_fw_baid_op (mvm, mvm_sta, start, tid, ssn, buf_size, + baid =iwl_mvm_fw_baid_op (mvm, sta, start, tid, ssn, buf_size, baid);if (baid <0 ) {
@@ -2953,7 +2956,7 @@ int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, iwl_mvm_rx_agg_session_expired, 0); baid_data->mvm = mvm; baid_data->tid = tid; - baid_data->sta_id = mvm_sta->deflink.sta_id; + baid_data->sta_mask =iwl_mvm_sta_fw_id_mask (mvm, sta,-1 ); mvm_sta->tid_to_baid[tid] = baid;if (timeout)
Signature · 1 line
2.38.1
PATCH 11/15 wifi: iwlwifi: mvm: implement BAID link switching
In reply to [email protected]From: Johannes Berg <[email protected]>
When we switch station links, also add the code to switch BAIDs from one station mask to the new one.
To do so, refactor the switching code a bit to have common code for all the needed switches; will add keys next.
--- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 80 ++++++++++++++++--- 1 file changed, 70 insertions(+), 10 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +70 -10
@@ -911,11 +911,12 @@ void iwl_mvm_mld_modify_all_sta_disable_tx(struct iwl_mvm *mvm,rcu_read_unlock (); } -static int iwl_mvm_mld_update_sta_queue (struct iwl_mvm *mvm, -struct iwl_mvm_sta *mvm_sta, -u32 old_sta_mask, -u32 new_sta_mask) +static int iwl_mvm_mld_update_sta_queues (struct iwl_mvm *mvm, +struct ieee80211_sta *sta, +u32 old_sta_mask, +u32 new_sta_mask) { +struct iwl_mvm_sta *mvm_sta =iwl_mvm_sta_from_mac80211 (sta);struct iwl_scd_queue_cfg_cmd cmd = { .operation =cpu_to_le32 (IWL_SCD_QUEUE_MODIFY ), .u.modify.old_sta_mask =cpu_to_le32 (old_sta_mask),
@@ -951,6 +952,63 @@ static int iwl_mvm_mld_update_sta_queue(struct iwl_mvm *mvm,return 0 ; } +static int iwl_mvm_mld_update_sta_baids (struct iwl_mvm *mvm, +u32 old_sta_mask, +u32 new_sta_mask) +{ +struct iwl_rx_baid_cfg_cmd cmd = { + .action =cpu_to_le32 (IWL_RX_BAID_ACTION_MODIFY ), + .modify.old_sta_id_mask =cpu_to_le32 (old_sta_mask), + .modify.new_sta_id_mask =cpu_to_le32 (new_sta_mask), + }; +u32 cmd_id =WIDE_ID (DATA_PATH_GROUP ,RX_BAID_ALLOCATION_CONFIG_CMD ); +int baid; + +BUILD_BUG_ON (sizeof (struct iwl_rx_baid_cfg_resp ) !=sizeof (baid)); + +for (baid =0 ; baid <ARRAY_SIZE (mvm->baid_map); baid++) { +struct iwl_mvm_baid_data *data; +int ret; + + data =rcu_dereference_protected (mvm->baid_map[baid], +lockdep_is_held (&mvm->mutex)); +if (!data) +continue ; + +if (!(data->sta_mask & old_sta_mask)) +continue ; + +WARN_ONCE (data->sta_mask != old_sta_mask, +"BAID data for %d corrupted - expected 0x%x found 0x%x\n" , + baid, old_sta_mask, data->sta_mask); + + cmd.modify.tid =cpu_to_le32 (data->tid); + + ret =iwl_mvm_send_cmd_pdu (mvm, cmd_id,0 ,sizeof (cmd), &cmd); + data->sta_mask = new_sta_mask; +if (ret) +return ret; + } + +return 0 ; +} + +static int iwl_mvm_mld_update_sta_resources (struct iwl_mvm *mvm, +struct ieee80211_sta *sta, +u32 old_sta_mask, +u32 new_sta_mask) +{ +int ret; + + ret =iwl_mvm_mld_update_sta_queues (mvm, sta, + old_sta_mask, + new_sta_mask); +if (ret) +return ret; + +return iwl_mvm_mld_update_sta_baids (mvm, old_sta_mask, new_sta_mask); +} + int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta,
@@ -987,9 +1045,10 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, }if (sta_mask_to_rem) { - ret =iwl_mvm_mld_update_sta_queue (mvm, mvm_sta, - current_sta_mask, - current_sta_mask & ~sta_mask_to_rem); + ret =iwl_mvm_mld_update_sta_resources (mvm, sta, + current_sta_mask, + current_sta_mask & + ~sta_mask_to_rem);if (WARN_ON (ret)) goto err;
@@ -1064,9 +1123,10 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, }if (sta_mask_added) { - ret =iwl_mvm_mld_update_sta_queue (mvm, mvm_sta, - current_sta_mask, - current_sta_mask | sta_mask_added); + ret =iwl_mvm_mld_update_sta_resources (mvm, sta, + current_sta_mask, + current_sta_mask | + sta_mask_added);if (WARN_ON (ret)) goto err; }
Signature · 1 line
2.38.1
PATCH 12/15 wifi: iwlwifi: mvm: implement key link switching
In reply to [email protected]From: Johannes Berg <[email protected]>
Implement switching keys from one set of firmware station IDs to another set, during link switch.
--- .../net/wireless/intel/iwlwifi/mvm/mld-key.c | 53 +++++++++++++++++++ .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 11 +++- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 5 ++ 3 files changed, 67 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +53 -0
@@ -97,6 +97,59 @@ static u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm,return flags; } +struct iwl_mvm_sta_key_update_data { +struct ieee80211_sta *sta; +u32 old_sta_mask; +u32 new_sta_mask; +int err; +}; + +static void iwl_mvm_mld_update_sta_key (struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct ieee80211_sta *sta, +struct ieee80211_key_conf *key, +void *_data) +{ +u32 cmd_id =WIDE_ID (DATA_PATH_GROUP ,SEC_KEY_CMD ); +struct iwl_mvm_sta_key_update_data *data = _data; +struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw); +struct iwl_sec_key_cmd cmd = { + .action =cpu_to_le32 (FW_CTXT_ACTION_MODIFY ), + .u.modify.old_sta_mask =cpu_to_le32 (data->old_sta_mask), + .u.modify.new_sta_mask =cpu_to_le32 (data->new_sta_mask), + .u.modify.key_id =cpu_to_le32 (key->keyidx), + .u.modify.key_flags = +cpu_to_le32 (iwl_mvm_get_sec_flags (mvm, vif, sta, key)), + }; +int err; + +/* only need to do this for pairwise keys (link_id == -1) */ +if (sta != data->sta || key->link_id >=0 ) +return ; + + err =iwl_mvm_send_cmd_pdu (mvm, cmd_id,CMD_ASYNC ,sizeof (cmd), &cmd); + +if (err) + data->err = err; +} + +int iwl_mvm_mld_update_sta_keys (struct iwl_mvm *mvm, +struct ieee80211_vif *vif, +struct ieee80211_sta *sta, +u32 old_sta_mask, +u32 new_sta_mask) +{ +struct iwl_mvm_sta_key_update_data data = { + .sta = sta, + .old_sta_mask = old_sta_mask, + .new_sta_mask = new_sta_mask, + }; + +ieee80211_iter_keys_rcu (mvm->hw, vif, iwl_mvm_mld_update_sta_key, + &data); +return data.err; +} +static int __iwl_mvm_sec_key_del (struct iwl_mvm *mvm,u32 sta_mask,u32 key_flags,u32 keyidx,u32 flags) {
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +9 -2
@@ -994,6 +994,7 @@ static int iwl_mvm_mld_update_sta_baids(struct iwl_mvm *mvm, }static int iwl_mvm_mld_update_sta_resources (struct iwl_mvm *mvm, +struct ieee80211_vif *vif,struct ieee80211_sta *sta,u32 old_sta_mask,u32 new_sta_mask)
@@ -1006,6 +1007,12 @@ static int iwl_mvm_mld_update_sta_resources(struct iwl_mvm *mvm,if (ret)return ret; + ret =iwl_mvm_mld_update_sta_keys (mvm, vif, sta, + old_sta_mask, + new_sta_mask); +if (ret) +return ret; +return iwl_mvm_mld_update_sta_baids (mvm, old_sta_mask, new_sta_mask); }
@@ -1045,7 +1052,7 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, }if (sta_mask_to_rem) { - ret =iwl_mvm_mld_update_sta_resources (mvm, sta, + ret =iwl_mvm_mld_update_sta_resources (mvm, vif, sta, current_sta_mask, current_sta_mask & ~sta_mask_to_rem);
@@ -1123,7 +1130,7 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, }if (sta_mask_added) { - ret =iwl_mvm_mld_update_sta_resources (mvm, sta, + ret =iwl_mvm_mld_update_sta_resources (mvm, vif, sta, current_sta_mask, current_sta_mask | sta_mask_added);
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +5 -0
@@ -2332,6 +2332,11 @@ void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm,struct ieee80211_vif *vif, struct iwl_mvm_vif_link_info *link, unsigned int link_id); +int iwl_mvm_mld_update_sta_keys (struct iwl_mvm *mvm, +struct ieee80211_vif *vif, +struct ieee80211_sta *sta, +u32 old_sta_mask, +u32 new_sta_mask);int iwl_rfi_send_config_cmd (struct iwl_mvm *mvm,struct iwl_rfi_lut_entry *rfi_table);
Signature · 1 line
2.38.1
PATCH 13/15 wifi: iwlwifi: mvm: allow number of beacons from FW
In reply to [email protected]From: Johannes Berg <[email protected]>
Newer firmware images have a TLV advertising how many beacons they support, use that to permit adding more links in AP mode (FW needs to support at least as many links as beacons).
--- drivers/net/wireless/intel/iwlwifi/fw/file.h | 1 + drivers/net/wireless/intel/iwlwifi/fw/img.h | 1 + drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 7 +++++++ drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 5 ++++- 4 files changed, 13 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/fw/file.h +1 -0
@@ -104,6 +104,7 @@ enum iwl_ucode_tlv_type {IWL_UCODE_TLV_CURRENT_PC =68 ,IWL_UCODE_TLV_FW_NUM_STATIONS =IWL_UCODE_TLV_CONST_BASE +0 , +IWL_UCODE_TLV_FW_NUM_BEACONS =IWL_UCODE_TLV_CONST_BASE +2 ,IWL_UCODE_TLV_TYPE_DEBUG_INFO =IWL_UCODE_TLV_DEBUG_BASE +0 , IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION = IWL_UCODE_TLV_DEBUG_BASE + 1,
drivers/net/wireless/intel/iwlwifi/fw/img.h +1 -0
@@ -51,6 +51,7 @@ struct iwl_ucode_capabilities {u32 error_log_addr;u32 error_log_size;u32 num_stations; +u32 num_beacons;unsigned long _api[BITS_TO_LONGS (NUM_IWL_UCODE_TLV_API )];unsigned long _capa[BITS_TO_LONGS (NUM_IWL_UCODE_TLV_CAPA )];
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +7 -0
@@ -1155,6 +1155,12 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, capa->num_stations =le32_to_cpup ((const __le32 *)tlv_data);break ; +case IWL_UCODE_TLV_FW_NUM_BEACONS : +if (tlv_len !=sizeof (u32)) + goto invalid_tlv_len; + capa->num_beacons = +le32_to_cpup ((const __le32 *)tlv_data); +break ;case IWL_UCODE_TLV_UMAC_DEBUG_ADDRS : {const struct iwl_umac_debug_addrs *dbg_ptrs = (const void *)tlv_data;
@@ -1415,6 +1421,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE ; fw->ucode_capa.n_scan_channels =IWL_DEFAULT_SCAN_CHANNELS ; fw->ucode_capa.num_stations =IWL_MVM_STATION_COUNT_MAX ; + fw->ucode_capa.num_beacons =1 ;/* dump all fw memory areas by default */ fw->dbg.dump_mask =0xffffffff ;
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +4 -1
@@ -882,7 +882,10 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw, n_active++; } -if (n_active >1 ) +if (vif->type ==NL80211_IFTYPE_AP && + n_active > mvm->fw->ucode_capa.num_beacons) +return -EOPNOTSUPP ; +else if (n_active >1 )return -EOPNOTSUPP ; }
Signature · 1 line
2.38.1
PATCH 14/15 wifi: iwlwifi: make the loop for card preparation effective
In reply to [email protected]From: Emmanuel Grumbach <[email protected]>
Since we didn't reset t to 0, only the first iteration of the loop did checked the ready bit several times.
From the second iteration and on, we just tested the bit once and continued to the next iteration.
--- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +2 -1
@@ -599,7 +599,6 @@ static int iwl_pcie_set_hw_ready(struct iwl_trans *trans)int iwl_pcie_prepare_card_hw (struct iwl_trans *trans) {int ret; -int t =0 ;int iter;IWL_DEBUG_INFO (trans,"iwl_trans_prepare_card_hw enter\n" );
@@ -616,6 +615,8 @@ int iwl_pcie_prepare_card_hw(struct iwl_trans *trans)usleep_range (1000 ,2000 );for (iter =0 ; iter <10 ; iter++) { +int t =0 ; +/* If HW is not ready, prepare the conditions to check again */ iwl_set_bit (trans,CSR_HW_IF_CONFIG_REG ,CSR_HW_IF_CONFIG_REG_PREPARE );
Signature · 1 line
2.38.1
PATCH 15/15 wifi: iwlwifi: move debug buffer allocation failure to info verbosity
In reply to [email protected]From: Golan Ben Ami <[email protected]>
This is noising the kernel log and customers asked to hush it down. We can live with this message in "info" verbosity.
--- drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +1 -1
@@ -803,7 +803,7 @@ static void iwl_dbg_tlv_update_drams(struct iwl_fw_runtime *fwrt)if (!ret) dram_alloc = true;else -IWL_WARN (fwrt, +IWL_INFO (fwrt,"WRT: Failed to set DRAM buffer for alloc id %d, ret=%d\n" , i, ret); }
Signature · 1 line
2.38.1