All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aloka Dixit <quic_alokad@quicinc.com>
To: <johannes@sipsolutions.net>, <linux-wireless@vger.kernel.org>,
	<ath11k@lists.infradead.org>
Cc: Aloka Dixit <quic_alokad@quicinc.com>, John Crispin <john@phrozen.org>
Subject: [PATCH 6/9] ath11k: configure MBSSID device parameters
Date: Sun, 22 May 2022 23:01:05 -0700	[thread overview]
Message-ID: <20220523060108.23982-7-quic_alokad@quicinc.com> (raw)
In-Reply-To: <20220523060108.23982-1-quic_alokad@quicinc.com>

Add new field nontransmitting_vif_count in struct ath11k_vif which
keeps track of non-transmitting interfaces associated with a
transmitting interface when MBSSID is enabled.
The count is decremented when WMI vdev down is invoked and incremented
when WMI vdev up is invoked.
Use this field to set the profile index and total profile count during
WMI vdev up operation.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Co-developed-by: John Crispin <john@phrozen.org>
Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/core.h |  2 ++
 drivers/net/wireless/ath/ath11k/mac.c  | 32 +++++++++++++++++++++++---
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h
index 95bca0b078b1..750dc9b46860 100644
--- a/drivers/net/wireless/ath/ath11k/core.h
+++ b/drivers/net/wireless/ath/ath11k/core.h
@@ -357,6 +357,8 @@ struct ath11k_vif {
 #ifdef CONFIG_ATH11K_DEBUGFS
 	struct dentry *debugfs_twt;
 #endif /* CONFIG_ATH11K_DEBUGFS */
+
+	u8 nontransmitting_vif_count;
 };
 
 struct ath11k_vif_iter {
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 32ddb80f4cec..10d35cdfafdb 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -1421,9 +1421,13 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif,
 				     struct ieee80211_bss_conf *info)
 {
 	struct ath11k *ar = arvif->ar;
+	struct ath11k_vif *tx_arvif = NULL;
 	int ret = 0;
 	struct vdev_up_params params = { 0 };
 
+	if (arvif->vif->mbssid_tx_vif)
+		tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
+
 	lockdep_assert_held(&arvif->ar->conf_mutex);
 
 	if (!info->enable_beacon) {
@@ -1433,6 +1437,9 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif,
 				    arvif->vdev_id, ret);
 
 		arvif->is_up = false;
+		if (tx_arvif)
+			tx_arvif->nontransmitting_vif_count = 0;
+
 		return;
 	}
 
@@ -1453,6 +1460,13 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif,
 	params.vdev_id = arvif->vdev_id;
 	params.aid = arvif->aid;
 	params.bssid = arvif->bssid;
