linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] cfg80211/mac80211 patches from our internal tree 2024-03-20
@ 2024-03-20  7:13 Miri Korenblit
  2024-03-20  7:13 ` [PATCH 1/8] wifi: mac80211: do not call ieee80211_key_switch_links during reconfig Miri Korenblit
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Miri Korenblit @ 2024-03-20  7:13 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless

Hi,

A bunch of patches from our internal tree with mac80211 and
cfg80211 changes. It's the usual developement:
features, cleanups and bugfixes.

Thanks,
Miri

Ayala Beker (1):
  wifi: mac80211: don't select link ID if not provided in scan request

Benjamin Berg (1):
  wifi: mac80211: do not call ieee80211_key_switch_links during reconfig

Ilan Peer (1):
  wifi: mac80211_hwsim: Declare HE/EHT capabilities support for P2P
    interfaces

Johannes Berg (5):
  wifi: mac80211: don't enter idle during link switch
  wifi: mac80211: clarify IEEE80211_STATUS_SUBDATA_MASK
  wifi: mac80211: don't ask driver about no-op link changes
  wifi: mac80211: improve drop for action frame return
  wifi: mac80211: reactivate multi-link later in restart

 drivers/net/wireless/virtual/mac80211_hwsim.c | 20 ++++++-----
 net/mac80211/chan.c                           | 34 +++++++++++--------
 net/mac80211/drop.h                           |  3 +-
 net/mac80211/ht.c                             |  2 +-
 net/mac80211/ieee80211_i.h                    |  6 +++-
 net/mac80211/link.c                           | 13 ++++---
 net/mac80211/rx.c                             |  4 +--
 net/mac80211/scan.c                           | 16 +++------
 net/mac80211/util.c                           | 12 +++++--
 9 files changed, 63 insertions(+), 47 deletions(-)

-- 
2.34.1


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

* [PATCH 1/8] wifi: mac80211: do not call ieee80211_key_switch_links during reconfig
  2024-03-20  7:13 [PATCH 0/8] cfg80211/mac80211 patches from our internal tree 2024-03-20 Miri Korenblit
@ 2024-03-20  7:13 ` Miri Korenblit
  2024-03-20 12:57   ` Johannes Berg
  2024-03-20  7:13 ` [PATCH 2/8] wifi: mac80211: don't enter idle during link switch Miri Korenblit
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Miri Korenblit @ 2024-03-20  7:13 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Benjamin Berg, Johannes Berg

From: Benjamin Berg <benjamin.berg@intel.com>

The keys will be configured later by a call to ieee80211_reenable_keys.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 net/mac80211/link.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/link.c b/net/mac80211/link.c
index 685ec66b4264..7f01462f84e9 100644
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -375,8 +375,10 @@ static int _ieee80211_set_active_links(struct ieee80211_sub_if_data *sdata,
 		WARN_ON_ONCE(ret);
 	}
 
