linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
To: <johannes@sipsolutions.net>
Cc: <linux-wireless@vger.kernel.org>,
	Aditya Kumar Singh <quic_adisi@quicinc.com>
Subject: [PATCH 3/7] wifi: mac80211: handle set color_change/after_color_change beacon on per link basis
Date: Tue, 16 Apr 2024 10:29:39 +0530	[thread overview]
Message-ID: <20240416045943.576656-4-quic_adisi@quicinc.com> (raw)
In-Reply-To: <20240416045943.576656-1-quic_adisi@quicinc.com>

In order to support color change with MLO, there is a need to handle the
functions ieee80211_set_color_change_beacon() and
ieee80211_set_after_color_change_beacon() on a per link basis.

Implement this by making the function argument accept the link data
instead of the sdata.

Currently, deflink would only be passed. Proper link data will be passed in
a subsequent change.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
 net/mac80211/cfg.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index f9374ce04c93..6e64c0740c81 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -4662,20 +4662,22 @@ static int ieee80211_set_sar_specs(struct wiphy *wiphy,
 }
 
 static int
-ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata,
+ieee80211_set_after_color_change_beacon(struct ieee80211_link_data *link,
 					u64 *changed)
 {
+	struct ieee80211_sub_if_data *sdata = link->sdata;
+
 	switch (sdata->vif.type) {
 	case NL80211_IFTYPE_AP: {
 		int ret;
 
-		if (!sdata->deflink.u.ap.next_beacon)
+		if (!link->u.ap.next_beacon)
 			return -EINVAL;
 
-		ret = ieee80211_assign_beacon(sdata, &sdata->deflink,
-					      sdata->deflink.u.ap.next_beacon,
+		ret = ieee80211_assign_beacon(sdata, link,
+					      link->u.ap.next_beacon,
 					      NULL, NULL, changed);
-		ieee80211_free_next_beacon(&sdata->deflink);
+		ieee80211_free_next_beacon(link);
 
 		if (ret < 0)
 			return ret;
@@ -4691,18 +4693,19 @@ ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata,
 }
 
 static int
-ieee80211_set_color_change_beacon(struct ieee80211_sub_if_data *sdata,
+ieee80211_set_color_change_beacon(struct ieee80211_link_data *link,
 				  struct cfg80211_color_change_settings *params,
 				  u64 *changed)
 {
+	struct ieee80211_sub_if_data *sdata = link->sdata;
 	struct ieee80211_color_change_settings color_change = {};
 	int err;
 
 	switch (sdata->vif.type) {
 	case NL80211_IFTYPE_AP:
-		sdata->deflink.u.ap.next_beacon =
+		link->u.ap.next_beacon =
 			cfg80211_beacon_dup(&params->beacon_next);
-		if (!sdata->deflink.u.ap.next_beacon)
+		if (!link->u.ap.next_beacon)
 			return -ENOMEM;
 
 		if (params->count <= 1)
@@ -4714,11 +4717,11 @@ ieee80211_set_color_change_beacon(struct ieee80211_sub_if_data *sdata,
 			params->counter_offset_presp;
 		color_change.count = params->count;
 
-		err = ieee80211_assign_beacon(sdata, &sdata->deflink,
+		err = ieee80211_assign_beacon(sdata, link,
 					      &params->beacon_color_change,
 					      NULL, &color_change, changed);
 		if (err < 0) {
-			ieee80211_free_next_beacon(&sdata->deflink);
+			ieee80211_free_next_beacon(link);
 			return err;
 		}
 		break;
@@ -4766,7 +4769,7 @@ static int ieee80211_color_change_finalize(struct ieee80211_sub_if_data *sdata)
 
 	sdata->vif.bss_conf.color_change_active = false;
 
-	err = ieee80211_set_after_color_change_beacon(sdata, &changed);
+	err = ieee80211_set_after_color_change_beacon(&sdata->deflink, &changed);
 	if (err) {
 		cfg80211_color_change_aborted_notify(sdata->dev, 0);
 		return err;
@@ -4866,7 +4869,7 @@ ieee80211_color_change(struct wiphy *wiphy, struct net_device *dev,
 		goto out;
 	}
 
-	err = ieee80211_set_color_change_beacon(sdata, params, &changed);
+	err = ieee80211_set_color_change_beacon(&sdata->deflink, params, &changed);
 	if (err)
 		goto out;
 
-- 
2.25.1


  parent reply	other threads:[~2024-04-16  5:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  4:59 [PATCH 0/7] wifi: cfg80211/mac80211: add support for HE BSS color handling with Multi-Link Operation Aditya Kumar Singh
2024-04-16  4:59 ` [PATCH 1/7] wifi: cfg80211: send link id in color_change ops Aditya Kumar Singh
2024-04-16  4:59 ` [PATCH 2/7] wifi: cfg80211: notify link ID in bss_color_notify Aditya Kumar Singh
2024-04-16  4:59 ` Aditya Kumar Singh [this message]
2024-04-16  4:59 ` [PATCH 4/7] wifi: mac80211: handle color_change_abort and bss_config_notify on per link Aditya Kumar Singh
2024-04-16  4:59 ` [PATCH 5/7] wifi: mac80211: start and finalize color change on link basis Aditya Kumar Singh
2024-04-16  4:59 ` [PATCH 6/7] wifi: mac80211: add support to call color_change and OBSS collision on a link Aditya Kumar Singh
2024-04-16  4:59 ` [PATCH 7/7] wifi: mac80211_hwsim: add support for BSS color Aditya Kumar Singh
2024-04-22  8:15   ` Johannes Berg
2024-04-22  8:48     ` Aditya Kumar Singh
2024-04-22 12:46       ` Aditya Kumar Singh
2024-04-19  9:12 ` [PATCH 0/7] wifi: cfg80211/mac80211: add support for HE BSS color handling with Multi-Link Operation Johannes Berg
2024-04-22  4:58   ` Aditya Kumar Singh
2024-04-23 18:37   ` Jeff Johnson

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=20240416045943.576656-4-quic_adisi@quicinc.com \
    --to=quic_adisi@quicinc.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 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).