* [PATCH V2] bcm43xx-mac80211: Rescale link quality output
@ 2007-08-05 7:29 Larry Finger
2007-08-05 12:57 ` Michael Buesch
2007-08-06 12:10 ` Michael Buesch
0 siblings, 2 replies; 5+ messages in thread
From: Larry Finger @ 2007-08-05 7:29 UTC (permalink / raw)
To: Michael Buesch; +Cc: Bcm43xx-dev, linux-wireless
The link quality output from wireless extensions is too small by the ratio
of 100/BCM43xx_RX_MAX_SSI (60) for bcm43xx-mac80211. This patch puts the
quantity on the proper scale.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
Index: wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
+++ wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
@@ -537,7 +537,8 @@ void bcm43xx_rx(struct bcm43xx_wldev *de
(phystat0 & BCM43xx_RX_PHYST0_GAINCTL),
(phystat3 & BCM43xx_RX_PHYST3_TRSTATE));
status.noise = dev->stats.link_noise;
- status.signal = jssi; /* this looks wrong, but is what mac80211 wants */
+ /* the next line looks wrong, but is what mac80211 wants */
+ status.signal = (jssi * 100) / BCM43xx_RX_MAX_SSI;
if (phystat0 & BCM43xx_RX_PHYST0_OFDM)
status.rate = bcm43xx_plcp_get_bitrate_ofdm(plcp);
else
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] bcm43xx-mac80211: Rescale link quality output
2007-08-05 7:29 [PATCH V2] bcm43xx-mac80211: Rescale link quality output Larry Finger
@ 2007-08-05 12:57 ` Michael Buesch
2007-08-05 14:33 ` Larry Finger
2007-08-06 12:10 ` Michael Buesch
1 sibling, 1 reply; 5+ messages in thread
From: Michael Buesch @ 2007-08-05 12:57 UTC (permalink / raw)
To: bcm43xx-dev; +Cc: Larry Finger, linux-wireless
On Sunday 05 August 2007, Larry Finger wrote:
> The link quality output from wireless extensions is too small by the ratio
> of 100/BCM43xx_RX_MAX_SSI (60) for bcm43xx-mac80211. This patch puts the
> quantity on the proper scale.
>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
>
> Index: wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
> ===================================================================
> --- wireless-dev.orig/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
> +++ wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
> @@ -537,7 +537,8 @@ void bcm43xx_rx(struct bcm43xx_wldev *de
> (phystat0 & BCM43xx_RX_PHYST0_GAINCTL),
> (phystat3 & BCM43xx_RX_PHYST3_TRSTATE));
> status.noise = dev->stats.link_noise;
> - status.signal = jssi; /* this looks wrong, but is what mac80211 wants */
> + /* the next line looks wrong, but is what mac80211 wants */
> + status.signal = (jssi * 100) / BCM43xx_RX_MAX_SSI;
So signal is in percent?
Where is this actually documented. I cannot find a hint on what
the values of all these things are supposed to be.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] bcm43xx-mac80211: Rescale link quality output
2007-08-05 12:57 ` Michael Buesch
@ 2007-08-05 14:33 ` Larry Finger
2007-08-05 14:43 ` Michael Buesch
0 siblings, 1 reply; 5+ messages in thread
From: Larry Finger @ 2007-08-05 14:33 UTC (permalink / raw)
To: Michael Buesch; +Cc: bcm43xx-dev, linux-wireless
Michael Buesch wrote:
> On Sunday 05 August 2007, Larry Finger wrote:
>> The link quality output from wireless extensions is too small by the ratio
>> of 100/BCM43xx_RX_MAX_SSI (60) for bcm43xx-mac80211. This patch puts the
>> quantity on the proper scale.
>>
>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>> ---
>>
>> Index: wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
>> ===================================================================
>> --- wireless-dev.orig/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
>> +++ wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
>> @@ -537,7 +537,8 @@ void bcm43xx_rx(struct bcm43xx_wldev *de
>> (phystat0 & BCM43xx_RX_PHYST0_GAINCTL),
>> (phystat3 & BCM43xx_RX_PHYST3_TRSTATE));
>> status.noise = dev->stats.link_noise;
>> - status.signal = jssi; /* this looks wrong, but is what mac80211 wants */
>> + /* the next line looks wrong, but is what mac80211 wants */
>> + status.signal = (jssi * 100) / BCM43xx_RX_MAX_SSI;
>
> So signal is in percent?
> Where is this actually documented. I cannot find a hint on what
> the values of all these things are supposed to be.
Yes, it is clear as mud, with the additional complications of mac80211 mixing the definitions of
signal and rssi (as far as I'm concerned). The scale is set by the following code snippet in
bcm43xx_wireless_init.
hw->max_signal = 100;
hw->max_rssi = -110;
hw->max_noise = -110;
In this code, "signal" is put on a scale of 0 to 100, and rssi and noise on a scale of -110 to 0 and
are assumed to be dBm. Of course, rssi should be a positive number and signal should be in dBm, but
my renaming of signal => quality and rssi => signal was shot down, so we are stuck.
An alternative to the patch above would be to set hw->max_signal = BCM43xx_RX_MAX_SSI. In that case,
the line of iwconfig output that reads "Link Quality=83/100 Signal level=-34 dBm Noise level=-71
dBm" would have a "Link Quality" of 50/60 instead of 83/100.
The bottom line is that it is an arbitrary quantity on an arbitrary scale. Is it better for it to be
XX/100 than YY/60? I think so, but YMMV.
Larry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] bcm43xx-mac80211: Rescale link quality output
2007-08-05 14:33 ` Larry Finger
@ 2007-08-05 14:43 ` Michael Buesch
0 siblings, 0 replies; 5+ messages in thread
From: Michael Buesch @ 2007-08-05 14:43 UTC (permalink / raw)
To: Larry Finger; +Cc: bcm43xx-dev, linux-wireless
On Sunday 05 August 2007, Larry Finger wrote:
> Michael Buesch wrote:
> > On Sunday 05 August 2007, Larry Finger wrote:
> >> The link quality output from wireless extensions is too small by the ratio
> >> of 100/BCM43xx_RX_MAX_SSI (60) for bcm43xx-mac80211. This patch puts the
> >> quantity on the proper scale.
> >>
> >> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> >> ---
> >>
> >> Index: wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
> >> ===================================================================
> >> --- wireless-dev.orig/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
> >> +++ wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
> >> @@ -537,7 +537,8 @@ void bcm43xx_rx(struct bcm43xx_wldev *de
> >> (phystat0 & BCM43xx_RX_PHYST0_GAINCTL),
> >> (phystat3 & BCM43xx_RX_PHYST3_TRSTATE));
> >> status.noise = dev->stats.link_noise;
> >> - status.signal = jssi; /* this looks wrong, but is what mac80211 wants */
> >> + /* the next line looks wrong, but is what mac80211 wants */
> >> + status.signal = (jssi * 100) / BCM43xx_RX_MAX_SSI;
> >
> > So signal is in percent?
> > Where is this actually documented. I cannot find a hint on what
> > the values of all these things are supposed to be.
>
> Yes, it is clear as mud, with the additional complications of mac80211 mixing the definitions of
> signal and rssi (as far as I'm concerned). The scale is set by the following code snippet in
> bcm43xx_wireless_init.
>
> hw->max_signal = 100;
> hw->max_rssi = -110;
> hw->max_noise = -110;
>
> In this code, "signal" is put on a scale of 0 to 100, and rssi and noise on a scale of -110 to 0 and
> are assumed to be dBm. Of course, rssi should be a positive number and signal should be in dBm, but
> my renaming of signal => quality and rssi => signal was shot down, so we are stuck.
>
> An alternative to the patch above would be to set hw->max_signal = BCM43xx_RX_MAX_SSI. In that case,
> the line of iwconfig output that reads "Link Quality=83/100 Signal level=-34 dBm Noise level=-71
> dBm" would have a "Link Quality" of 50/60 instead of 83/100.
>
> The bottom line is that it is an arbitrary quantity on an arbitrary scale. Is it better for it to be
> XX/100 than YY/60? I think so, but YMMV.
Ah, I see. Kind of confusing. :)
Well, I would like to do
hw->max_signal = MAX_RSSI
but it seems to be an unwritten rule that signal scales to 100.
At least I never saw a different scale in a driver, yet.
So I think I will apply your patch.
Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] bcm43xx-mac80211: Rescale link quality output
2007-08-05 7:29 [PATCH V2] bcm43xx-mac80211: Rescale link quality output Larry Finger
2007-08-05 12:57 ` Michael Buesch
@ 2007-08-06 12:10 ` Michael Buesch
1 sibling, 0 replies; 5+ messages in thread
From: Michael Buesch @ 2007-08-06 12:10 UTC (permalink / raw)
To: Larry Finger; +Cc: Bcm43xx-dev, linux-wireless
On Sunday 05 August 2007, Larry Finger wrote:
> The link quality output from wireless extensions is too small by the ratio
> of 100/BCM43xx_RX_MAX_SSI (60) for bcm43xx-mac80211. This patch puts the
> quantity on the proper scale.
>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
>
> Index: wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
> ===================================================================
> --- wireless-dev.orig/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
> +++ wireless-dev/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_xmit.c
> @@ -537,7 +537,8 @@ void bcm43xx_rx(struct bcm43xx_wldev *de
> (phystat0 & BCM43xx_RX_PHYST0_GAINCTL),
> (phystat3 & BCM43xx_RX_PHYST3_TRSTATE));
> status.noise = dev->stats.link_noise;
> - status.signal = jssi; /* this looks wrong, but is what mac80211 wants */
> + /* the next line looks wrong, but is what mac80211 wants */
> + status.signal = (jssi * 100) / BCM43xx_RX_MAX_SSI;
> if (phystat0 & BCM43xx_RX_PHYST0_OFDM)
> status.rate = bcm43xx_plcp_get_bitrate_ofdm(plcp);
> else
>
>
Queued into my patch series, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-06 12:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-05 7:29 [PATCH V2] bcm43xx-mac80211: Rescale link quality output Larry Finger
2007-08-05 12:57 ` Michael Buesch
2007-08-05 14:33 ` Larry Finger
2007-08-05 14:43 ` Michael Buesch
2007-08-06 12:10 ` Michael Buesch
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).