-	ret = ieee80211_key_switch_links(sdata, rem, add);
-	WARN_ON_ONCE(ret);
+	if (!local->in_reconfig) {
+		ret = ieee80211_key_switch_links(sdata, rem, add);
+		WARN_ON_ONCE(ret);
+	}
 
 	list_for_each_entry(sta, &local->sta_list, list) {
 		if (sdata != sta->sdata)
-- 
2.34.1


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

* [PATCH 2/8] wifi: mac80211: don't enter idle during link switch
  2024-03-20  7:13 [PATCH 0/8] cfg80211/mac80211 patches from our internal tree 2024-03-20 Miri Korenblit
  2024-03-20  7:13 ` [PATCH 1/8] wifi: mac80211: do not call ieee80211_key_switch_links during reconfig Miri Korenblit
@ 2024-03-20  7:13 ` Miri Korenblit
  2024-03-20  7:14 ` [PATCH 3/8] wifi: mac80211: clarify IEEE80211_STATUS_SUBDATA_MASK Miri Korenblit
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Miri Korenblit @ 2024-03-20  7:13 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

When doing link switch with a disjoint set of links before
and after the switch, we end up removing all channel contexts,
adding new ones later. This looks like 'idle' to the code now,
and we enter idle which also includes flushing queues. But we
can't actually flush since we don't have a link active (bound
to a channel context), and entering idle just to leave it again
is also wrong.

Fix this by passing through an indication that we shouldn't do
any idle checks in this case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 net/mac80211/chan.c        | 34 +++++++++++++++++++---------------
 net/mac80211/ieee80211_i.h |  2 ++
 net/mac80211/link.c        |  2 +-
 3 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 80e4b9784131..5a7fb0e4f89d 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -695,26 +695,29 @@ ieee80211_new_chanctx(struct ieee80211_local *local,
 }
 
 static void ieee80211_del_chanctx(struct ieee80211_local *local,
-				  struct ieee80211_chanctx *ctx)
+				  struct ieee80211_chanctx *ctx,
+				  bool skip_idle_recalc)
 {
 	lockdep_assert_wiphy(local->hw.wiphy);
 
 	drv_remove_chanctx(local, ctx);
 
-	ieee80211_recalc_idle(local);
+	if (!skip_idle_recalc)
+		ieee80211_recalc_idle(local);
 
 	ieee80211_remove_wbrf(local, &ctx->conf.def);
 }
 
 static void ieee80211_free_chanctx(struct ieee80211_local *local,
-				   struct ieee80211_chanctx *ctx)
+				   struct ieee80211_chanctx *ctx,
+				   bool skip_idle_recalc)
 {
 	lockdep_assert_wiphy(local->hw.wiphy);
 
 	WARN_ON_ONCE(ieee80211_chanctx_refcount(local, ctx) != 0);
 
 	list_del_rcu(&ctx->list);
-	ieee80211_del_chanctx(local, ctx);
+	ieee80211_del_chanctx(local, ctx, skip_idle_recalc);
 	kfree_rcu(ctx, rcu_head);
 }
 
@@ -1002,7 +1005,7 @@ int ieee80211_link_unreserve_chanctx(struct ieee80211_link_data *link)
 			list_del_rcu(&ctx->list);
 			kfree_rcu(ctx, rcu_head);
 		} else {
-			ieee80211_free_chanctx(sdata->local, ctx);
+			ieee80211_free_chanctx(sdata->local, ctx, false);
 		}
 	}
 
@@ -1218,7 +1221,7 @@ ieee80211_link_use_reserved_reassign(struct ieee80211_link_data *link)
 				     CHANCTX_SWMODE_REASSIGN_VIF);
 	if (err) {
 		if (ieee80211_chanctx_refcount(local, new_ctx) == 0)
-			ieee80211_free_chanctx(local, new_ctx);
+			ieee80211_free_chanctx(local, new_ctx, false);
 
 		goto out;
 	}
@@ -1232,7 +1235,7 @@ ieee80211_link_use_reserved_reassign(struct ieee80211_link_data *link)
 	ieee80211_check_fast_xmit_iface(sdata);
 
 	if (ieee80211_chanctx_refcount(local, old_ctx) == 0)
-		ieee80211_free_chanctx(local, old_ctx);
+		ieee80211_free_chanctx(local, old_ctx, false);
 
 	ieee80211_recalc_chanctx_min_def(local, new_ctx, NULL);
 	ieee80211_recalc_smps_chanctx(local, new_ctx);
@@ -1286,7 +1289,7 @@ ieee80211_link_use_reserved_assign(struct ieee80211_link_data *link)
 	err = ieee80211_assign_link_chanctx(link, new_ctx);
 	if (err) {
 		if (ieee80211_chanctx_refcount(local, new_ctx) == 0)
-			ieee80211_free_chanctx(local, new_ctx);
+			ieee80211_free_chanctx(local, new_ctx, false);
 
 		goto out;
 	}
@@ -1383,7 +1386,7 @@ static int ieee80211_chsw_switch_ctxs(struct ieee80211_local *local)
 		if (!list_empty(&ctx->replace_ctx->assigned_links))
 			continue;
 
-		ieee80211_del_chanctx(local, ctx->replace_ctx);
+		ieee80211_del_chanctx(local, ctx->replace_ctx, false);
 		err = ieee80211_add_chanctx(local, ctx);
 		if (err)
 			goto err;
@@ -1400,7 +1403,7 @@ static int ieee80211_chsw_switch_ctxs(struct ieee80211_local *local)
 		if (!list_empty(&ctx->replace_ctx->assigned_links))
 			continue;
 
-		ieee80211_del_chanctx(local, ctx);
+		ieee80211_del_chanctx(local, ctx, false);
 		WARN_ON(ieee80211_add_chanctx(local, ctx->replace_ctx));
 	}
 
@@ -1652,7 +1655,8 @@ static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local)
 	return err;
 }
 
-static void __ieee80211_link_release_channel(struct ieee80211_link_data *link)
+void __ieee80211_link_release_channel(struct ieee80211_link_data *link,
+				      bool skip_idle_recalc)
 {
 	struct ieee80211_sub_if_data *sdata = link->sdata;
 	struct ieee80211_bss_conf *link_conf = link->conf;
@@ -1680,7 +1684,7 @@ static void __ieee80211_link_release_channel(struct ieee80211_link_data *link)
 
 	ieee80211_assign_link_chanctx(link, NULL);
 	if (ieee80211_chanctx_refcount(local, ctx) == 0)
-		ieee80211_free_chanctx(local, ctx);
+		ieee80211_free_chanctx(local, ctx, skip_idle_recalc);
 
 	link->radar_required = false;
 
@@ -1721,7 +1725,7 @@ int ieee80211_link_use_channel(struct ieee80211_link_data *link,
 	if (ret < 0)
 		goto out;
 
-	__ieee80211_link_release_channel(link);
+	__ieee80211_link_release_channel(link, false);
 
 	ctx = ieee80211_find_chanctx(local, chanreq, mode);
 	if (!ctx)
@@ -1737,7 +1741,7 @@ int ieee80211_link_use_channel(struct ieee80211_link_data *link,
 	if (ret) {
 		/* if assign fails refcount stays the same */
 		if (ieee80211_chanctx_refcount(local, ctx) == 0)
-			ieee80211_free_chanctx(local, ctx);
+			ieee80211_free_chanctx(local, ctx, false);
 		goto out;
 	}
 
@@ -1930,7 +1934,7 @@ void ieee80211_link_release_channel(struct ieee80211_link_data *link)
 	lockdep_assert_wiphy(sdata->local->hw.wiphy);
 
 	if (rcu_access_pointer(link->conf->chanctx_conf))
-		__ieee80211_link_release_channel(link);
+		__ieee80211_link_release_channel(link, false);
 }
 
 void ieee80211_link_vlan_copy_chanctx(struct ieee80211_link_data *link)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 925e875f9b96..c2212363dad3 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2567,6 +2567,8 @@ int __must_check
 ieee80211_link_change_chanreq(struct ieee80211_link_data *link,
 			      const struct ieee80211_chan_req *req,
 			      u64 *changed);
+void __ieee80211_link_release_channel(struct ieee80211_link_data *link,
+				      bool skip_idle_recalc);
 void ieee80211_link_release_channel(struct ieee80211_link_data *link);
 void ieee80211_link_vlan_copy_chanctx(struct ieee80211_link_data *link);
 void ieee80211_link_copy_chanctx_to_vlans(struct ieee80211_link_data *link,
diff --git a/net/mac80211/link.c b/net/mac80211/link.c
index 7f01462f84e9..503ec47bbc2a 100644
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -358,7 +358,7 @@ static int _ieee80211_set_active_links(struct ieee80211_sub_if_data *sdata,
 
 		ieee80211_teardown_tdls_peers(link);
 
-		ieee80211_link_release_channel(link);
+		__ieee80211_link_release_channel(link, true);
 	}
 
 	list_for_each_entry(sta, &local->sta_list, list) {
-- 
2.34.1


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

* [PATCH 3/8] wifi: mac80211: clarify IEEE80211_STATUS_SUBDATA_MASK
  2024-03-20  7:13 [PATCH 0/8] cfg80211/mac80211 patches from our internal tree 2024-03-20 Miri Korenblit
  2024-03-20  7:13 ` [PATCH 1/8] wifi: mac80211: do not call ieee80211_key_switch_links during reconfig Miri Korenblit
  2024-03-20  7:13 ` [PATCH 2/8] wifi: mac80211: don't enter idle during link switch Miri Korenblit
@ 2024-03-20  7:14 ` Miri Korenblit
  2024-03-20  7:14 ` [PATCH 4/8] wifi: mac80211_hwsim: Declare HE/EHT capabilities support for P2P interfaces Miri Korenblit
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Miri Korenblit @ 2024-03-20  7:14 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg, Ayala Beker

From: Johannes Berg <johannes.berg@intel.com>

We have 13 bits for the status_data, so restricting
type to 4 and subdata to 8 bits is confusing, even if
we don't need more bits now. Change subdata mask to
be 9 bits instead, just to make things match up.

If we actually need more types or more subdata bits
we can later also reshuffle the bits between these,
but we should probably keep them at 13 bits together.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 net/mac80211/ht.c          | 2 +-
 net/mac80211/ieee80211_i.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index c3330aea4da3..d7e8cf8e48b7 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -580,7 +580,7 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
 	/* we'll do more on status of this frame */
 	info = IEEE80211_SKB_CB(skb);
 	info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
-	/* we have 12 bits, and need 6: link_id 4, smps 2 */
+	/* we have 13 bits, and need 6: link_id 4, smps 2 */
 	info->status_data = IEEE80211_STATUS_TYPE_SMPS |
 			    u16_encode_bits(status_link_id << 2 | smps,
 					    IEEE80211_STATUS_SUBDATA_MASK);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c2212363dad3..fe81ab641620 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -90,7 +90,7 @@ enum ieee80211_status_data {
 	IEEE80211_STATUS_TYPE_INVALID	= 0,
 	IEEE80211_STATUS_TYPE_SMPS	= 1,
 	IEEE80211_STATUS_TYPE_NEG_TTLM	= 2,
-	IEEE80211_STATUS_SUBDATA_MASK	= 0xff0,
+	IEEE80211_STATUS_SUBDATA_MASK	= 0x1ff0,
 };
 
 static inline bool
-- 
2.34.1


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

* [PATCH 4/8] wifi: mac80211_hwsim: Declare HE/EHT capabilities support for P2P interfaces
  2024-03-20  7:13 [PATCH 0/8] cfg80211/mac80211 patches from our internal tree 2024-03-20 Miri Korenblit
                   ` (2 preceding siblings ...)
  2024-03-20  7:14 ` [PATCH 3/8] wifi: mac80211: clarify IEEE80211_STATUS_SUBDATA_MASK Miri Korenblit
@ 2024-03-20  7:14 ` Miri Korenblit
  2024-03-20  7:14 ` [PATCH 5/8] wifi: mac80211: don't select link ID if not provided in scan request Miri Korenblit
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Miri Korenblit @ 2024-03-20  7:14 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Ilan Peer, Johannes Berg

From: Ilan Peer <ilan.peer@intel.com>

Declare HE/EHT capabilities support also for P2P client and P2P GO
interface types.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/virtual/mac80211_hwsim.c | 20 +++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c
index 450913cf6583..30acd78926a6 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
@@ -4125,7 +4125,8 @@ static void hwsim_mcast_new_radio(int id, struct genl_info *info,
 
 static const struct ieee80211_sband_iftype_data sband_capa_2ghz[] = {
 	{
-		.types_mask = BIT(NL80211_IFTYPE_STATION),
+		.types_mask = BIT(NL80211_IFTYPE_STATION) |
+			      BIT(NL80211_IFTYPE_P2P_CLIENT),
 		.he_cap = {
 			.has_he = true,
 			.he_cap_elem = {
@@ -4232,7 +4233,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_2ghz[] = {
 		},
 	},
 	{
-		.types_mask = BIT(NL80211_IFTYPE_AP),
+		.types_mask = BIT(NL80211_IFTYPE_AP) |
+			      BIT(NL80211_IFTYPE_P2P_GO),
 		.he_cap = {
 			.has_he = true,
 			.he_cap_elem = {
@@ -4383,8 +4385,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_2ghz[] = {
 
 static const struct ieee80211_sband_iftype_data sband_capa_5ghz[] = {
 	{
-		/* TODO: should we support other types, e.g., P2P? */
-		.types_mask = BIT(NL80211_IFTYPE_STATION),
+		.types_mask = BIT(NL80211_IFTYPE_STATION) |
+			      BIT(NL80211_IFTYPE_P2P_CLIENT),
 		.he_cap = {
 			.has_he = true,
 			.he_cap_elem = {
@@ -4508,7 +4510,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_5ghz[] = {
 		},
 	},
 	{
-		.types_mask = BIT(NL80211_IFTYPE_AP),
+		.types_mask = BIT(NL80211_IFTYPE_AP) |
+			      BIT(NL80211_IFTYPE_P2P_GO),
 		.he_cap = {
 			.has_he = true,
 			.he_cap_elem = {
@@ -4679,8 +4682,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_5ghz[] = {
 
 static const struct ieee80211_sband_iftype_data sband_capa_6ghz[] = {
 	{
-		/* TODO: should we support other types, e.g., P2P? */
-		.types_mask = BIT(NL80211_IFTYPE_STATION),
+		.types_mask = BIT(NL80211_IFTYPE_STATION) |
+			      BIT(NL80211_IFTYPE_P2P_CLIENT),
 		.he_6ghz_capa = {
 			.capa = cpu_to_le16(IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START |
 					    IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP |
@@ -4825,7 +4828,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_6ghz[] = {
 		},
 	},
 	{
-		.types_mask = BIT(NL80211_IFTYPE_AP),
+		.types_mask = BIT(NL80211_IFTYPE_AP) |
+			      BIT(NL80211_IFTYPE_P2P_GO),
 		.he_6ghz_capa = {
 			.capa = cpu_to_le16(IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START |
 					    IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP |
-- 
2.34.1


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

* [PATCH 5/8] wifi: mac80211: don't select link ID if not provided in scan request
  2024-03-20  7:13 [PATCH 0/8] cfg80211/mac80211 patches from our internal tree 2024-03-20 Miri Korenblit
                   ` (3 preceding siblings ...)
  2024-03-20  7:14 ` [PATCH 4/8] wifi: mac80211_hwsim: Declare HE/EHT capabilities support for P2P interfaces Miri Korenblit
@ 2024-03-20  7:14 ` Miri Korenblit
  2024-03-20  7:14 ` [PATCH 6/8] wifi: mac80211: don't ask driver about no-op link changes Miri Korenblit
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Miri Korenblit @ 2024-03-20  7:14 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Ayala Beker, Johannes Berg

From: Ayala Beker <ayala.beker@intel.com>

If scan request doesn't include a link ID to be used for TSF
reporting, don't select it as it might become inactive before
scan is actually started by the driver.
Instead, let the driver select one of the active links.

Fixes: cbde0b49f276 ("wifi: mac80211: Extend support for scanning while MLO connected")
Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 net/mac80211/scan.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 0429e59ba387..977f8eb0a67b 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -707,19 +707,11 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 		return -EBUSY;
 
 	/* For an MLO connection, if a link ID was specified, validate that it
-	 * is indeed active. If no link ID was specified, select one of the
-	 * active links.
+	 * is indeed active.
 	 */
-	if (ieee80211_vif_is_mld(&sdata->vif)) {
-		if (req->tsf_report_link_id >= 0) {
-			if (!(sdata->vif.active_links &
-			      BIT(req->tsf_report_link_id)))
-				return -EINVAL;
-		} else {
-			req->tsf_report_link_id =
-				__ffs(sdata->vif.active_links);
-		}
-	}
+	if (ieee80211_vif_is_mld(&sdata->vif) && req->tsf_report_link_id >= 0 &&
+	    !(sdata->vif.active_links & BIT(req->tsf_report_link_id)))
+		return -EINVAL;
 
 	if (!__ieee80211_can_leave_ch(sdata))
 		return -EBUSY;
-- 
2.34.1


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

* [PATCH 6/8] wifi: mac80211: don't ask driver about no-op link changes
  2024-03-20  7:13 [PATCH 0/8] cfg80211/mac80211 patches from our internal tree 2024-03-20 Miri Korenblit
                   ` (4 preceding siblings ...)
  2024-03-20  7:14 ` [PATCH 5/8] wifi: mac80211: don't select link ID if not provided in scan request Miri Korenblit
@ 2024-03-20  7:14 ` Miri Korenblit
  2024-03-20  7:14 ` [PATCH 7/8] wifi: mac80211: improve drop for action frame return Miri Korenblit
  2024-03-20  7:14 ` [PATCH 8/8] wifi: mac80211: reactivate multi-link later in restart Miri Korenblit
  7 siblings, 0 replies; 10+ messages in thread
From: Miri Korenblit @ 2024-03-20  7:14 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

If the links won't actually change, nothing will happen.
This was previously done in the inner function (twice in
some cases), but we shouldn't bother the driver with it.
Clean that up.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 net/mac80211/link.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/link.c b/net/mac80211/link.c
index 503ec47bbc2a..84efb6487970 100644
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -452,10 +452,13 @@ int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links)
 	if (WARN_ON(!active_links))
 		return -EINVAL;
 
