All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] wifi: mac80211_hwsim: MBSSID and EMA support
@ 2022-12-01  2:52 Aloka Dixit
  2022-12-01  2:52 ` [PATCH 1/3] wifi: mac80211_hwsim: move beacon transmission to a separate function Aloka Dixit
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Aloka Dixit @ 2022-12-01  2:52 UTC (permalink / raw)
  To: johannes, linux-wireless

Add support to test MBSSID and EMA beacon generation.

Patch #3 depends on following:
https://patchwork.kernel.org/project/linux-wireless/patch/20221114201912.22893-2-quic_alokad@quicinc.com/

Aloka Dixit (3):
  wifi: mac80211_hwsim: move beacon transmission to a separate function
  wifi: mac80211_hwsim: Multiple BSSID support
  wifi: mac80211_hwsim: EMA support

 drivers/net/wireless/mac80211_hwsim.c | 83 +++++++++++++++++++--------
 1 file changed, 58 insertions(+), 25 deletions(-)


base-commit: eceb024ee3eed1bacb5c32a4847269f2685e2ea4
prerequisite-patch-id: fcf54cc59b71b15010a88a080ee2b5f91d815d51
--
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] wifi: mac80211_hwsim: move beacon transmission to a separate function
  2022-12-01  2:52 [PATCH 0/3] wifi: mac80211_hwsim: MBSSID and EMA support Aloka Dixit
@ 2022-12-01  2:52 ` Aloka Dixit
  2022-12-01  2:52 ` [PATCH 2/3] wifi: mac80211_hwsim: Multiple BSSID support Aloka Dixit
  2022-12-01  2:52 ` [PATCH 3/3] wifi: mac80211_hwsim: EMA support Aloka Dixit
  2 siblings, 0 replies; 4+ messages in thread
From: Aloka Dixit @ 2022-12-01  2:52 UTC (permalink / raw)
  To: johannes, linux-wireless

Move the beacon transmission to a separate function to facilitate
addition of EMA beacon transmission.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
 drivers/net/wireless/mac80211_hwsim.c | 61 ++++++++++++++++-----------
 1 file changed, 36 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index c57c8903b7c0..b18f992b6276 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2054,38 +2054,18 @@ static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
 	dev_kfree_skb(skb);
 }
 
