From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: johannes@sipsolutions.net
Cc: linux@eikelenboom.it, linux-wireless@vger.kernel.org,
"Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Subject: [PATCH 3/3] cfg80211: processing regulatory requests on netdev notifier
Date: Thu, 19 Dec 2013 12:53:19 -0800 [thread overview]
Message-ID: <1387486399-4053-4-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1387486399-4053-1-git-send-email-mcgrof@do-not-panic.com>
This adds a trigger to review any pending regulatory
requests whenever an 802.11 device interface is brought
down or up. We use this as an opportunistic trigger
for checking the regulatory work queues as otherwise
they they're only checked upon an initial regulatory
request or when beacon hints are found.
This opportunistic mechanism can be used to trigger
kicking the queues regulatory queues at any time from
userspace without having to change the regulatory state.
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
net/wireless/core.c | 2 ++
net/wireless/reg.c | 5 +++++
net/wireless/reg.h | 1 +
3 files changed, 8 insertions(+)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index d89dee2..bc0f518 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -812,6 +812,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
SET_NETDEV_DEVTYPE(dev, &wiphy_type);
break;
case NETDEV_REGISTER:
+ reg_process_pending_work();
/*
* NB: cannot take rdev->mtx here because this may be
* called within code protected by it when interfaces
@@ -871,6 +872,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
wake_up(&rdev->dev_wait);
break;
case NETDEV_UP:
+ reg_process_pending_work();
cfg80211_update_iface_num(rdev, wdev->iftype, 1);
wdev_lock(wdev);
switch (wdev->iftype) {
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index ecf364e..1a049b3 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -196,6 +196,11 @@ static DECLARE_WORK(reg_work, reg_todo);
static void reg_timeout_work(struct work_struct *work);
static DECLARE_DELAYED_WORK(reg_timeout, reg_timeout_work);
+void reg_process_pending_work(void)
+{
+ schedule_work(®_work);
+}
+
/* We keep a static world regulatory domain in case of the absence of CRDA */
static const struct ieee80211_regdomain world_regdom = {
.n_reg_rules = 6,
diff --git a/net/wireless/reg.h b/net/wireless/reg.h
index 02bd8f4..063fb7a 100644
--- a/net/wireless/reg.h
+++ b/net/wireless/reg.h
@@ -36,6 +36,7 @@ void regulatory_exit(void);
int set_regdom(const struct ieee80211_regdomain *rd);
bool reg_last_request_cell_base(void);
+void reg_process_pending_work(void);
/**
* regulatory_hint_found_beacon - hints a beacon was found on a channel
--
1.8.4.3
next prev parent reply other threads:[~2013-12-19 20:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-19 20:53 [PATCH 0/3] cfg80211: process pending regulatory requests Luis R. Rodriguez
2013-12-19 20:53 ` [PATCH 1/3] cfg80211: allow reprocessing of pending requests Luis R. Rodriguez
2014-01-07 15:34 ` Johannes Berg
2014-01-23 13:16 ` Sander Eikelenboom
2014-01-24 23:14 ` Luis R. Rodriguez
2014-01-27 10:48 ` Sander Eikelenboom
2014-02-19 0:51 ` Luis R. Rodriguez
2013-12-19 20:53 ` [PATCH 2/3] cfg80211: fix processing world regdomain when non modular Luis R. Rodriguez
2014-01-07 15:35 ` Johannes Berg
2014-02-19 1:10 ` Luis R. Rodriguez
2013-12-19 20:53 ` Luis R. Rodriguez [this message]
2014-01-07 15:35 ` [PATCH 3/3] cfg80211: processing regulatory requests on netdev notifier Johannes Berg
2014-02-19 1:24 ` Luis R. Rodriguez
2014-02-19 18:08 ` Luis R. Rodriguez
2013-12-20 12:19 ` [PATCH 0/3] cfg80211: process pending regulatory requests Sander Eikelenboom
2014-01-06 13:10 ` Sander Eikelenboom
2014-01-06 13:32 ` Johannes Berg
-- strict thread matches above, loose matches on Subject: below --
2014-02-26 1:09 [PATCH v2 0/3] cfg80211: respin reprocessing pending requests Luis R. Rodriguez
2014-02-26 1:09 ` [PATCH 3/3] cfg80211: processing regulatory requests on netdev notifier Luis R. Rodriguez
2014-02-27 13:21 ` Arik Nemtsov
2014-02-27 17:20 ` Luis R. Rodriguez
2014-02-27 20:31 ` Arik Nemtsov
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=1387486399-4053-4-git-send-email-mcgrof@do-not-panic.com \
--to=mcgrof@do-not-panic.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linux@eikelenboom.it \
/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).