+	old_active = sdata->vif.active_links;
+	if (old_active == active_links)
+		return 0;
+
 	if (!drv_can_activate_links(local, sdata, active_links))
 		return -EINVAL;
 
-	old_active = sdata->vif.active_links;
 	if (old_active & active_links) {
 		/*
 		 * if there's at least one link that stays active across
-- 
2.34.1


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

* [PATCH 7/8] wifi: mac80211: improve drop for action frame return
  2024-03-20  7:13 [PATCH 0/8] cfg80211/mac80211 patches from our internal tree 2024-03-20 Miri Korenblit
                   ` (5 preceding siblings ...)
  2024-03-20  7:14 ` [PATCH 6/8] wifi: mac80211: don't ask driver about no-op link changes Miri Korenblit
@ 2024-03-20  7:14 ` Miri Korenblit
  2024-03-20  7:14 ` [PATCH 8/8] wifi: mac80211: reactivate multi-link later in restart Miri Korenblit
  7 siblings, 0 replies; 10+ messages in thread
From: Miri Korenblit @ 2024-03-20  7:14 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

If we use a drop we not only save the extra call to
dev_kfree_skb(), but also have a better reason in
tracing, so do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 net/mac80211/drop.h | 3 ++-
 net/mac80211/rx.c   | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/drop.h b/net/mac80211/drop.h
index 12a6f0e9eca6..59e3ec4dc960 100644
--- a/net/mac80211/drop.h
+++ b/net/mac80211/drop.h
@@ -2,7 +2,7 @@
 /*
  * mac80211 drop reason list
  *
- * Copyright (C) 2023 Intel Corporation
+ * Copyright (C) 2023-2024 Intel Corporation
  */
 
 #ifndef MAC80211_DROP_H
@@ -66,6 +66,7 @@ typedef unsigned int __bitwise ieee80211_rx_result;
 	R(RX_DROP_U_UNEXPECTED_STA_4ADDR)	\
 	R(RX_DROP_U_UNEXPECTED_VLAN_MCAST)	\
 	R(RX_DROP_U_NOT_PORT_CONTROL)		\
+	R(RX_DROP_U_UNKNOWN_ACTION_REJECTED)	\
 /* this line for the trailing \ - add before this */
 
 /* having two enums allows for checking ieee80211_rx_result use with sparse */
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index c1f850138405..4b4cbd8bf35d 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3958,8 +3958,8 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx)
 		__ieee80211_tx_skb_tid_band(rx->sdata, nskb, 7, -1,
 					    status->band);
 	}
