From: Bernhard Schmidt <bernhard.schmidt@saxnet.de>
To: linux-wireless@vger.kernel.org
Cc: lrodriguez@atheros.com, nbd@openwrt.org, dubowoj@neratec.com,
zefir.kurtisi@neratec.com, simon.wunderlich@saxnet.de
Subject: [PATCH 1/9] [mac80211] add method to access oper chan
Date: Mon, 28 Feb 2011 17:46:22 +0100 [thread overview]
Message-ID: <201102281746.23102.bernhard.schmidt@saxnet.de> (raw)
In-Reply-To: <201102281740.37036.bernhard.schmidt@saxnet.de>
I'm really not sure about this.. is there another/better way to
access the current channel last set on a wiphy?
Signed-off-by: Bernhard Schmidt <bernhard.schmidt@saxnet.de>
---
include/net/cfg80211.h | 2 ++
net/mac80211/cfg.c | 8 ++++++++
net/wireless/chan.c | 2 +-
3 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 679a049..8300699 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1121,6 +1121,7 @@ struct cfg80211_pmksa {
* doesn't verify much. Note, however, that the passed netdev may be
* %NULL as well if the user requested changing the channel for the
* device itself, or for a monitor interface.
+ * @get_channel: Get current channel for a given wireless interface.
*
* @scan: Request to do a scan. If returning zero, the scan request is given
* the driver, and will be valid until passed to cfg80211_scan_done().
@@ -1276,6 +1277,7 @@ struct cfg80211_ops {
int (*set_channel)(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type);
+ struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy);
int (*scan)(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_scan_request *request);
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 8b436c7..2a05b31 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1257,6 +1257,13 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
return 0;
}
+static struct ieee80211_channel *ieee80211_get_oper_channel(struct wiphy *wiphy)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+
+ return local->oper_channel;
+}
+
#ifdef CONFIG_PM
static int ieee80211_suspend(struct wiphy *wiphy)
{
@@ -2027,6 +2034,7 @@ struct cfg80211_ops mac80211_config_ops = {
.change_bss = ieee80211_change_bss,
.set_txq_params = ieee80211_set_txq_params,
.set_channel = ieee80211_set_channel,
+ .get_channel = ieee80211_get_oper_channel,
.suspend = ieee80211_suspend,
.resume = ieee80211_resume,
.scan = ieee80211_scan,
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 17cd0c0..4e63e67 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -93,7 +93,7 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
return -ENETDOWN;
}
- if (!rdev->ops->set_channel)
+ if (!rdev->ops->set_channel || !rdev->ops->get_channel)
return -EOPNOTSUPP;
chan = rdev_freq_to_chan(rdev, freq, channel_type);
--
1.7.2.3
next prev parent reply other threads:[~2011-02-28 16:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-28 16:40 [RFC 0/9 v2] DFS/radar state/userspace handling Bernhard Schmidt
2011-02-28 16:46 ` Bernhard Schmidt [this message]
2011-03-01 12:11 ` [PATCH 1/9] [mac80211] add method to access oper chan Johannes Berg
2011-02-28 16:47 ` [PATCH 2/9] [{mac|nl}80211] Add 2 new radar channel flags Bernhard Schmidt
2011-03-01 21:54 ` Luis R. Rodriguez
2011-03-02 8:25 ` Johannes Berg
2011-03-02 9:37 ` Bernhard Schmidt
2011-02-28 16:47 ` [PATCH 3/9] [mac80211] enable radar detection Bernhard Schmidt
2011-03-01 21:56 ` Luis R. Rodriguez
2011-02-28 16:48 ` [PATCH 4/9] [cfg80211] add preliminary radar processing code Bernhard Schmidt
2011-03-01 12:17 ` Johannes Berg
2011-03-01 21:58 ` Luis R. Rodriguez
2011-03-02 7:32 ` Bernhard Schmidt
2011-03-02 16:26 ` Luis R. Rodriguez
2011-02-28 16:49 ` [PATCH 5/9] [cfg80211] channel availability check (CAC) support Bernhard Schmidt
2011-02-28 16:49 ` [PATCH 6/9] [cfg80211] no operation list (NOL) support Bernhard Schmidt
2011-03-01 12:19 ` Johannes Berg
2011-02-28 16:50 ` [PATCH 7/9] [cfg80211] abide channel closing time Bernhard Schmidt
2011-02-28 16:51 ` [PATCH 8/9] [{cfg|nl}80211] announce flag changes to userspace Bernhard Schmidt
2011-02-28 16:51 ` [PATCH 9/9] [cfg80211] interference reporting Bernhard Schmidt
2011-03-01 12:28 ` [RFC 0/9 v2] DFS/radar state/userspace handling Johannes Berg
2011-03-01 13:07 ` Bernhard Schmidt
2011-03-01 13:15 ` Johannes Berg
2011-03-01 13:26 ` Bernhard Schmidt
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=201102281746.23102.bernhard.schmidt@saxnet.de \
--to=bernhard.schmidt@saxnet.de \
--cc=dubowoj@neratec.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lrodriguez@atheros.com \
--cc=nbd@openwrt.org \
--cc=simon.wunderlich@saxnet.de \
--cc=zefir.kurtisi@neratec.com \
/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).