Skip to contentSkip to conversation

signal strength in nl80211 and IEEE80211_HW_SIGNAL_UNSPEC

PATCH New Cristian Morales Vega 3 participants 5 messages Mar 15, 2012 mac80211

lore
Share & tools
lore
#0 lore raw

I don't have a device using a driver with IEEE80211_HW_SIGNAL_UNSPEC to test, but because of
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=19deffbeba930030cfaf000b920333c6ba99ad52
I guess nl80211 will report the NL80211_STA_INFO_SIGNAL even if the driver doesn't uses dBm, true?
Looking at http://permalink.gmane.org/gmane.linux.kernel.wireless.general/24814
it seems this wasn't wanted. Bug, the check for IEEE80211_HW_SIGNAL_DBM is done elsewhere or finally it was decided that the signal strength should be reported even if the units are unknown?

Thanks.

Signature · 19 lines
Cristian Morales Vega

Email [email protected]
Office +44 (0) 20 3111 4330
Direct Line:  +44 (0) 20 3111 4338
Web:  www.samknows.com


This email is sent for and on behalf of SamKnows Limited.

This email and any attachments are confidential, legally privileged
and protected by copyright. If you are not the intended recipient
dissemination or copying of this email is prohibited. If you have
received this in error, please notify the sender by replying by email
and then delete the email completely from your system.

SamKnows Limited, Registered Number: 06510477, Registered Office: 25
Harley Street, London, W1G 9BR. Registered in England and Wales. Trade
Mark 2507103
maintainer
#1 lore raw
Quoted 10 lines · Cristian Morales Vega

I don't have a device using a driver with IEEE80211_HW_SIGNAL_UNSPEC to test, but because of
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=19deffbeba930030cfaf000b920333c6ba99ad52
I guess nl80211 will report the NL80211_STA_INFO_SIGNAL even if the driver doesn't uses dBm, true?
Looking at http://permalink.gmane.org/gmane.linux.kernel.wireless.general/24814
it seems this wasn't wanted. Bug, the check for IEEE80211_HW_SIGNAL_DBM is done elsewhere or finally it was decided that the signal strength should be reported even if the units are unknown?

Huh, yes, the nl80211 reporting here was intended to be dBm as documented in the header file, so John's commit does look like a bug. John, can you revert that please? The "unspec" signal strength thing is used only in NL80211_BSS_SIGNAL_UNSPEC, i.e. the signal strength reported in scan results. If we want/need it in station information as well we need to add a separate attribute.

johannes

maintainer
#2 lore raw

PATCH 1/1 mac80211: report only dBm station signal

From: Johannes Berg <[email protected]>

The station signal can currently only be reported in dBm, so don't report it at all if we only have unspecified units from the device.

---
 net/mac80211/cfg.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/mac80211/cfg.c +1 -2
@@ -385,8 +385,7 @@ static void sta_set_sinfo(struct sta_inf
 	sinfo->rx_dropped_misc = sta->rx_dropped;
 	sinfo->beacon_loss_count = sta->beacon_loss_count;
 
-	if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) ||
-	    (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) {
+	if (sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) {
 		sinfo->filled |= STATION_INFO_SIGNAL | STATION_INFO_SIGNAL_AVG;
 		sinfo->signal = (s8)sta->last_signal;
 		sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal);
#3 lore raw
In reply to Johannes Berg
Quoted 12 lines · Johannes Berg
Quoted 10 lines · Cristian Morales Vega

I don't have a device using a driver with IEEE80211_HW_SIGNAL_UNSPEC to test, but because of
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=19deffbeba930030cfaf000b920333c6ba99ad52
I guess nl80211 will report the NL80211_STA_INFO_SIGNAL even if the driver doesn't uses dBm, true?
Looking at http://permalink.gmane.org/gmane.linux.kernel.wireless.general/24814
it seems this wasn't wanted. Bug, the check for IEEE80211_HW_SIGNAL_DBM is done elsewhere or finally it was decided that the signal strength should be reported even if the units are unknown?

Quoted 6 lines

Huh, yes, the nl80211 reporting here was intended to be dBm as documented in the header file, so John's commit does look like a bug. John, can you revert that please? The "unspec" signal strength thing is used only in NL80211_BSS_SIGNAL_UNSPEC, i.e. the signal strength reported in scan results. If we want/need it in station information as well we need to add a separate attribute.

Well, that commit fixes this bug:

	https://bugzilla.kernel.org/show_bug.cgi?id=14763

sta_set_sinfo is called by ieee80211_get_station, which gets invoked by cfg80211_wireless_stats when handling SIOCGIWSTATS ioctls. Without that commit, devices that use IEEE80211_HW_SIGNAL_UNSPEC report a 0 signal strength through wext.

So, how do we fix this and keep wext working for those devices? For that matter, what actual bug is it causing?

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.
maintainer
#4 lore raw
Quoted 24 lines · John W. Linville
Quoted 12 lines · Johannes Berg
Quoted 10 lines · Cristian Morales Vega

I don't have a device using a driver with IEEE80211_HW_SIGNAL_UNSPEC to test, but because of
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=19deffbeba930030cfaf000b920333c6ba99ad52
I guess nl80211 will report the NL80211_STA_INFO_SIGNAL even if the driver doesn't uses dBm, true?
Looking at http://permalink.gmane.org/gmane.linux.kernel.wireless.general/24814
it seems this wasn't wanted. Bug, the check for IEEE80211_HW_SIGNAL_DBM is done elsewhere or finally it was decided that the signal strength should be reported even if the units are unknown?

Quoted 6 lines

Huh, yes, the nl80211 reporting here was intended to be dBm as documented in the header file, so John's commit does look like a bug. John, can you revert that please? The "unspec" signal strength thing is used only in NL80211_BSS_SIGNAL_UNSPEC, i.e. the signal strength reported in scan results. If we want/need it in station information as well we need to add a separate attribute.

Well, that commit fixes this bug:

	https://bugzilla.kernel.org/show_bug.cgi?id=14763
Quoted 7 lines

sta_set_sinfo is called by ieee80211_get_station, which gets invoked by cfg80211_wireless_stats when handling SIOCGIWSTATS ioctls. Without that commit, devices that use IEEE80211_HW_SIGNAL_UNSPEC report a 0 signal strength through wext.

So, how do we fix this and keep wext working for those devices? For that matter, what actual bug is it causing?

This would cause iw (for example) to display

station ...
signal: 80 dBm

To properly fix the reporting in wext you'd have to allow the field to be filled also for UNSPEC units and then figure out the difference (and whether to report it in nl80211) in cfg80211 -- like in nl80211_send_bss().

johannes