Commit f94c2438 authored by Miri Korenblit's avatar Miri Korenblit Committed by Johannes Berg

wifi: iwlwifi: adjust rx_phyinfo debugfs to MLO

This debugfs entry is used to configure the rx_phyinfo.
Currently we are sending the phy cmd only for the deflink.
Change it to send the cmd for all active links of the vif
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240204235836.a68ee2b6cb58.Iddc47c608ec990b12be0ae5b1ee89bcf6beb0f6a@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e047e0e3
......@@ -578,34 +578,46 @@ static ssize_t iwl_dbgfs_rx_phyinfo_write(struct ieee80211_vif *vif, char *buf,
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm *mvm = mvmvif->mvm;
struct ieee80211_chanctx_conf *chanctx_conf;
struct iwl_mvm_phy_ctxt *phy_ctxt;
struct ieee80211_bss_conf *link_conf;
u16 value;
int ret;
int link_id, ret = -EINVAL;
ret = kstrtou16(buf, 0, &value);
if (ret)
return ret;
mutex_lock(&mvm->mutex);
rcu_read_lock();
chanctx_conf = rcu_dereference(vif->bss_conf.chanctx_conf);
/* make sure the channel context is assigned */
if (!chanctx_conf) {
mvm->dbgfs_rx_phyinfo = value;
for_each_vif_active_link(vif, link_conf, link_id) {
struct ieee80211_chanctx_conf *chanctx_conf;
struct cfg80211_chan_def min_def;
struct iwl_mvm_phy_ctxt *phy_ctxt;
u8 chains_static, chains_dynamic;
rcu_read_lock();
chanctx_conf = rcu_dereference(link_conf->chanctx_conf);
if (!chanctx_conf) {
rcu_read_unlock();
continue;
}
/* A command can't be sent with RCU lock held, so copy
* everything here and use it after unlocking
*/
min_def = chanctx_conf->min_def;
chains_static = chanctx_conf->rx_chains_static;
chains_dynamic = chanctx_conf->rx_chains_dynamic;
rcu_read_unlock();
mutex_unlock(&mvm->mutex);
return -EINVAL;
}
phy_ctxt = &mvm->phy_ctxts[*(u16 *)chanctx_conf->drv_priv];
rcu_read_unlock();
phy_ctxt = mvmvif->link[link_id]->phy_ctxt;
if (!phy_ctxt)
continue;
mvm->dbgfs_rx_phyinfo = value;
ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &min_def,
chains_static, chains_dynamic);
}
ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &chanctx_conf->min_def,
chanctx_conf->rx_chains_static,
chanctx_conf->rx_chains_dynamic);
mutex_unlock(&mvm->mutex);
return ret ?: count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment