* [PATCH] mac80211/cfg80211: report monitor channel in wireless extensions
@ 2011-11-08 18:52 Johannes Berg
2011-11-08 18:56 ` Ben Greear
2011-11-08 19:01 ` [PATCH v2] " Johannes Berg
0 siblings, 2 replies; 8+ messages in thread
From: Johannes Berg @ 2011-11-08 18:52 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Just add API to get the channel & report it. Trivial really.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
I'm not sure why this is so hard that the aircrack people
couldn't figure out what to do ...
include/net/cfg80211.h | 5 +++++
net/mac80211/cfg.c | 8 ++++++++
net/wireless/wext-compat.c | 12 ++++++++++++
3 files changed, 25 insertions(+)
--- a/include/net/cfg80211.h 2011-11-08 19:37:45.000000000 +0100
+++ b/include/net/cfg80211.h 2011-11-08 19:49:33.000000000 +0100
@@ -1342,6 +1342,9 @@ struct cfg80211_gtk_rekey_data {
* 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 the current operating channel, should return %NULL if
+ * there's no signal defined operating channel if for example the
+ * device implements channel hopping for multi-channel virtual interfaces.
*
* @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().
@@ -1627,6 +1630,8 @@ struct cfg80211_ops {
int (*probe_client)(struct wiphy *wiphy, struct net_device *dev,
const u8 *peer, u64 *cookie);
+
+ struct ieee80211_channel *(get_channel)(struct wiphy *wiphy);
};
/*
--- a/net/wireless/wext-compat.c 2011-11-08 19:37:45.000000000 +0100
+++ b/net/wireless/wext-compat.c 2011-11-08 19:49:33.000000000 +0100
@@ -818,12 +818,24 @@ static int cfg80211_wext_giwfreq(struct
struct iw_freq *freq, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+ struct ieee80211_channel *chan;
switch (wdev->iftype) {
case NL80211_IFTYPE_STATION:
return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
case NL80211_IFTYPE_ADHOC:
return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
+ case NL80211_IFTYPE_MONITOR:
+ if (!rdev->ops->get_channel)
+ return -EINVAL;
+
+ chan = rdev->ops->get_channel(wdev->wiphy);
+ if (!chan)
+ return -EINVAL;
+ freq->m = chan->center_freq;
+ freq->e = 6;
+ return 0;
default:
if (!wdev->channel)
return -EINVAL;
--- a/net/mac80211/cfg.c 2011-11-08 19:37:45.000000000 +0100
+++ b/net/mac80211/cfg.c 2011-11-08 19:49:33.000000000 +0100
@@ -2579,6 +2579,13 @@ static int ieee80211_probe_client(struct
return 0;
}
+static const struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+
+ return local->oper_channel;
+}
+
struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -2645,4 +2652,5 @@ struct cfg80211_ops mac80211_config_ops
.tdls_oper = ieee80211_tdls_oper,
.tdls_mgmt = ieee80211_tdls_mgmt,
.probe_client = ieee80211_probe_client,
+ .get_channel = ieee80211_get_channel,
};
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mac80211/cfg80211: report monitor channel in wireless extensions
2011-11-08 18:52 [PATCH] mac80211/cfg80211: report monitor channel in wireless extensions Johannes Berg
@ 2011-11-08 18:56 ` Ben Greear
2011-11-08 19:00 ` Johannes Berg
2011-11-08 19:01 ` [PATCH v2] " Johannes Berg
1 sibling, 1 reply; 8+ messages in thread
From: Ben Greear @ 2011-11-08 18:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
On 11/08/2011 10:52 AM, Johannes Berg wrote:
> From: Johannes Berg<johannes.berg@intel.com>
>
> Just add API to get the channel& report it. Trivial really.
>
> Signed-off-by: Johannes Berg<johannes.berg@intel.com>
> ---
> I'm not sure why this is so hard that the aircrack people
> couldn't figure out what to do ...
>
> include/net/cfg80211.h | 5 +++++
> net/mac80211/cfg.c | 8 ++++++++
> net/wireless/wext-compat.c | 12 ++++++++++++
> 3 files changed, 25 insertions(+)
>
> --- a/include/net/cfg80211.h 2011-11-08 19:37:45.000000000 +0100
> +++ b/include/net/cfg80211.h 2011-11-08 19:49:33.000000000 +0100
> @@ -1342,6 +1342,9 @@ struct cfg80211_gtk_rekey_data {
> * 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 the current operating channel, should return %NULL if
> + * there's no signal defined operating channel if for example the
Do you mean "no single defined" ?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mac80211/cfg80211: report monitor channel in wireless extensions
2011-11-08 18:56 ` Ben Greear
@ 2011-11-08 19:00 ` Johannes Berg
0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2011-11-08 19:00 UTC (permalink / raw)
To: Ben Greear; +Cc: John Linville, linux-wireless
On Tue, 2011-11-08 at 10:56 -0800, Ben Greear wrote:
> On 11/08/2011 10:52 AM, Johannes Berg wrote:
> > +++ b/include/net/cfg80211.h 2011-11-08 19:49:33.000000000 +0100
> > @@ -1342,6 +1342,9 @@ struct cfg80211_gtk_rekey_data {
> > * 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 the current operating channel, should return %NULL if
> > + * there's no signal defined operating channel if for example the
>
> Do you mean "no single defined" ?
Err, yes, thanks. Fingers faster than brain.
johannes
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] mac80211/cfg80211: report monitor channel in wireless extensions
2011-11-08 18:52 [PATCH] mac80211/cfg80211: report monitor channel in wireless extensions Johannes Berg
2011-11-08 18:56 ` Ben Greear
@ 2011-11-08 19:01 ` Johannes Berg
2011-11-09 9:30 ` [PATCH v3] " Johannes Berg
1 sibling, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2011-11-08 19:01 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Just add API to get the channel & report it. Trivial really.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
v2: fix signal -> single (thanks Ben)
I'm not sure why this is so hard that the aircrack people
couldn't figure out what to do ...
include/net/cfg80211.h | 5 +++++
net/mac80211/cfg.c | 8 ++++++++
net/wireless/wext-compat.c | 12 ++++++++++++
3 files changed, 25 insertions(+)
--- a/include/net/cfg80211.h 2011-11-08 19:37:45.000000000 +0100
+++ b/include/net/cfg80211.h 2011-11-08 20:00:42.000000000 +0100
@@ -1342,6 +1342,9 @@ struct cfg80211_gtk_rekey_data {
* 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 the current operating channel, should return %NULL if
+ * there's no single defined operating channel if for example the
+ * device implements channel hopping for multi-channel virtual interfaces.
*
* @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().
@@ -1627,6 +1630,8 @@ struct cfg80211_ops {
int (*probe_client)(struct wiphy *wiphy, struct net_device *dev,
const u8 *peer, u64 *cookie);
+
+ struct ieee80211_channel *(get_channel)(struct wiphy *wiphy);
};
/*
--- a/net/wireless/wext-compat.c 2011-11-08 19:37:45.000000000 +0100
+++ b/net/wireless/wext-compat.c 2011-11-08 19:49:33.000000000 +0100
@@ -818,12 +818,24 @@ static int cfg80211_wext_giwfreq(struct
struct iw_freq *freq, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+ struct ieee80211_channel *chan;
switch (wdev->iftype) {
case NL80211_IFTYPE_STATION:
return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
case NL80211_IFTYPE_ADHOC:
return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
+ case NL80211_IFTYPE_MONITOR:
+ if (!rdev->ops->get_channel)
+ return -EINVAL;
+
+ chan = rdev->ops->get_channel(wdev->wiphy);
+ if (!chan)
+ return -EINVAL;
+ freq->m = chan->center_freq;
+ freq->e = 6;
+ return 0;
default:
if (!wdev->channel)
return -EINVAL;
--- a/net/mac80211/cfg.c 2011-11-08 19:37:45.000000000 +0100
+++ b/net/mac80211/cfg.c 2011-11-08 19:49:33.000000000 +0100
@@ -2579,6 +2579,13 @@ static int ieee80211_probe_client(struct
return 0;
}
+static const struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+
+ return local->oper_channel;
+}
+
struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -2645,4 +2652,5 @@ struct cfg80211_ops mac80211_config_ops
.tdls_oper = ieee80211_tdls_oper,
.tdls_mgmt = ieee80211_tdls_mgmt,
.probe_client = ieee80211_probe_client,
+ .get_channel = ieee80211_get_channel,
};
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3] mac80211/cfg80211: report monitor channel in wireless extensions
2011-11-08 19:01 ` [PATCH v2] " Johannes Berg
@ 2011-11-09 9:30 ` Johannes Berg
2011-11-10 9:28 ` Gábor Stefanik
2012-12-22 4:32 ` Richard Farina
0 siblings, 2 replies; 8+ messages in thread
From: Johannes Berg @ 2011-11-09 9:30 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Just add API to get the channel & report it. Trivial really.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
So trivial it didn't even work ;-)
include/net/cfg80211.h | 5 +++++
net/mac80211/cfg.c | 9 +++++++++
net/wireless/wext-compat.c | 12 ++++++++++++
3 files changed, 26 insertions(+)
--- a/include/net/cfg80211.h 2011-11-09 10:13:05.000000000 +0100
+++ b/include/net/cfg80211.h 2011-11-09 10:27:47.000000000 +0100
@@ -1342,6 +1342,9 @@ struct cfg80211_gtk_rekey_data {
* 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 the current operating channel, should return %NULL if
+ * there's no single defined operating channel if for example the
+ * device implements channel hopping for multi-channel virtual interfaces.
*
* @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().
@@ -1627,6 +1630,8 @@ struct cfg80211_ops {
int (*probe_client)(struct wiphy *wiphy, struct net_device *dev,
const u8 *peer, u64 *cookie);
+
+ struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy);
};
/*
--- a/net/wireless/wext-compat.c 2011-11-09 10:07:35.000000000 +0100
+++ b/net/wireless/wext-compat.c 2011-11-09 10:13:18.000000000 +0100
@@ -819,12 +819,24 @@ static int cfg80211_wext_giwfreq(struct
struct iw_freq *freq, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+ struct ieee80211_channel *chan;
switch (wdev->iftype) {
case NL80211_IFTYPE_STATION:
return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
case NL80211_IFTYPE_ADHOC:
return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
+ case NL80211_IFTYPE_MONITOR:
+ if (!rdev->ops->get_channel)
+ return -EINVAL;
+
+ chan = rdev->ops->get_channel(wdev->wiphy);
+ if (!chan)
+ return -EINVAL;
+ freq->m = chan->center_freq;
+ freq->e = 6;
+ return 0;
default:
if (!wdev->channel)
return -EINVAL;
--- a/net/mac80211/cfg.c 2011-11-09 10:10:56.000000000 +0100
+++ b/net/mac80211/cfg.c 2011-11-09 10:29:40.000000000 +0100
@@ -2579,6 +2579,14 @@ static int ieee80211_probe_client(struct
return 0;
}
+static struct ieee80211_channel *
+ieee80211_wiphy_get_channel(struct wiphy *wiphy)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+
+ return local->oper_channel;
+}
+
struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -2645,4 +2653,5 @@ struct cfg80211_ops mac80211_config_ops
.tdls_oper = ieee80211_tdls_oper,
.tdls_mgmt = ieee80211_tdls_mgmt,
.probe_client = ieee80211_probe_client,
+ .get_channel = ieee80211_wiphy_get_channel,
};
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3] mac80211/cfg80211: report monitor channel in wireless extensions
2011-11-09 9:30 ` [PATCH v3] " Johannes Berg
@ 2011-11-10 9:28 ` Gábor Stefanik
2011-11-10 9:32 ` Johannes Berg
2012-12-22 4:32 ` Richard Farina
1 sibling, 1 reply; 8+ messages in thread
From: Gábor Stefanik @ 2011-11-10 9:28 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
On Wed, Nov 9, 2011 at 10:30 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Just add API to get the channel & report it. Trivial really.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> So trivial it didn't even work ;-)
>
> include/net/cfg80211.h | 5 +++++
> net/mac80211/cfg.c | 9 +++++++++
> net/wireless/wext-compat.c | 12 ++++++++++++
> 3 files changed, 26 insertions(+)
>
> --- a/include/net/cfg80211.h 2011-11-09 10:13:05.000000000 +0100
> +++ b/include/net/cfg80211.h 2011-11-09 10:27:47.000000000 +0100
> @@ -1342,6 +1342,9 @@ struct cfg80211_gtk_rekey_data {
> * 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 the current operating channel, should return %NULL if
> + * there's no single defined operating channel if for example the
> + * device implements channel hopping for multi-channel virtual interfaces.
Why not return the the channel the radio is tuned to at the moment of
the request in that case?
> *
> * @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().
> @@ -1627,6 +1630,8 @@ struct cfg80211_ops {
>
> int (*probe_client)(struct wiphy *wiphy, struct net_device *dev,
> const u8 *peer, u64 *cookie);
> +
> + struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy);
> };
>
> /*
> --- a/net/wireless/wext-compat.c 2011-11-09 10:07:35.000000000 +0100
> +++ b/net/wireless/wext-compat.c 2011-11-09 10:13:18.000000000 +0100
> @@ -819,12 +819,24 @@ static int cfg80211_wext_giwfreq(struct
> struct iw_freq *freq, char *extra)
> {
> struct wireless_dev *wdev = dev->ieee80211_ptr;
> + struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
> + struct ieee80211_channel *chan;
>
> switch (wdev->iftype) {
> case NL80211_IFTYPE_STATION:
> return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
> case NL80211_IFTYPE_ADHOC:
> return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
> + case NL80211_IFTYPE_MONITOR:
> + if (!rdev->ops->get_channel)
> + return -EINVAL;
> +
> + chan = rdev->ops->get_channel(wdev->wiphy);
> + if (!chan)
> + return -EINVAL;
> + freq->m = chan->center_freq;
> + freq->e = 6;
> + return 0;
> default:
> if (!wdev->channel)
> return -EINVAL;
> --- a/net/mac80211/cfg.c 2011-11-09 10:10:56.000000000 +0100
> +++ b/net/mac80211/cfg.c 2011-11-09 10:29:40.000000000 +0100
> @@ -2579,6 +2579,14 @@ static int ieee80211_probe_client(struct
> return 0;
> }
>
> +static struct ieee80211_channel *
> +ieee80211_wiphy_get_channel(struct wiphy *wiphy)
> +{
> + struct ieee80211_local *local = wiphy_priv(wiphy);
> +
> + return local->oper_channel;
> +}
> +
> struct cfg80211_ops mac80211_config_ops = {
> .add_virtual_intf = ieee80211_add_iface,
> .del_virtual_intf = ieee80211_del_iface,
> @@ -2645,4 +2653,5 @@ struct cfg80211_ops mac80211_config_ops
> .tdls_oper = ieee80211_tdls_oper,
> .tdls_mgmt = ieee80211_tdls_mgmt,
> .probe_client = ieee80211_probe_client,
> + .get_channel = ieee80211_wiphy_get_channel,
> };
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3] mac80211/cfg80211: report monitor channel in wireless extensions
2011-11-10 9:28 ` Gábor Stefanik
@ 2011-11-10 9:32 ` Johannes Berg
0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2011-11-10 9:32 UTC (permalink / raw)
To: Gábor Stefanik; +Cc: John Linville, linux-wireless
On Thu, 2011-11-10 at 10:28 +0100, Gábor Stefanik wrote:
> > @@ -1342,6 +1342,9 @@ struct cfg80211_gtk_rekey_data {
> > * 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 the current operating channel, should return %NULL if
> > + * there's no single defined operating channel if for example the
> > + * device implements channel hopping for multi-channel virtual interfaces.
>
> Why not return the the channel the radio is tuned to at the moment of
> the request in that case?
Mostly, you won't even know. In many cases the device will switch
internally. And even if you could know, since it's switching many times
per second it'll be completely useless.
Frankly, I think this whole thing is completely useless. IMNSHO aircrack
or whatever tool uses this is brain-dead since radiotap reports the
correct frequency for each frame *anyway*.
johannes
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3] mac80211/cfg80211: report monitor channel in wireless extensions
2011-11-09 9:30 ` [PATCH v3] " Johannes Berg
2011-11-10 9:28 ` Gábor Stefanik
@ 2012-12-22 4:32 ` Richard Farina
1 sibling, 0 replies; 8+ messages in thread
From: Richard Farina @ 2012-12-22 4:32 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On 11/09/2011 04:30 AM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
Johannes,
This patch has been great for us since it was added in 3.3_rc1, however,
it looks like there was some rewrite in 3.7_rc1 and this is no longer
functional. I'm not really the guy that understands the code, but I'm
hoping you will have mercy on us again and maybe take a look? :-)
Thanks,
Zero
>
> Just add API to get the channel & report it. Trivial really.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> So trivial it didn't even work ;-)
>
> include/net/cfg80211.h | 5 +++++
> net/mac80211/cfg.c | 9 +++++++++
> net/wireless/wext-compat.c | 12 ++++++++++++
> 3 files changed, 26 insertions(+)
>
> --- a/include/net/cfg80211.h 2011-11-09 10:13:05.000000000 +0100
> +++ b/include/net/cfg80211.h 2011-11-09 10:27:47.000000000 +0100
> @@ -1342,6 +1342,9 @@ struct cfg80211_gtk_rekey_data {
> * 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 the current operating channel, should return %NULL if
> + * there's no single defined operating channel if for example the
> + * device implements channel hopping for multi-channel virtual interfaces.
> *
> * @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().
> @@ -1627,6 +1630,8 @@ struct cfg80211_ops {
>
> int (*probe_client)(struct wiphy *wiphy, struct net_device *dev,
> const u8 *peer, u64 *cookie);
> +
> + struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy);
> };
>
> /*
> --- a/net/wireless/wext-compat.c 2011-11-09 10:07:35.000000000 +0100
> +++ b/net/wireless/wext-compat.c 2011-11-09 10:13:18.000000000 +0100
> @@ -819,12 +819,24 @@ static int cfg80211_wext_giwfreq(struct
> struct iw_freq *freq, char *extra)
> {
> struct wireless_dev *wdev = dev->ieee80211_ptr;
> + struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
> + struct ieee80211_channel *chan;
>
> switch (wdev->iftype) {
> case NL80211_IFTYPE_STATION:
> return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
> case NL80211_IFTYPE_ADHOC:
> return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
> + case NL80211_IFTYPE_MONITOR:
> + if (!rdev->ops->get_channel)
> + return -EINVAL;
> +
> + chan = rdev->ops->get_channel(wdev->wiphy);
> + if (!chan)
> + return -EINVAL;
> + freq->m = chan->center_freq;
> + freq->e = 6;
> + return 0;
> default:
> if (!wdev->channel)
> return -EINVAL;
> --- a/net/mac80211/cfg.c 2011-11-09 10:10:56.000000000 +0100
> +++ b/net/mac80211/cfg.c 2011-11-09 10:29:40.000000000 +0100
> @@ -2579,6 +2579,14 @@ static int ieee80211_probe_client(struct
> return 0;
> }
>
> +static struct ieee80211_channel *
> +ieee80211_wiphy_get_channel(struct wiphy *wiphy)
> +{
> + struct ieee80211_local *local = wiphy_priv(wiphy);
> +
> + return local->oper_channel;
> +}
> +
> struct cfg80211_ops mac80211_config_ops = {
> .add_virtual_intf = ieee80211_add_iface,
> .del_virtual_intf = ieee80211_del_iface,
> @@ -2645,4 +2653,5 @@ struct cfg80211_ops mac80211_config_ops
> .tdls_oper = ieee80211_tdls_oper,
> .tdls_mgmt = ieee80211_tdls_mgmt,
> .probe_client = ieee80211_probe_client,
> + .get_channel = ieee80211_wiphy_get_channel,
> };
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-12-22 4:40 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 18:52 [PATCH] mac80211/cfg80211: report monitor channel in wireless extensions Johannes Berg
2011-11-08 18:56 ` Ben Greear
2011-11-08 19:00 ` Johannes Berg
2011-11-08 19:01 ` [PATCH v2] " Johannes Berg
2011-11-09 9:30 ` [PATCH v3] " Johannes Berg
2011-11-10 9:28 ` Gábor Stefanik
2011-11-10 9:32 ` Johannes Berg
2012-12-22 4:32 ` Richard Farina
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).