-	dev_kfree_skb(rx->skb);
-	return RX_QUEUED;
+
+	return RX_DROP_U_UNKNOWN_ACTION_REJECTED;
 }
 
 static ieee80211_rx_result debug_noinline
-- 
2.34.1


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

* [PATCH 8/8] wifi: mac80211: reactivate multi-link later in restart
  2024-03-20  7:13 [PATCH 0/8] cfg80211/mac80211 patches from our internal tree 2024-03-20 Miri Korenblit
                   ` (6 preceding siblings ...)
  2024-03-20  7:14 ` [PATCH 7/8] wifi: mac80211: improve drop for action frame return Miri Korenblit
@ 2024-03-20  7:14 ` Miri Korenblit
  7 siblings, 0 replies; 10+ messages in thread
From: Miri Korenblit @ 2024-03-20  7:14 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

In case of restart, we currently reactivate multi-link on
interfaces before reconfiguring keys etc. which means the
drivers need to handle this case differently. Enable more
links later to allow them to handle it the same way.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 net/mac80211/ieee80211_i.h |  2 ++
 net/mac80211/util.c        | 12 +++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index fe81ab641620..def611e4e55f 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1161,6 +1161,8 @@ struct ieee80211_sub_if_data {
 	struct wiphy_work activate_links_work;
 	u16 desired_active_links;
 
+	u16 restart_active_links;
+
 #ifdef CONFIG_MAC80211_DEBUGFS
 	struct {
 		struct dentry *subdir_stations;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index a5d5e05688b4..cda398d8f60d 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1932,6 +1932,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
 					     old);
 		}
 
+		sdata->restart_active_links = active_links;
+
 		for (link_id = 0;
 		     link_id < ARRAY_SIZE(sdata->vif.link_conf);
 		     link_id++) {
@@ -2059,9 +2061,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
 			WARN_ON(1);
 			break;
 		}
-
-		if (active_links)
-			ieee80211_set_active_links(&sdata->vif, active_links);
 	}
 
 	ieee80211_recalc_ps(local);
@@ -2102,6 +2101,13 @@ int ieee80211_reconfig(struct ieee80211_local *local)
 	list_for_each_entry(sdata, &local->interfaces, list)
 		ieee80211_reenable_keys(sdata);
 
+	/* re-enable multi-link for client interfaces */
+	list_for_each_entry(sdata, &local->interfaces, list) {
+		if (sdata->restart_active_links)
+			ieee80211_set_active_links(&sdata->vif,
+						   sdata->restart_active_links);
+	}
+
 	/* Reconfigure sched scan if it was interrupted by FW restart */
 	sched_scan_sdata = rcu_dereference_protected(local->sched_scan_sdata,
 						lockdep_is_held(&local->hw.wiphy->mtx));
-- 
2.34.1


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

* Re: [PATCH 1/8] wifi: mac80211: do not call ieee80211_key_switch_links during reconfig
  2024-03-20  7:13 ` [PATCH 1/8] wifi: mac80211: do not call ieee80211_key_switch_links during reconfig Miri Korenblit
