Skip to contentSkip to conversation

SoftMAC : fix duplicate display of channel in scan

PATCH In review Jean Tourrilhes 4 participants 7 messages Jul 10, 2007 – Jul 12, 2007 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SoftMAC : fix duplicate display of channel in scan

	Hi,

	SoftMAC output the channel twice in the scan output. It should
display frequency and channel, but only once for each.
--------------------------------------------------------
          Cell 02 - Address: A2:00:04:XX:XX:XX
                    ESSID:"TheESSID"
                    Protocol:IEEE 802.11b
                    Mode:Ad-Hoc
->                  Channel:5
->                  Frequency:2.432 GHz (Channel 5)
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Quality=95/100  Signal level=-47 dBm  Noise level=-65 dBm
                    Extra: Last beacon: 120ms ago

--------------------------------------------------------
The fix is simple, patch attached, tested for 2.6.22 with
bcm43xx. If you like it, send it to John.
Regards,

Jean

-----------------------------------------------------------

net/ieee80211/ieee80211_wx.c renamed from net/ieee80211/ieee80211_wx.j1.c +2 -5
@@ -90,14 +90,11 @@ static char *ieee80211_translate_scan(st
 	}
 
 	/* Add channel and frequency */
+	/* Note : userspace automatically computes channel using iwrange */
 	iwe.cmd = SIOCGIWFREQ;
-	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);
-
 	iwe.u.freq.m = ieee80211_channel_to_freq(ieee, network->channel);
 	iwe.u.freq.e = 6;
+	iwe.u.freq.i = 0;
 	start = iwe_stream_add_event(start, stop, &iwe, IW_EV_FREQ_LEN);
 
 	/* Add encryption capability */
#1 lore raw

Jean,

Quoted 11 lines · Jean Tourrilhes
	Hi,

	SoftMAC output the channel twice in the scan output. It should
display frequency and channel, but only once for each.
--------------------------------------------------------
          Cell 02 - Address: A2:00:04:XX:XX:XX
                    ESSID:"TheESSID"
                    Protocol:IEEE 802.11b
                    Mode:Ad-Hoc

-> Channel:5
-> Frequency:2.432 GHz (Channel 5)

The frequency output is needed by NetworkManager, which is why I added it. At that time, I thought that some tool or other might be scanning the output looking for "Channel:", not "Channel "; therefore I left both in. If we are sure that removing the channel-only line will not break something, I'll be happy to send your patch upstream.

Larry

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 15 lines · Larry Finger

Jean,

Quoted 11 lines · Jean Tourrilhes
	Hi,

	SoftMAC output the channel twice in the scan output. It should
display frequency and channel, but only once for each.
--------------------------------------------------------
         Cell 02 - Address: A2:00:04:XX:XX:XX
                   ESSID:"TheESSID"
                   Protocol:IEEE 802.11b
                   Mode:Ad-Hoc

-> Channel:5
-> Frequency:2.432 GHz (Channel 5)

Quoted 3 lines

The frequency output is needed by NetworkManager, which is why I added it. At that time, I thought that some tool or other might be scanning the output looking for "Channel:", not "Channel "; therefore I left both in.

All of the other drivers display only a single line, and
SoftMAC is the odd one here. I think that have the info twice may confuse some tools.
I know that there are scripts that parse iwlist output,
however I'm not keen on the practice, as there are alternatives.

Quoted 2 lines

If we are sure that removing the channel-only line will not break something, I'll be happy to send your patch upstream.

Unfortunately, I can't guarantee that. I can only guarantee
that it will be similar to what other drivers do.

Quoted 1 line

Larry

	Have fun...

	Jean
#4 lore raw
In reply to a message not in the archive
Quoted 15 lines · Larry Finger

Jean,

Quoted 11 lines · Jean Tourrilhes
	Hi,

	SoftMAC output the channel twice in the scan output. It should
display frequency and channel, but only once for each.
--------------------------------------------------------
          Cell 02 - Address: A2:00:04:XX:XX:XX
                    ESSID:"TheESSID"
                    Protocol:IEEE 802.11b
                    Mode:Ad-Hoc

-> Channel:5
-> Frequency:2.432 GHz (Channel 5)

Quoted 4 lines

The frequency output is needed by NetworkManager, which is why I added it. At that time, I thought that some tool or other might be scanning the output looking for "Channel:", not "Channel "; therefore I left both in. If we are sure that removing the channel-only line will not break something, I'll be happy to send your patch upstream.

Should fix NM, really, to deal with either channel or frequency and handle each as appropriate.

Dan

Quoted 6 lines

Larry

-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1184211018.9446.0.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]

#6 lore raw
Quoted 21 lines · Dan Williams
Quoted 15 lines · Larry Finger

Jean,

Quoted 11 lines · Jean Tourrilhes
	Hi,

	SoftMAC output the channel twice in the scan output. It should
display frequency and channel, but only once for each.
--------------------------------------------------------
          Cell 02 - Address: A2:00:04:XX:XX:XX
                    ESSID:"TheESSID"
                    Protocol:IEEE 802.11b
                    Mode:Ad-Hoc

-> Channel:5
-> Frequency:2.432 GHz (Channel 5)

Quoted 4 lines

The frequency output is needed by NetworkManager, which is why I added it. At that time, I thought that some tool or other might be scanning the output looking for "Channel:", not "Channel "; therefore I left both in. If we are sure that removing the channel-only line will not break something, I'll be happy to send your patch upstream.

Quoted 4 lines

Should fix NM, really, to deal with either channel or frequency and handle each as appropriate.

Dan

Well, I actually like forcing driver to use frequency, because
that's an absolute physical measure and contains more meaning.
Regards,

Jean

A message that is not in the archive (sent off-list or not yet received): 20070712163440.GA13445-yAE0UhLNZJawPNPzzlOzwdBPR1lH4CV8@public.gmane.org

#8 lore raw
Quoted 3 lines · Jean Tourrilhes

Well, I actually like forcing driver to use frequency, because
that's an absolute physical measure and contains more meaning.

Yes, but it is easier to keep a channel number in your head than a frequency.

Larry

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 7 lines · Larry Finger
Quoted 3 lines · Jean Tourrilhes

Well, I actually like forcing driver to use frequency, because
that's an absolute physical measure and contains more meaning.

Yes, but it is easier to keep a channel number in your head than a frequency.

That's why iwlist display both in 'iwlist freq' and 'iwlist scan'.

Quoted 1 line

Larry

Jean