-static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
-				     struct ieee80211_vif *vif)
+static void __mac80211_hwsim_beacon_tx(struct ieee80211_bss_conf *link_conf,
+				       struct mac80211_hwsim_data *data,
+				       struct ieee80211_hw *hw,
+				       struct ieee80211_vif *vif,
+				       struct sk_buff *skb)
 {
-	struct mac80211_hwsim_link_data *link_data = arg;
-	u32 link_id = link_data->link_id;
-	struct ieee80211_bss_conf *link_conf;
-	struct mac80211_hwsim_data *data =
-		container_of(link_data, struct mac80211_hwsim_data,
-			     link_data[link_id]);
-	struct ieee80211_hw *hw = data->hw;
 	struct ieee80211_tx_info *info;
 	struct ieee80211_rate *txrate;
 	struct ieee80211_mgmt *mgmt;
-	struct sk_buff *skb;
 	/* TODO: get MCS */
 	int bitrate = 100;
 
-	hwsim_check_magic(vif);
-
-	link_conf = rcu_dereference(vif->link_conf[link_id]);
-	if (!link_conf)
-		return;
-
-	if (vif->type != NL80211_IFTYPE_AP &&
-	    vif->type != NL80211_IFTYPE_MESH_POINT &&
-	    vif->type != NL80211_IFTYPE_ADHOC &&
-	    vif->type != NL80211_IFTYPE_OCB)
-		return;
-
-	skb = ieee80211_beacon_get(hw, vif, link_data->link_id);
-	if (skb == NULL)
-		return;
 	info = IEEE80211_SKB_CB(skb);
 	if (ieee80211_hw_check(hw, SUPPORTS_RC_TABLE))
 		ieee80211_get_tx_rates(vif, NULL, skb,
@@ -2115,6 +2095,37 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
 
 	mac80211_hwsim_tx_frame(hw, skb,
 			rcu_dereference(link_conf->chanctx_conf)->def.chan);
+}
+
+static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
+				     struct ieee80211_vif *vif)
+{
+	struct mac80211_hwsim_link_data *link_data = arg;
+	u32 link_id = link_data->link_id;
+	struct ieee80211_bss_conf *link_conf;
+	struct mac80211_hwsim_data *data =
+		container_of(link_data, struct mac80211_hwsim_data,
+			     link_data[link_id]);
+	struct ieee80211_hw *hw = data->hw;
+	struct sk_buff *skb;
+
+	hwsim_check_magic(vif);
+
+	link_conf = rcu_dereference(vif->link_conf[link_id]);
+	if (!link_conf)
+		return;
+
+	if (vif->type != NL80211_IFTYPE_AP &&
+	    vif->type != NL80211_IFTYPE_MESH_POINT &&
+	    vif->type != NL80211_IFTYPE_ADHOC &&
+	    vif->type != NL80211_IFTYPE_OCB)
+		return;
+
+	skb = ieee80211_beacon_get(hw, vif, link_id);
+	if (!skb)
+		return;
+
+	__mac80211_hwsim_beacon_tx(link_conf, data, hw, vif, skb);
 
 	while ((skb = ieee80211_get_buffered_bc(hw, vif)) != NULL) {
 		mac80211_hwsim_tx_frame(hw, skb,

base-commit: eceb024ee3eed1bacb5c32a4847269f2685e2ea4
prerequisite-patch-id: fcf54cc59b71b15010a88a080ee2b5f91d815d51
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] wifi: mac80211_hwsim: Multiple BSSID support
  2022-12-01  2:52 [PATCH 0/3] wifi: mac80211_hwsim: MBSSID and EMA support Aloka Dixit
  2022-12-01  2:52 ` [PATCH 1/3] wifi: mac80211_hwsim: move beacon transmission to a separate function Aloka Dixit
@ 2022-12-01  2:52 ` Aloka Dixit
  2022-12-01  2:52 ` [PATCH 3/3] wifi: mac80211_hwsim: EMA support Aloka Dixit
  2 siblings, 0 replies; 4+ messages in thread
From: Aloka Dixit @ 2022-12-01  2:52 UTC (permalink / raw)
  To: johannes, linux-wireless

Advertise multiple BSSID support for up to 8 interfaces.
Do not send beacons from the non-transmitting interfaces.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
 drivers/net/wireless/mac80211_hwsim.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index b18f992b6276..7cf9a7a364be 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2121,6 +2121,9 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
 	    vif->type != NL80211_IFTYPE_OCB)
 		return;
 
+	if (vif->mbssid_tx_vif && vif->mbssid_tx_vif != vif)
+		return;
+
 	skb = ieee80211_beacon_get(hw, vif, link_id);
 	if (!skb)
 		return;
@@ -4404,6 +4407,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
 		hw->wiphy->n_cipher_suites = param->n_ciphers;
 	}
 
+	hw->wiphy->mbssid_max_interfaces = 8;
+
 	data->rx_rssi = DEFAULT_RX_RSSI;
 
 	INIT_DELAYED_WORK(&data->roc_start, hw_roc_start);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] wifi: mac80211_hwsim: EMA support
  2022-12-01  2:52 [PATCH 0/3] wifi: mac80211_hwsim: MBSSID and EMA support Aloka Dixit
  2022-12-01  2:52 ` [PATCH 1/3] wifi: mac80211_hwsim: move beacon transmission to a separate function Aloka Dixit
  2022-12-01  2:52 ` [PATCH 2/3] wifi: mac80211_hwsim: Multiple BSSID support Aloka Dixit
@ 2022-12-01  2:52 ` Aloka Dixit
  2 siblings, 0 replies; 4+ messages in thread
From: Aloka Dixit @ 2022-12-01  2:52 UTC (permalink / raw)
  To: johannes, linux-wireless

Add support enhanced multi-BSS advertisements (EMA)
for profile periodicity up to 3 beacons.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
v1: depends on following
https://patchwork.kernel.org/project/linux-wireless/patch/20221114201912.22893-2-quic_alokad@quicinc.com/

 drivers/net/wireless/mac80211_hwsim.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 7cf9a7a364be..00b92d2936de 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2124,11 +2124,27 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
 	if (vif->mbssid_tx_vif && vif->mbssid_tx_vif != vif)
 		return;

-	skb = ieee80211_beacon_get(hw, vif, link_id);
-	if (!skb)
-		return;
+	if (vif->bss_conf.ema_ap) {
+		struct ieee80211_ema_beacons *ema;
+		u8 i = 0;
+
+		ema = ieee80211_beacon_get_template_ema_list(hw, vif, link_id);
+		if (!ema || !ema->cnt)
+			return;
+
+		for (i = 0; i < ema->cnt; i++) {
+			__mac80211_hwsim_beacon_tx(link_conf, data, hw, vif,
+						   ema->bcn[i].skb);
+			ema->bcn[i].skb = NULL; /* Already freed */
+		}
+		ieee80211_beacon_free_ema_list(ema);
+	} else {
+		skb = ieee80211_beacon_get(hw, vif, link_id);
+		if (!skb)
+			return;

-	__mac80211_hwsim_beacon_tx(link_conf, data, hw, vif, skb);
+		__mac80211_hwsim_beacon_tx(link_conf, data, hw, vif, skb);
+	}

 	while ((skb = ieee80211_get_buffered_bc(hw, vif)) != NULL) {
 		mac80211_hwsim_tx_frame(hw, skb,
@@ -4408,6 +4424,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
 	}

 	hw->wiphy->mbssid_max_interfaces = 8;
+	hw->wiphy->ema_max_profile_periodicity = 3;

 	data->rx_rssi = DEFAULT_RX_RSSI;

--
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-01  2:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01  2:52 [PATCH 0/3] wifi: mac80211_hwsim: MBSSID and EMA support Aloka Dixit
2022-12-01  2:52 ` [PATCH 1/3] wifi: mac80211_hwsim: move beacon transmission to a separate function Aloka Dixit
2022-12-01  2:52 ` [PATCH 2/3] wifi: mac80211_hwsim: Multiple BSSID support Aloka Dixit
2022-12-01  2:52 ` [PATCH 3/3] wifi: mac80211_hwsim: EMA support Aloka Dixit

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.