linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: Pavel Roskin <proski@gnu.org>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wireless: sysfs was displaying different values for level and noise than procfs
Date: Wed, 19 Nov 2008 15:08:57 -0500	[thread overview]
Message-ID: <20081119200856.GH3485@tuxdriver.com> (raw)
In-Reply-To: <200811192245.29487.arvidjaar@mail.ru>

On Wed, Nov 19, 2008 at 10:45:21PM +0300, Andrey Borzenkov wrote:
> On Wednesday 19 November 2008, Pavel Roskin wrote:
> > On Sat, 2008-11-15 at 18:31 +0300, Andrey Borzenkov wrote:
> > > Subject: [PATCH] wireless: sysfs was displaying different values for level and noise than procfs
> > > From: Andrey Borzenkov <arvidjaar@mail.ru>
> > > 
> > > /proc/net/wireless asjusts display of signal and noise level depending on
> > > whether units are percentage or dBm. Use the same format in sysfs. This
> > > makes it easy to know unit - below zero is dBm, above zero is percent.
> > 
> > I've seen received power up to 3 dBm.  The AP was using an amplifier
> > (it's specialized hardware), and it's possible that the card on the
> > station side was exaggerating the signal.  However, the data we report
> > should not need any guesswork to be interpreted.  It may be parsed by
> > userspace software.
> > 
> 
> But positive dBm is not even possible to represnt right now. It is u8 and
> is displayed as ((s32)level - 256); so it is *always* negative.
> 
> > Receiving 1 mW out of 200 mW is not impossible in some antenna
> > configurations even with consumer devices.
> > 
> > > Before:
> > > {pts/1}% cat /sys/class/net/eth1/wireless/level
> > > 203
> > > {pts/1}% cat /sys/class/net/eth1/wireless/noise
> > > 166
> > 
> > > +	return sprintf(buf, format_string, (__s32)iw->field -		\
> > > +			((iw->qual.updated & IW_QUAL_DBM) ? 0x100 : 0)); \
> > 
> > I think non-dBm data should be shown in a special format: "203/255"
> > where 255 is the maximal value, and the dBm data should be shown as
> > numbers: "-48".  This way, we encourage use of dBm data by making it
> > easier to parse.
> > 
> 
> Well, I do not have any strong opinion regarding this; I just noticed
> discrepancy between procfs and sysfs for what effectively is the same raw
> value.

And what is your perspective regarding potential 'userland ABI'
issues of either this patch or of Pavel's suggestion?

John
-- 
John W. Linville		Linux should be at the core
linville@tuxdriver.com			of your literate lifestyle.

  reply	other threads:[~2008-11-19 20:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-15 15:31 [PATCH] wireless: sysfs was displaying different values for level and noise than procfs Andrey Borzenkov
2008-11-19 19:13 ` Pavel Roskin
2008-11-19 19:45   ` Andrey Borzenkov
2008-11-19 20:08     ` John W. Linville [this message]
2008-11-19 21:51       ` Pavel Roskin
2008-11-20  6:57         ` Johannes Berg
2008-11-20 16:15           ` Pavel Roskin
2008-11-20 12:08         ` Holger Schurig

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=20081119200856.GH3485@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=arvidjaar@mail.ru \
    --cc=linux-wireless@vger.kernel.org \
    --cc=proski@gnu.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).