diff mbox series

[v7,3/3] mac80211: additional processing in ieee80211_change_beacon

Message ID 20221109214720.6097-4-quic_alokad@quicinc.com
State New
Headers show
Series Additional processing in NL80211_CMD_SET_BEACON | expand

Commit Message

Aloka Dixit Nov. 9, 2022, 9:47 p.m. UTC
Process FILS discovery and unsolicited broadcast probe response
transmission configurations in ieee80211_change_beacon().

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
 net/mac80211/cfg.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

Comments

Johannes Berg Jan. 18, 2023, 3:58 p.m. UTC | #1
On Wed, 2022-11-09 at 13:47 -0800, Aloka Dixit wrote:
> Process FILS discovery and unsolicited broadcast probe response
> transmission configurations in ieee80211_change_beacon().
> 
> Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
> ---
>  net/mac80211/cfg.c | 25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index feb54b5e6ebd..3e8e74d01dc9 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -1405,6 +1405,7 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
>  	struct cfg80211_beacon_data *beacon = &params->beacon;
>  	struct beacon_data *old;
>  	int err;
> +	u32 changed;
>  	struct ieee80211_bss_conf *link_conf;
>  
>  	sdata_assert_lock(sdata);
> @@ -1429,13 +1430,33 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
>  	if (err < 0)
>  		return err;
>  
> +	changed = err;
> +
> +	if (params->fils_discovery.max_interval) {
> +		err = ieee80211_set_fils_discovery(sdata,
> +						   &params->fils_discovery,
> +						   link, link_conf);
> +		if (err < 0)
> +			return err;
> +		changed |= BSS_CHANGED_FILS_DISCOVERY;


This (and the similar change for unsolicited probe responses) basically
let you turn it _on_ or _modify_ it, but should there be a way to
explicitly turn it *off* too?

That goes together with my previous comment - since before we didn't
even process this data, why would it suddenly get turned off? Nothing
would ever send BSS_CHANGED_FILS_DISCOVERY or
BSS_CHANGED_UNSOL_BCAST_PROBE_RESP to the driver to turn it off, no?

johannes
diff mbox series

Patch

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index feb54b5e6ebd..3e8e74d01dc9 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1405,6 +1405,7 @@  static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
 	struct cfg80211_beacon_data *beacon = &params->beacon;
 	struct beacon_data *old;
 	int err;
+	u32 changed;
 	struct ieee80211_bss_conf *link_conf;
 
 	sdata_assert_lock(sdata);
@@ -1429,13 +1430,33 @@  static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
 	if (err < 0)
 		return err;
 
+	changed = err;
+
+	if (params->fils_discovery.max_interval) {
+		err = ieee80211_set_fils_discovery(sdata,
+						   &params->fils_discovery,
+						   link, link_conf);
+		if (err < 0)
+			return err;
+		changed |= BSS_CHANGED_FILS_DISCOVERY;
+	}
+
+	if (params->unsol_bcast_probe_resp.interval) {
+		err = ieee80211_set_unsol_bcast_probe_resp(sdata,
+							   &params->unsol_bcast_probe_resp,
+							   link, link_conf);
+		if (err < 0)
+			return err;
+		changed |= BSS_CHANGED_UNSOL_BCAST_PROBE_RESP;
+	}
+
 	if (beacon->he_bss_color_valid &&
 	    beacon->he_bss_color.enabled != link_conf->he_bss_color.enabled) {
 		link_conf->he_bss_color.enabled = beacon->he_bss_color.enabled;
-		err |= BSS_CHANGED_HE_BSS_COLOR;
+		changed |= BSS_CHANGED_HE_BSS_COLOR;
 	}
 
-	ieee80211_link_info_change_notify(sdata, link, err);
+	ieee80211_link_info_change_notify(sdata, link, changed);
 	return 0;
 }