netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Dan Williams <dcbw@redhat.com>
Cc: John Linville <linville@tuxdriver.com>, netdev@vger.kernel.org
Subject: Re: [PATCH] improved statistics for bcm43xx-softmac
Date: Thu, 29 Jun 2006 22:07:58 -0500	[thread overview]
Message-ID: <44A4958E.6040701@lwfinger.net> (raw)
In-Reply-To: <1151614610.15090.30.camel@localhost.localdomain>

Dan Williams wrote:

> To me, it looks like you're trying to use dBm rather than RSSI here.  In
> that case, you have to set range->max_qual.level to 0, because the upper
> bound of dBm is indeed 0.  If you are using negative values _anywhere_
> in your code for quality, you're almost certainly using dBm, not RSSI,
> or something is very wrong.
> Print out the value of 'average' from handle_irq_noise() both when close
> and far away from the AP.  It looks to me like the final calculations
> there come out in dBm given the fact that (a) average is negative, and
> (b) that average is in the range of acceptable dBm numbers.  So:
> 
> 1. set your stats->max_qual.level = 0
> 2. set bcm->stats.link_quality = average
> 3. Do link quality calculation on signal and noise; you can't just be
> linear here though, since a noise floor of -100 with a signal of -90 is
> in reality better than 10% signal; it's actually pretty OK.  Each -1 dBm
> step near the noise floor counts for more % than a -1 dBm increase near
> the best signal level.  You have to weight the bottom of the scale WRT
> percentage to get values that make sense.

Thanks for explaining how to get dBm into these fields. The comments in include/linux/wireless.h are 
confusing.

The quantity listed in stats.rssi has been processed into a dBm value in a routine called 
bcm43xx_rssi_postprocess, which I need to mention in the comments. The calculation is more black 
magic from the clean-room group's reverse engineering of the Mips driver. I changed the name of the 
constant from RSSI_MAX to RX_POWER_MAX, which I estimate to be -10 dBm (see below).

As I move away from the AP, I get the following results:

Dist.	"rssi"	"average"	Link Quality	Notes

.3 m	-14	-64		96/100		Nearly on top of AP
  2 m	-27	-62		83/100		Direct line of sight
15 m	-55	-65		55/100		Bounce down hallway and/or through wall
20 m	-66	-66		44/100		Like 15m point, but through plate glass window
						 - 35% packet loss with ping

The "Link Quality" above comes from 100 - "rssi" - RX_POWER_MAX, where RX_POWER_MAX is -10.

As "average" does not change, clearly the link quality cannot be derived from that value. It seems 
to me that the processed value in the stats.rssi field is not too bad an estimate of the qual.level 
(in dBm). The value from "average" is also not a good estimate of the noise, but it is the best I 
have at the moment. Clearly, the reported value of qual.qual (Link quality) needs to be adjusted

> ipw2200 for example reports -53 dBm near the AP, with noise floor of -83
> dBm in a fairly spectrum-crowded area.  That translates into what
> ipw2200 reports as a 75% signal, which seems a bit off, but gives you an
> idea.  You'll never get near 0 dBm, since there's already 10s of dBm
> loss when the signal has to cross any air at all.

I'm now getting a similar result with an 85% signal at 2 m. The main difference is that both signal 
and noise seem to be shifted up by about 20 dBm. As these are logarithmic quantities, S/N is 
preserved through this offset. My feeling is that these statistics have no absolute meaning, but are 
good as relative indicators. When the left-most bar in the Wireless Network Information applet in 
the KDE taskbar changes from green to yellow, I know that the signal is degraded.

Thanks for your comments. They made me dig a lot deeper into the numbers.

Larry


      reply	other threads:[~2006-06-30  3:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29  4:08 [PATCH] improved statistics for bcm43xx-softmac Larry Finger
2006-06-29 15:12 ` Michael Buesch
2006-06-29 15:31   ` Larry Finger
2006-06-29 20:56 ` Dan Williams
2006-06-30  3:07   ` Larry Finger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44A4958E.6040701@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=dcbw@redhat.com \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).