* [PATCH] ieee80211: Output frequency rather than channel in scan results
@ 2007-04-21 4:07 Larry Finger
2007-04-21 4:12 ` Pavel Roskin
0 siblings, 1 reply; 6+ messages in thread
From: Larry Finger @ 2007-04-21 4:07 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
changes the output from channel to frequency.
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,12 +89,15 @@ static char *ieee80211_translate_scan(st
start = iwe_stream_add_event(start, stop, &iwe, IW_EV_UINT_LEN);
}
- /* Add frequency/channel */
+ /* Add 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;
+ 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;
iwe.u.freq.i = 0;
start = iwe_stream_add_event(start, stop, &iwe, IW_EV_FREQ_LEN);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ieee80211: Output frequency rather than channel in scan results
2007-04-21 4:07 [PATCH] ieee80211: Output frequency rather than channel in scan results Larry Finger
@ 2007-04-21 4:12 ` Pavel Roskin
2007-04-21 22:19 ` Dan Williams
0 siblings, 1 reply; 6+ messages in thread
From: Pavel Roskin @ 2007-04-21 4:12 UTC (permalink / raw)
To: Larry Finger; +Cc: John Linville, Bcm43xx-dev, linux-wireless
Quoting Larry Finger <Larry.Finger@lwfinger.net>:
> In ieee80211, the output of scan results lists channels rather than
> frequencies; however, NetworkManager needs frequency. This patch
> changes the output from channel to frequency.
The driver can report both, and I think it should. This would make the iwlist
output a bit longer, but kernel drivers shouldn't be written to make userspace
program generate pretty output.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ieee80211: Output frequency rather than channel in scan results
2007-04-21 4:12 ` Pavel Roskin
@ 2007-04-21 22:19 ` Dan Williams
2007-04-21 22:55 ` Larry Finger
0 siblings, 1 reply; 6+ messages in thread
From: Dan Williams @ 2007-04-21 22:19 UTC (permalink / raw)
To: Pavel Roskin; +Cc: Larry Finger, John Linville, Bcm43xx-dev, linux-wireless
On Sat, 2007-04-21 at 00:12 -0400, Pavel Roskin wrote:
> Quoting Larry Finger <Larry.Finger@lwfinger.net>:
>
> > In ieee80211, the output of scan results lists channels rather than
> > frequencies; however, NetworkManager needs frequency. This patch
> > changes the output from channel to frequency.
>
> The driver can report both, and I think it should. This would make the iwlist
> output a bit longer, but kernel drivers shouldn't be written to make userspace
> program generate pretty output.
I'm trying to remember why NM cares about frequency, and I think it's
for ad-hoc mode; but wpa_supplicant didn't historically support a
"channel" configuration parameter and so you can't create adhoc networks
with NM right now anyway... What's the failure mode?
Dan
> --
> Regards,
> Pavel Roskin
> -
> 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] 6+ messages in thread
* Re: [PATCH] ieee80211: Output frequency rather than channel in scan results
2007-04-21 22:19 ` Dan Williams
@ 2007-04-21 22:55 ` Larry Finger
2007-04-22 22:03 ` Dan Williams
0 siblings, 1 reply; 6+ messages in thread
From: Larry Finger @ 2007-04-21 22:55 UTC (permalink / raw)
To: Dan Williams; +Cc: Pavel Roskin, John Linville, Bcm43xx-dev, linux-wireless
Dan Williams wrote:
> On Sat, 2007-04-21 at 00:12 -0400, Pavel Roskin wrote:
>> Quoting Larry Finger <Larry.Finger@lwfinger.net>:
>>
>>> In ieee80211, the output of scan results lists channels rather than
>>> frequencies; however, NetworkManager needs frequency. This patch
>>> changes the output from channel to frequency.
>> The driver can report both, and I think it should. This would make the iwlist
>> output a bit longer, but kernel drivers shouldn't be written to make userspace
>> program generate pretty output.
>
> I'm trying to remember why NM cares about frequency, and I think it's
> for ad-hoc mode; but wpa_supplicant didn't historically support a
> "channel" configuration parameter and so you can't create adhoc networks
> with NM right now anyway... What's the failure mode?
In the KDE NM applet, the frequency is listed as 0.
Larry
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ieee80211: Output frequency rather than channel in scan results
2007-04-21 22:55 ` Larry Finger
@ 2007-04-22 22:03 ` Dan Williams
2007-04-22 22:24 ` Larry Finger
0 siblings, 1 reply; 6+ messages in thread
From: Dan Williams @ 2007-04-22 22:03 UTC (permalink / raw)
To: Larry Finger; +Cc: Pavel Roskin, John Linville, Bcm43xx-dev, linux-wireless
On Sat, 2007-04-21 at 17:55 -0500, Larry Finger wrote:
> Dan Williams wrote:
> > On Sat, 2007-04-21 at 00:12 -0400, Pavel Roskin wrote:
> >> Quoting Larry Finger <Larry.Finger@lwfinger.net>:
> >>
> >>> In ieee80211, the output of scan results lists channels rather than
> >>> frequencies; however, NetworkManager needs frequency. This patch
> >>> changes the output from channel to frequency.
> >> The driver can report both, and I think it should. This would make the iwlist
> >> output a bit longer, but kernel drivers shouldn't be written to make userspace
> >> program generate pretty output.
> >
> > I'm trying to remember why NM cares about frequency, and I think it's
> > for ad-hoc mode; but wpa_supplicant didn't historically support a
> > "channel" configuration parameter and so you can't create adhoc networks
> > with NM right now anyway... What's the failure mode?
>
> In the KDE NM applet, the frequency is listed as 0.
Haha. Ok. NM should be smarter about this and convert channels
returned by the driver into frequencies. In the end, I prefer
frequencies where at all possible, because channel numbers are _not_
unique (unless you use the the tuple of [standard, band, channel] where
standard is something like "802.11" or "802.16", band is "a" or "bg").
Dan
Dan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ieee80211: Output frequency rather than channel in scan results
2007-04-22 22:03 ` Dan Williams
@ 2007-04-22 22:24 ` Larry Finger
0 siblings, 0 replies; 6+ messages in thread
From: Larry Finger @ 2007-04-22 22:24 UTC (permalink / raw)
To: Dan Williams; +Cc: Pavel Roskin, John Linville, Bcm43xx-dev, linux-wireless
Dan Williams wrote:
>
> Haha. Ok. NM should be smarter about this and convert channels
> returned by the driver into frequencies. In the end, I prefer
> frequencies where at all possible, because channel numbers are _not_
> unique (unless you use the the tuple of [standard, band, channel] where
> standard is something like "802.11" or "802.16", band is "a" or "bg").
My current (but not yet accepted) patch for ieee80211 outputs both channel and frequency as does the
"soon to be submitted" one for mac80211. I agree that frequency is unique; however, I find it easier
to think in terms of channels. In addition, I only use the bg band and have no confusion. If both
are listed, everyone should be happy.
Larry
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-04-22 22:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-21 4:07 [PATCH] ieee80211: Output frequency rather than channel in scan results Larry Finger
2007-04-21 4:12 ` Pavel Roskin
2007-04-21 22:19 ` Dan Williams
2007-04-21 22:55 ` Larry Finger
2007-04-22 22:03 ` Dan Williams
2007-04-22 22:24 ` 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).