Return-path: Received: from ms-smtp-01.rdc-kc.rr.com ([24.94.166.115]:50587 "EHLO ms-smtp-01.rdc-kc.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754270AbXDUE0S (ORCPT ); Sat, 21 Apr 2007 00:26:18 -0400 Date: Fri, 20 Apr 2007 23:25:40 -0500 From: Larry Finger To: John Linville Cc: Bcm43xx-dev@lists.berlios.de, linux-wireless@vger.kernel.org Subject: [PATCH V2] ieee80211: Output frequency rather than channel in scan results Message-ID: <46299244.Q+HmhPpbYVGidoy1%Larry.Finger@lwfinger.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-wireless-owner@vger.kernel.org List-ID: 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 --- 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)