All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miri Korenblit <miriam.rachel.korenblit@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Gregory Greenman <gregory.greenman@intel.com>
Subject: [PATCH 06/15] wifi: iwlwifi: adjust rx_phyinfo debugfs to MLO
Date: Mon,  5 Feb 2024 00:06:08 +0200	[thread overview]
Message-ID: <20240204235836.a68ee2b6cb58.Iddc47c608ec990b12be0ae5b1ee89bcf6beb0f6a@changeid> (raw)
In-Reply-To: <20240204220617.1456895-1-miriam.rachel.korenblit@intel.com>

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: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
---
 .../wireless/intel/iwlwifi/mvm/debugfs-vif.c  | 44 ++++++++++++-------
 1 file changed, 28 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
index e8b881596baf..2b96cf9eac72 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
@@ -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;
-- 
2.34.1


  parent reply	other threads:[~2024-02-04 22:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-04 22:06 [PATCH 00/15] wifi: iwlwifi: updates - 2024-02-05 Miri Korenblit
2024-02-04 22:06 ` [PATCH 01/15] wifi: iwlwifi: mvm: use correct address 3 in A-MSDU Miri Korenblit
2024-02-04 22:06 ` [PATCH 02/15] wifi: iwlwifi: add HONOR to PPAG approved list Miri Korenblit
2024-02-04 22:06 ` [PATCH 03/15] wifi: iwlwifi: pcie: don't allow hw-rfkill to stop device on gen2 Miri Korenblit
2024-02-04 22:06 ` [PATCH 04/15] wifi: iwlwifi: Add support for PPAG cmd v5 and PPAG revision 3 Miri Korenblit
2024-02-04 22:06 ` [PATCH 05/15] wifi: iwlwifi: mvm: const-ify chandef pointers Miri Korenblit
2024-02-04 22:06 ` Miri Korenblit [this message]
2024-02-04 22:06 ` [PATCH 07/15] wifi: iwlwifi: read mac step from aux register Miri Korenblit
2024-02-04 22:06 ` [PATCH 08/15] wifi: iwlwifi: mvm: remove EHT code from mac80211.c Miri Korenblit
2024-02-04 22:06 ` [PATCH 09/15] wifi: iwlwifi: use system_unbound_wq for debug dump Miri Korenblit
2024-02-04 22:06 ` [PATCH 10/15] wifi: iwlwifi: mvm: don't support reduced tx power on ack for new devices Miri Korenblit
2024-02-04 22:06 ` [PATCH 11/15] wifi: iwlwifi: support EHT for WH Miri Korenblit
2024-02-04 22:06 ` [PATCH 12/15] iwlwifi: mvm: advertise support for protected ranging negotiation Miri Korenblit
2024-02-06 10:18   ` Kalle Valo
2024-02-04 22:06 ` [PATCH 13/15] wifi: iwlwifi: mvm: Declare support for secure LTF measurement Miri Korenblit
2024-02-04 22:06 ` [PATCH 14/15] wifi: iwlwifi: clear link_id in time_event Miri Korenblit
2024-02-04 22:06 ` [PATCH 15/15] wifi: iwlwifi: mvm: remove one queue sync on BA session stop Miri Korenblit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240204235836.a68ee2b6cb58.Iddc47c608ec990b12be0ae5b1ee89bcf6beb0f6a@changeid \
    --to=miriam.rachel.korenblit@intel.com \
    --cc=gregory.greenman@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.