Skip to contentSkip to conversation

mac80211: report operating frequency rather than current

PATCH In review Johannes Berg 6 participants 16 messages May 4, 2009 – May 5, 2009 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: report operating frequency rather than current

It's not very helpful to see, in iwconfig, the current frequency the card is tuned to if that frequency is currently somewhere across the board because we're scanning. Since we keep track of the frequency the user wants, display that instead.

---
 net/mac80211/wext.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/wext.c +1 -1
@@ -185,7 +185,7 @@ static int ieee80211_ioctl_giwfreq(struc
 	if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
 		return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
 
-	freq->m = local->hw.conf.channel->center_freq;
+	freq->m = local->oper_channel->center_freq;
 	freq->e = 6;
 
 	return 0;
#1 lore raw
Quoted 16 lines · Johannes Berg

It's not very helpful to see, in iwconfig, the current frequency the card is tuned to if that frequency is currently somewhere across the board because we're scanning. Since we keep track of the frequency the user wants, display that instead.

---
 net/mac80211/wext.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

net/mac80211/wext.c static int ieee80211_ioctl_giwfreq(struc · line 191

Quoted 8 lines
net/mac80211/wext.c +1 -1
@@ -185,7 +185,7 @@ static int ieee80211_ioctl_giwfreq(struc
 	if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
 		return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
 
-	freq->m = local->hw.conf.channel->center_freq;
+	freq->m = local->oper_channel->center_freq;
 	freq->e = 6;
 
 	return 0;

Nack. People should see the hardware channel. If I set channel 6 and my wifi card is on channel 11 I need to see 11 not 6. Doesn't make any sense to show some imaginary idealistic "I wish it was on channel 6" when the hardware is on channel 11. Am I missing something here?

Thanks,
Rick Farina

Quoted 6 lines

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

author maintainer
#2 lore raw
Quoted 21 lines · Richard Farina
Quoted 20 lines · Johannes Berg

It's not very helpful to see, in iwconfig, the current frequency the card is tuned to if that frequency is currently somewhere across the board because we're scanning. Since we keep track of the frequency the user wants, display that instead.

---
 net/mac80211/wext.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/wext.c +1 -1
@@ -185,7 +185,7 @@ static int ieee80211_ioctl_giwfreq(struc
 	if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
 		return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
 
-	freq->m = local->hw.conf.channel->center_freq;
+	freq->m = local->oper_channel->center_freq;
 	freq->e = 6;
 
Quoted 8 lines

net/mac80211/wext.c static int ieee80211_ioctl_giwfreq(struc · line 191

Quoted 4 lines
net/mac80211/wext.c +0 -0
 	return 0;

Nack. People should see the hardware channel. If I set channel 6 and my wifi card is on channel 11 I need to see 11 not 6. Doesn't make any sense to show some imaginary idealistic "I wish it was on channel 6" when the hardware is on channel 11. Am I missing something here?

Umm, if _you_ set channel 11 then you _will_ see channel 11. It's just that when it's scanning and happens to be on channel 132 instead of 11, while you previously set 11, you will _after_ this patch see 11, not 132.

johannes

#3 lore raw
Quoted 32 lines · Johannes Berg
Quoted 22 lines · Richard Farina
Quoted 20 lines · Johannes Berg

It's not very helpful to see, in iwconfig, the current frequency the card is tuned to if that frequency is currently somewhere across the board because we're scanning. Since we keep track of the frequency the user wants, display that instead.

---
 net/mac80211/wext.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/wext.c +1 -1
@@ -185,7 +185,7 @@ static int ieee80211_ioctl_giwfreq(struc
 	if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
 		return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
 
-	freq->m = local->hw.conf.channel->center_freq;
+	freq->m = local->oper_channel->center_freq;
 	freq->e = 6;
 
Quoted 7 lines

net/mac80211/wext.c static int ieee80211_ioctl_giwfreq(struc · line 191

Quoted 5 lines
net/mac80211/wext.c +0 -0
 	return 0;

Nack. People should see the hardware channel. If I set channel 6 and my wifi card is on channel 11 I need to see 11 not 6. Doesn't make any sense to show some imaginary idealistic "I wish it was on channel 6" when the hardware is on channel 11. Am I missing something here?

Quoted 6 lines

Umm, if _you_ set channel 11 then you _will_ see channel 11. It's just that when it's scanning and happens to be on channel 132 instead of 11, while you previously set 11, you will _after_ this patch see 11, not 132.

Yes, and at what point does it seem like a good idea to hide the channel the wifi card is on? If I set channel 11 and it is scanning instead of locked on channel 11 then I should see the current channel the hardware is on. This seems like an aweful idea to me, granted, it may help a few people that don't understand how scanning works, but hiding the truth is never a good idea. NACK.

-Rick Farina

Quoted 2 lines

johannes

#4 lore raw
Quoted 8 lines · Richard Farina
Quoted 6 lines · Johannes Berg

Umm, if _you_ set channel 11 then you _will_ see channel 11. It's just that when it's scanning and happens to be on channel 132 instead of 11, while you previously set 11, you will _after_ this patch see 11, not 132.

Quoted 6 lines

Yes, and at what point does it seem like a good idea to hide the channel the wifi card is on? If I set channel 11 and it is scanning instead of locked on channel 11 then I should see the current channel the hardware is on. This seems like an aweful idea to me, granted, it may help a few people that don't understand how scanning works, but hiding the truth is never a good idea. NACK.

I can see what you mean, but I think showing seemingly random fluctuations in channel assignments is at best distracting. Don't you agree that most people are more interested in seeing the configuration state than the transient state of the hardware?

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#5 lore raw
Quoted 14 lines · John W. Linville
Quoted 6 lines · Richard Farina
Quoted 4 lines · Johannes Berg

Umm, if _you_ set channel 11 then you _will_ see channel 11. It's just that when it's scanning and happens to be on channel 132 instead of 11, while you previously set 11, you will _after_ this patch see 11, not 132.

Quoted 6 lines

Yes, and at what point does it seem like a good idea to hide the channel the wifi card is on? If I set channel 11 and it is scanning instead of locked on channel 11 then I should see the current channel the hardware is on. This seems like an aweful idea to me, granted, it may help a few people that don't understand how scanning works, but hiding the truth is never a good idea. NACK.

Quoted 4 lines

I can see what you mean, but I think showing seemingly random fluctuations in channel assignments is at best distracting. Don't you agree that most people are more interested in seeing the configuration state than the transient state of the hardware?

I want to report my experience. There was a bug in the ath5k driver with a hanging result during scanning mode. I was able to discover the problem thanks to the iwconfig output.

In alternative, is it possible to add a status flag so that iwconfig from user space can report scanning mode is operative?

Fabio

#6 lore raw
Quoted 5 lines · Fabio Rossi
Quoted 3 lines · John W. Linville
Quoted 2 lines · Richard Farina
Quoted 1 line · Johannes Berg

Umm, if _you_ set channel 11 then you _will_ see channel 11. It's=

just

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

that when it's scanning and happens to be on channel 132 instead =

of 11,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

while you previously set 11, you will _after_ this patch see 11, =

not

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

132.

Yes, and at what point does it seem like a good idea to hide the c=

hannel

Quoted 1 line
Quoted 1 line
Quoted 1 line

the wifi card is on? =C2=A0If I set channel 11 and it is scanning =

instead of

Quoted 1 line
Quoted 1 line
Quoted 1 line

locked on channel 11 then I should see the current channel the har=

dware

Quoted 1 line
Quoted 1 line
Quoted 1 line

is on. =C2=A0This seems like an aweful idea to me, granted, it may=

help a few

Quoted 1 line
Quoted 1 line
Quoted 1 line

people that don't understand how scanning works, but hiding the tr=

uth is

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

never a good idea. NACK.

I can see what you mean, but I think showing seemingly random fluctuations in channel assignments is at best distracting. =C2=A0Do=

n't you

Quoted 1 line
Quoted 1 line

agree that most people are more interested in seeing the configurati=

on

Quoted 3 lines
Quoted 1 line

state than the transient state of the hardware?

I want to report my experience. There was a bug in the ath5k driver w=

ith a

Quoted 1 line

hanging result during scanning mode. I was able to discover the probl=

em

Quoted 3 lines

thanks to the iwconfig output.

In alternative, is it possible to add a status flag so that iwconfig =

from user

Quoted 1 line

space can report scanning mode is operative?

iw event

Or the old way : iwevent

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

#7 lore raw
In reply to John W. Linville
Quoted 11 lines · John W. Linville
Quoted 6 lines

Yes, and at what point does it seem like a good idea to hide the channel the wifi card is on? If I set channel 11 and it is scanning instead of locked on channel 11 then I should see the current channel the hardware is on. This seems like an aweful idea to me, granted, it may help a few people that don't understand how scanning works, but hiding the truth is never a good idea. NACK.

I can see what you mean, but I think showing seemingly random fluctuations in channel assignments is at best distracting. Don't you agree that most people are more interested in seeing the configuration state than the transient state of the hardware?

I agree, it's very distracting. And while doing mac80211 software scan the device is on a channel approximately 30 ms with queues stopped, so no data is transfered at that time. I don't see any benefit from reporting this value to user space: "Hey, I'm on channel 5 now but by the time to you read this I will be on channel 6 already."

If people want to follow how mac80211 changes the frequency during scan, the proper way is to add debug messages for op_config() calls. I saw that Johannes was already working on that.

Signature · 1 line
Kalle Valo
#8 lore raw
Quoted 17 lines · Kalle Valo
Quoted 7 lines · John W. Linville
Quoted 2 lines

Yes, and at what point does it seem like a good idea to hide the channel the wifi card is on? If I set channel 11 and it is scanning instead of locked on channel 11 then I should see the current channel the hardware is on. This seems like an aweful idea to me, granted, it may help a few people that don't understand how scanning works, but hiding the truth is never a good idea. NACK.

I can see what you mean, but I think showing seemingly random fluctuations in channel assignments is at best distracting. Don't you agree that most people are more interested in seeing the configuration state than the transient state of the hardware?

I agree, it's very distracting. And while doing mac80211 software scan the device is on a channel approximately 30 ms with queues stopped, so no data is transfered at that time. I don't see any benefit from reporting this value to user space: "Hey, I'm on channel 5 now but by the time to you read this I will be on channel 6 already."

Quoted 5 lines

If people want to follow how mac80211 changes the frequency during scan, the proper way is to add debug messages for op_config() calls. I saw that Johannes was already working on that.

To be honest, I would be perfectly happy with this patch if something like a scanning "flag" were to be show in the output if that is what is happening. I don't so much need to see the current channel (when in sta mode at least) as I need to know that the card is scanning if it is not currently on the channel the AP is on. I'd be very happy to simply see it say "scanning" next to the channel or some such when this occurs.

thanks,
Rick Farina

author maintainer
#9 lore raw
Quoted 6 lines · Richard Farina

To be honest, I would be perfectly happy with this patch if something like a scanning "flag" were to be show in the output if that is what is happening. I don't so much need to see the current channel (when in sta mode at least) as I need to know that the card is scanning if it is not currently on the channel the AP is on. I'd be very happy to simply see it say "scanning" next to the channel or some such when this occurs.

Except that's totally not possible with wext.

johannes

author maintainer
#10 lore raw
Quoted 10 lines · Johannes Berg
Quoted 6 lines · Richard Farina

To be honest, I would be perfectly happy with this patch if something like a scanning "flag" were to be show in the output if that is what is happening. I don't so much need to see the current channel (when in sta mode at least) as I need to know that the card is scanning if it is not currently on the channel the AP is on. I'd be very happy to simply see it say "scanning" next to the channel or some such when this occurs.

Except that's totally not possible with wext.

Also, again, it is impossible in practise to do that for all cards since fullmac cards might be bg scanning without telling the host.

johannes

author maintainer
#11 lore raw
In reply to Richard Farina
Quoted 6 lines · Richard Farina

Yes, and at what point does it seem like a good idea to hide the channel the wifi card is on? If I set channel 11 and it is scanning instead of locked on channel 11 then I should see the current channel the hardware is on. This seems like an aweful idea to me, granted, it may help a few people that don't understand how scanning works, but hiding the truth is never a good idea. NACK.

It's not really about hiding the truth. Besides, many many devices are _already_ "hiding the truth" (to use your words) because they do scanning in firmware and you never know what channel they're on (e.g. all Intel wireless hardware).

I think it's completely pointless for us to reply to the question "what channel am I on" with the answer "currently the receiver is tuned to 132", when we can say "you're associated to a network on channel 11".

After all, we don't unset the SSID/BSSID when scanning either, even though we're currently not talking to the AP.

johannes

#12 lore raw
Quoted 6 lines · Johannes Berg
Quoted 2 lines · Richard Farina

Yes, and at what point does it seem like a good idea to hide the channel the wifi card is on? If I set channel 11 and it is scanning instead of locked on channel 11 then I should see the current channel the hardware is on. This seems like an aweful idea to me, granted, it may help a few people that don't understand how scanning works, but hiding the truth is never a good idea. NACK.

Quoted 10 lines

It's not really about hiding the truth. Besides, many many devices are _already_ "hiding the truth" (to use your words) because they do scanning in firmware and you never know what channel they're on (e.g. all Intel wireless hardware).

I think it's completely pointless for us to reply to the question "what channel am I on" with the answer "currently the receiver is tuned to 132", when we can say "you're associated to a network on channel 11".

And if the card claims to be associated but ends up stuck on another channel? I can't see a good reason for this at all but if no one agrees with me then it is well without your power to simply overrule me.

I think it is an awful idea, and intel being broken isn't an excuse to break everything else. If the card isn't on the right channel because of some random failure this patch ensures there is no way to troubleshoot. If you want to display current channel that is the hardware channel, if you want to display "Channel the AP I'm associated to is on" then call it something other than "Current Channel"

My 0.02.

Thanks,
Rick Farina

Quoted 5 lines

After all, we don't unset the SSID/BSSID when scanning either, even though we're currently not talking to the AP.

johannes

#13 lore raw

On Mon, May 4, 2009 at 11:30 AM, Richard Farina <[email protected]> wro= te:

Quoted 7 lines
Quoted 6 lines · Johannes Berg
Quoted 2 lines · Richard Farina

Yes, and at what point does it seem like a good idea to hide the ch=

annel

Quoted 1 line
Quoted 1 line
Quoted 1 line

the wifi card is on? =C2=A0If I set channel 11 and it is scanning i=

nstead of

Quoted 1 line
Quoted 1 line
Quoted 1 line

locked on channel 11 then I should see the current channel the hard=

ware is

Quoted 1 line
Quoted 1 line
Quoted 1 line

on. =C2=A0This seems like an aweful idea to me, granted, it may hel=

p a few people

Quoted 1 line
Quoted 1 line
Quoted 1 line

that don't understand how scanning works, but hiding the truth is n=

ever a

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

good idea. NACK.

It's not really about hiding the truth. Besides, many many devices a=

re

Quoted 2 lines
Quoted 2 lines

_already_ "hiding the truth" (to use your words) because they do scanning in firmware and you never know what channel they're on (e.g=

=2E

Quoted 3 lines
Quoted 3 lines

all Intel wireless hardware).

I think it's completely pointless for us to reply to the question "w=

hat

Quoted 2 lines
Quoted 2 lines

channel am I on" with the answer "currently the receiver is tuned to 132", when we can say "you're associated to a network on channel 11"=

=2E

Quoted 5 lines
Quoted 2 lines

And if the card claims to be associated but ends up stuck on another channel? =C2=A0I can't see a good reason for this at all but if no on=

e agrees

Quoted 3 lines

with me then it is well without your power to simply overrule me.

I think it is an awful idea, and intel being broken isn't an excuse t=

o break

Quoted 1 line

everything else. =C2=A0If the card isn't on the right channel because=

of some

Quoted 1 line

random failure this patch ensures there is no way to troubleshoot. =C2=

=A0If you

Quoted 1 line

want to display current channel that is the hardware channel, if you =

want to

Quoted 1 line

display "Channel the AP I'm associated to is on" then call it somethi=

ng

Quoted 3 lines

other than "Current Channel"

My 0.02.

Why not show both through iw and for wext just use whatever wext did for most devices?

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

author maintainer
#14 lore raw
Quoted 2 lines · Luis R. Rodriguez

Why not show both through iw and for wext just use whatever wext did for most devices?

Where "most devices" counts as number of drivers (I think all pre-mac80211 drivers behave like _after_ my patch), or number of deployed devices (piles of Intel devices, I guess), or...?

Also keep in mind that for many devices we simply cannot provide the real channel the radio is currently tuned to.

johannes

author maintainer
#15 lore raw
In reply to Richard Farina
Quoted 2 lines · Richard Farina

And if the card claims to be associated but ends up stuck on another channel?

Then your network breaks anyway? And you see messages in the log that it failed to switch channel? We're talking about mac80211 devices :)

Quoted 9 lines

I can't see a good reason for this at all but if no one agrees with me then it is well without your power to simply overrule me.

I think it is an awful idea, and intel being broken isn't an excuse to break everything else. If the card isn't on the right channel because of some random failure this patch ensures there is no way to troubleshoot. If you want to display current channel that is the hardware channel, if you want to display "Channel the AP I'm associated to is on" then call it something other than "Current Channel"

It's not just Intel... All fullmac devices, ie. everything not using mac80211, shows the same behaviour.

And trying to say "current channel" is "hardware channel" runs into the nice pitfall that, unfortunately, wext is so undefined that you can't really say either. I think the channel it's trying to use makes a whole lot more sense because otherwise a user who just randomly does "iwconfig" will be mightily confused if for example wpa_supplicant had just requested a scan.

johannes