@ 2024-03-20 12:57   ` Johannes Berg
  0 siblings, 0 replies; 10+ messages in thread
From: Johannes Berg @ 2024-03-20 12:57 UTC (permalink / raw)
  To: Miri Korenblit; +Cc: linux-wireless, Benjamin Berg

On Wed, 2024-03-20 at 09:13 +0200, Miri Korenblit wrote:
> From: Benjamin Berg <benjamin.berg@intel.com>
> 
> The keys will be configured later by a call to ieee80211_reenable_keys.
> 

After patch 8 in this series this is actually wrong and I'm reverting it
internally, so I'll just drop this one.

johannes

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

end of thread, other threads:[~2024-03-20 12:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-20  7:13 [PATCH 0/8] cfg80211/mac80211 patches from our internal tree 2024-03-20 Miri Korenblit
2024-03-20  7:13 ` [PATCH 1/8] wifi: mac80211: do not call ieee80211_key_switch_links during reconfig Miri Korenblit
2024-03-20 12:57   ` Johannes Berg
2024-03-20  7:13 ` [PATCH 2/8] wifi: mac80211: don't enter idle during link switch Miri Korenblit
2024-03-20  7:14 ` [PATCH 3/8] wifi: mac80211: clarify IEEE80211_STATUS_SUBDATA_MASK Miri Korenblit
2024-03-20  7:14 ` [PATCH 4/8] wifi: mac80211_hwsim: Declare HE/EHT capabilities support for P2P interfaces Miri Korenblit
2024-03-20  7:14 ` [PATCH 5/8] wifi: mac80211: don't select link ID if not provided in scan request Miri Korenblit
2024-03-20  7:14 ` [PATCH 6/8] wifi: mac80211: don't ask driver about no-op link changes Miri Korenblit
2024-03-20  7:14 ` [PATCH 7/8] wifi: mac80211: improve drop for action frame return Miri Korenblit
2024-03-20  7:14 ` [PATCH 8/8] wifi: mac80211: reactivate multi-link later in restart Miri Korenblit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).