+	if (tx_arvif) {
+		params.tx_bssid = tx_arvif->bssid;
+		params.profile_idx = info->bssid_index;
+		if (params.profile_idx >= tx_arvif->nontransmitting_vif_count)
+			tx_arvif->nontransmitting_vif_count = params.profile_idx;
+		params.profile_count = tx_arvif->nontransmitting_vif_count;
+	}
 	ret = ath11k_wmi_vdev_up(arvif->ar, &params);
 	if (ret) {
 		ath11k_warn(ar->ab, "failed to bring up vdev %d: %i\n",
@@ -2813,7 +2827,7 @@ static void ath11k_bss_disassoc(struct ieee80211_hw *hw,
 				struct ieee80211_vif *vif)
 {
 	struct ath11k *ar = hw->priv;
-	struct ath11k_vif *arvif = (void *)vif->drv_priv;
+	struct ath11k_vif *arvif = (void *)vif->drv_priv, *tx_arvif;
 	int ret;
 
 	lockdep_assert_held(&ar->conf_mutex);
@@ -2827,6 +2841,11 @@ static void ath11k_bss_disassoc(struct ieee80211_hw *hw,
 			    arvif->vdev_id, ret);
 
 	arvif->is_up = false;
+	if (arvif->vif->mbssid_tx_vif) {
+		tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
+		if (tx_arvif != arvif)
+			tx_arvif->nontransmitting_vif_count--;
+	}
 
 	memset(&arvif->rekey_data, 0, sizeof(arvif->rekey_data));
 
@@ -3372,7 +3391,8 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
 			ret = ath11k_wmi_send_obss_color_collision_cfg_cmd(
 				ar, arvif->vdev_id, info->he_bss_color.color,
 				ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS,
-				info->he_bss_color.enabled);
+				arvif->vif->bss_conf.nontransmitted ?
+				0 : info->he_bss_color.enabled);
 			if (ret)
 				ath11k_warn(ar->ab, "failed to set bss color collision on vdev %i: %d\n",
 					    arvif->vdev_id,  ret);
@@ -6952,7 +6972,7 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
 			   int n_vifs)
 {
 	struct ath11k_base *ab = ar->ab;
-	struct ath11k_vif *arvif;
+	struct ath11k_vif *arvif, *tx_arvif;
 	int ret;
 	int i;
 	bool monitor_vif = false;
@@ -7011,6 +7031,12 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
 		params.vdev_id = arvif->vdev_id;
 		params.aid = arvif->aid;
 		params.bssid = arvif->bssid;
+		if (arvif->vif->mbssid_tx_vif) {
+			tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
+			params.tx_bssid = tx_arvif->bssid;
+			params.profile_idx = arvif->vif->bss_conf.bssid_index;
+			params.profile_count = tx_arvif->nontransmitting_vif_count;
+		}
 		ret = ath11k_wmi_vdev_up(arvif->ar, &params);
 		if (ret) {
 			ath11k_warn(ab, "failed to bring vdev up %d: %d\n",
-- 
2.31.1


WARNING: multiple messages have this Message-ID (diff)
From: Aloka Dixit <quic_alokad@quicinc.com>
To: <johannes@sipsolutions.net>, <linux-wireless@vger.kernel.org>,
	<ath11k@lists.infradead.org>
Cc: Aloka Dixit <quic_alokad@quicinc.com>, John Crispin <john@phrozen.org>
Subject: [PATCH 6/9] ath11k: configure MBSSID device parameters
Date: Sun, 22 May 2022 23:01:05 -0700	[thread overview]
Message-ID: <20220523060108.23982-7-quic_alokad@quicinc.com> (raw)
In-Reply-To: <20220523060108.23982-1-quic_alokad@quicinc.com>

Add new field nontransmitting_vif_count in struct ath11k_vif which
keeps track of non-transmitting interfaces associated with a
transmitting interface when MBSSID is enabled.
The count is decremented when WMI vdev down is invoked and incremented
when WMI vdev up is invoked.
Use this field to set the profile index and total profile count during
WMI vdev up operation.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Co-developed-by: John Crispin <john@phrozen.org>
Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/core.h |  2 ++
 drivers/net/wireless/ath/ath11k/mac.c  | 32 +++++++++++++++++++++++---
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h
index 95bca0b078b1..750dc9b46860 100644
--- a/drivers/net/wireless/ath/ath11k/core.h
+++ b/drivers/net/wireless/ath/ath11k/core.h
@@ -357,6 +357,8 @@ struct ath11k_vif {
 #ifdef CONFIG_ATH11K_DEBUGFS
 	struct dentry *debugfs_twt;
 #endif /* CONFIG_ATH11K_DEBUGFS */
+
+	u8 nontransmitting_vif_count;
 };
 
 struct ath11k_vif_iter {
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 32ddb80f4cec..10d35cdfafdb 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -1421,9 +1421,13 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif,
 				     struct ieee80211_bss_conf *info)
 {
 	struct ath11k *ar = arvif->ar;
+	struct ath11k_vif *tx_arvif = NULL;
 	int ret = 0;
 	struct vdev_up_params params = { 0 };
 
+	if (arvif->vif->mbssid_tx_vif)
+		tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
+
 	lockdep_assert_held(&arvif->ar->conf_mutex);
 
 	if (!info->enable_beacon) {
@@ -1433,6 +1437,9 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif,
 				    arvif->vdev_id, ret);
 
 		arvif->is_up = false;
+		if (tx_arvif)
+			tx_arvif->nontransmitting_vif_count = 0;
+
 		return;
 	}
 
@@ -1453,6 +1460,13 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif,
 	params.vdev_id = arvif->vdev_id;
 	params.aid = arvif->aid;
 	params.bssid = arvif->bssid;
+	if (tx_arvif) {
+		params.tx_bssid = tx_arvif->bssid;
+		params.profile_idx = info->bssid_index;
+		if (params.profile_idx >= tx_arvif->nontransmitting_vif_count)
+			tx_arvif->nontransmitting_vif_count = params.profile_idx;
+		params.profile_count = tx_arvif->nontransmitting_vif_count;
+	}
 	ret = ath11k_wmi_vdev_up(arvif->ar, &params);
 	if (ret) {
 		ath11k_warn(ar->ab, "failed to bring up vdev %d: %i\n",
@@ -2813,7 +2827,7 @@ static void ath11k_bss_disassoc(struct ieee80211_hw *hw,
 				struct ieee80211_vif *vif)
 {
 	struct ath11k *ar = hw->priv;
-	struct ath11k_vif *arvif = (void *)vif->drv_priv;
+	struct ath11k_vif *arvif = (void *)vif->drv_priv, *tx_arvif;
 	int ret;
 
 	lockdep_assert_held(&ar->conf_mutex);
@@ -2827,6 +2841,11 @@ static void ath11k_bss_disassoc(struct ieee80211_hw *hw,
 			    arvif->vdev_id, ret);
 
 	arvif->is_up = false;
+	if (arvif->vif->mbssid_tx_vif) {
+		tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
+		if (tx_arvif != arvif)
+			tx_arvif->nontransmitting_vif_count--;
+	}
 
 	memset(&arvif->rekey_data, 0, sizeof(arvif->rekey_data));
 
@@ -3372,7 +3391,8 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
 			ret = ath11k_wmi_send_obss_color_collision_cfg_cmd(
 				ar, arvif->vdev_id, info->he_bss_color.color,
 				ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS,
-				info->he_bss_color.enabled);
+				arvif->vif->bss_conf.nontransmitted ?
+				0 : info->he_bss_color.enabled);
 			if (ret)
 				ath11k_warn(ar->ab, "failed to set bss color collision on vdev %i: %d\n",
 					    arvif->vdev_id,  ret);
@@ -6952,7 +6972,7 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
 			   int n_vifs)
 {
 	struct ath11k_base *ab = ar->ab;
-	struct ath11k_vif *arvif;
+	struct ath11k_vif *arvif, *tx_arvif;
 	int ret;
 	int i;
 	bool monitor_vif = false;
@@ -7011,6 +7031,12 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
 		params.vdev_id = arvif->vdev_id;
 		params.aid = arvif->aid;
 		params.bssid = arvif->bssid;
+		if (arvif->vif->mbssid_tx_vif) {
+			tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
+			params.tx_bssid = tx_arvif->bssid;
+			params.profile_idx = arvif->vif->bss_conf.bssid_index;
+			params.profile_count = tx_arvif->nontransmitting_vif_count;
+		}
 		ret = ath11k_wmi_vdev_up(arvif->ar, &params);
 		if (ret) {
 			ath11k_warn(ab, "failed to bring vdev up %d: %d\n",
-- 
2.31.1


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2022-05-23  7:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23  6:00 [PATCH 0/9] MBSSID and EMA support in AP mode Aloka Dixit
2022-05-23  6:00 ` Aloka Dixit
2022-05-23  6:01 ` [PATCH 1/9] mac80211: generate EMA beacons " Aloka Dixit
2022-05-23  6:01   ` Aloka Dixit
2022-07-01  8:59   ` Johannes Berg
2022-07-01  8:59     ` Johannes Berg
2022-05-23  6:01 ` [PATCH 2/9] ath11k: add WMI resource config for EMA Aloka Dixit
2022-05-23  6:01   ` Aloka Dixit
2022-05-23  6:01 ` [PATCH 3/9] ath11k: set MBSSID and EMA driver capabilities Aloka Dixit
2022-05-23  6:01   ` Aloka Dixit
2022-05-23  6:01 ` [PATCH 4/9] ath11k: MBSSID configuration during vdev create/start Aloka Dixit
2022-05-23  6:01   ` Aloka Dixit
2022-05-23  6:01 ` [PATCH 5/9] ath11k: create a structure for WMI vdev up parameters Aloka Dixit
2022-05-23  6:01   ` Aloka Dixit
2022-05-24 19:30   ` Jeff Johnson
2022-05-24 19:30     ` Jeff Johnson
2022-05-23  6:01 ` Aloka Dixit [this message]
2022-05-23  6:01   ` [PATCH 6/9] ath11k: configure MBSSID device parameters Aloka Dixit
2022-05-23  6:01 ` [PATCH 7/9] ath11k: move vif parameter setting in a different function Aloka Dixit
2022-05-23  6:01   ` Aloka Dixit
2022-05-23  6:01 ` [PATCH 8/9] ath11k: EMA beacon support Aloka Dixit
2022-05-23  6:01   ` Aloka Dixit
2022-05-23  6:01 ` [PATCH 9/9] ath11k: configure WPA and RSN parameters for nontransmitting interface Aloka Dixit
2022-05-23  6:01   ` Aloka Dixit

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=20220523060108.23982-7-quic_alokad@quicinc.com \
    --to=quic_alokad@quicinc.com \
    --cc=ath11k@lists.infradead.org \
    --cc=johannes@sipsolutions.net \
    --cc=john@phrozen.org \
    --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.