public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] cfg80211: allow user space to query the operating frequency
@ 2010-01-17 20:44 Felix Fietkau
  2010-01-17 21:01 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Fietkau @ 2010-01-17 20:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, John W. Linville

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -75,6 +75,7 @@ struct cfg80211_registered_device {
 
 	/* current channel */
 	struct ieee80211_channel *channel;
+	enum nl80211_channel_type channel_type;
 
 	/* must be last because of the way we do wiphy_priv(),
 	 * and it should at least be aligned to NETDEV_ALIGN */
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -97,6 +97,7 @@ int rdev_set_freq(struct cfg80211_regist
 		return result;
 
 	rdev->channel = chan;
+	rdev->channel_type = channel_type;
 
 	return 0;
 }
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -881,6 +881,11 @@ static int nl80211_send_iface(struct sk_
 	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
 	NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name);
 	NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype);
+	if (rdev->channel) {
+		NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, rdev->channel->center_freq);
+		NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, rdev->channel_type);
+	}
+
 
 	NLA_PUT_U32(msg, NL80211_ATTR_GENERATION,
 		    rdev->devlist_generation ^

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] cfg80211: allow user space to query the operating frequency
  2010-01-17 20:44 [PATCH v2] cfg80211: allow user space to query the operating frequency Felix Fietkau
@ 2010-01-17 21:01 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2010-01-17 21:01 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, John W. Linville

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

On Sun, 2010-01-17 at 21:44 +0100, Felix Fietkau wrote:

> +	if (rdev->channel) {
> +		NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ,
> rdev->channel->center_freq);
> +		NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
> rdev->channel_type);
> +	}

This patch won't even work the way you want it to.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-17 21:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-17 20:44 [PATCH v2] cfg80211: allow user space to query the operating frequency Felix Fietkau
2010-01-17 21:01 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox