linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] ieee80211: Output frequency rather than channel in  scan results
@ 2007-04-21  4:25 Larry Finger
  2007-04-21 13:42 ` Joerg Mayer
  0 siblings, 1 reply; 4+ messages in thread
From: Larry Finger @ 2007-04-21  4:25 UTC (permalink / raw)
  To: John Linville; +Cc: Bcm43xx-dev, linux-wireless

In ieee80211, the output of scan results lists channels rather than
frequencies; however, NetworkManager needs frequency. This patch
adds the frequency to the output.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

Index: wireless-2.6/net/ieee80211/ieee80211_wx.c
===================================================================
--- wireless-2.6.orig/net/ieee80211/ieee80211_wx.c
+++ wireless-2.6/net/ieee80211/ieee80211_wx.c
@@ -89,15 +89,22 @@ static char *ieee80211_translate_scan(st
 		start = iwe_stream_add_event(start, stop, &iwe, IW_EV_UINT_LEN);
 	}
 
-	/* Add frequency/channel */
+	/* Add channel and frequency */
 	iwe.cmd = SIOCGIWFREQ;
-/*	iwe.u.freq.m = ieee80211_frequency(network->channel, network->mode);
-	iwe.u.freq.e = 3; */
 	iwe.u.freq.m = network->channel;
 	iwe.u.freq.e = 0;
 	iwe.u.freq.i = 0;
 	start = iwe_stream_add_event(start, stop, &iwe, IW_EV_FREQ_LEN);
 
+	if (network->channel < 15)
+		iwe.u.freq.m = 2407 + 5 * network->channel;
+	else
+		iwe.u.freq.m = 5000 + 5 * network->channel;
+	if (network->channel == 14)
+		iwe.u.freq.m = 2484;    /* special case for Japan */
+	iwe.u.freq.e = 6;
+	start = iwe_stream_add_event(start, stop, &iwe, IW_EV_FREQ_LEN);
+
 	/* Add encryption capability */
 	iwe.cmd = SIOCGIWENCODE;
 	if (network->capability & WLAN_CAPABILITY_PRIVACY)

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

end of thread, other threads:[~2007-04-21 20:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-21  4:25 [PATCH V2] ieee80211: Output frequency rather than channel in scan results Larry Finger
2007-04-21 13:42 ` Joerg Mayer
2007-04-21 13:54   ` Johannes Berg
2007-04-21 20:16     ` Larry Finger

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).