From: Aloka Dixit <alokad@codeaurora.org>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Aloka Dixit <alokad@codeaurora.org>
Subject: [PATCH 2/2] mac80211: Commands for FILS discovery and unsolicited broadcast probe response
Date: Tue, 19 Jan 2021 16:52:29 -0800 [thread overview]
Message-ID: <20210120005229.32582-3-alokad@codeaurora.org> (raw)
In-Reply-To: <20210120005229.32582-1-alokad@codeaurora.org>
This patch registers ieee80211_set_fils_discovery() and
ieee80211_set_unsol_bcast_probe_resp() as callback functions with
mac80211_config_ops() to be used for configuring FILS discovery
transmission.
Changes also include new calls to ieee80211_bss_info_change_notify()
which were not needed earlier as configurations were completed through
ieee80211_start_ap().
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
---
net/mac80211/cfg.c | 33 ++++++++++++---------------------
1 file changed, 12 insertions(+), 21 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index c4c70e30ad7f..27c97fd88e76 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -839,11 +839,13 @@ static int ieee80211_set_probe_resp(struct ieee80211_sub_if_data *sdata,
return 0;
}
-static int ieee80211_set_fils_discovery(struct ieee80211_sub_if_data *sdata,
+static int ieee80211_set_fils_discovery(struct wiphy *wiphy,
+ struct net_device *dev,
struct cfg80211_fils_discovery *params)
{
struct fils_discovery_data *new, *old = NULL;
struct ieee80211_fils_discovery *fd;
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
if (!params->tmpl || !params->tmpl_len)
return -EINVAL;
@@ -863,18 +865,23 @@ static int ieee80211_set_fils_discovery(struct ieee80211_sub_if_data *sdata,
if (old)
kfree_rcu(old, rcu_head);
+ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_FILS_DISCOVERY);
return 0;
}
static int
-ieee80211_set_unsol_bcast_probe_resp(struct ieee80211_sub_if_data *sdata,
+ieee80211_set_unsol_bcast_probe_resp(struct wiphy *wiphy,
+ struct net_device *dev,
struct cfg80211_unsol_bcast_probe_resp *params)
{
struct unsol_bcast_probe_resp_data *new, *old = NULL;
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
if (!params->tmpl || !params->tmpl_len)
return -EINVAL;
+ sdata->vif.bss_conf.unsol_bcast_probe_resp_interval = params->interval;
+
old = sdata_dereference(sdata->u.ap.unsol_bcast_probe_resp, sdata);
new = kzalloc(sizeof(*new) + params->tmpl_len, GFP_KERNEL);
if (!new)
@@ -886,9 +893,7 @@ ieee80211_set_unsol_bcast_probe_resp(struct ieee80211_sub_if_data *sdata,
if (old)
kfree_rcu(old, rcu_head);
- sdata->vif.bss_conf.unsol_bcast_probe_resp_interval =
- params->interval;
-
+ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_UNSOL_BCAST_PROBE_RESP);
return 0;
}
@@ -1161,22 +1166,6 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
goto error;
changed |= err;
- if (params->fils_discovery.max_interval) {
- err = ieee80211_set_fils_discovery(sdata,
- ¶ms->fils_discovery);
- if (err < 0)
- goto error;
- changed |= BSS_CHANGED_FILS_DISCOVERY;
- }
-
- if (params->unsol_bcast_probe_resp.interval) {
- err = ieee80211_set_unsol_bcast_probe_resp(sdata,
- ¶ms->unsol_bcast_probe_resp);
- if (err < 0)
- goto error;
- changed |= BSS_CHANGED_UNSOL_BCAST_PROBE_RESP;
- }
-
err = drv_start_ap(sdata->local, sdata);
if (err) {
old = sdata_dereference(sdata->u.ap.beacon, sdata);
@@ -4187,4 +4176,6 @@ const struct cfg80211_ops mac80211_config_ops = {
.set_tid_config = ieee80211_set_tid_config,
.reset_tid_config = ieee80211_reset_tid_config,
.set_sar_specs = ieee80211_set_sar_specs,
+ .set_fils_discovery = ieee80211_set_fils_discovery,
+ .set_unsol_bcast_probe_resp = ieee80211_set_unsol_bcast_probe_resp,
};
--
2.25.0
prev parent reply other threads:[~2021-01-20 0:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 0:52 [PATCH 0/2] Commands for FILS discovery and unsolicited probe response Aloka Dixit
2021-01-20 0:52 ` [PATCH 1/2] nl80211: Commands for FILS discovery and unsolicited broadcast " Aloka Dixit
2021-01-20 10:10 ` Arend van Spriel
2021-01-25 21:52 ` Aloka Dixit
2021-02-12 9:33 ` Johannes Berg
2021-02-16 22:41 ` Aloka Dixit
2021-01-20 0:52 ` Aloka Dixit [this message]
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=20210120005229.32582-3-alokad@codeaurora.org \
--to=alokad@codeaurora.org \
--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).