linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Luigi Tarenga <luigi.tarenga@gmail.com>
Cc: Ivo van Doorn <IvDoorn@gmail.com>,
	Gertjan van Wingerde <gwingerde@gmail.com>,
	Helmut Schaa <helmut.schaa@googlemail.com>,
	linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: Re: PROBLEM: rt2800lib return -128db when signal is stronger than -12db
Date: Tue, 31 Jan 2012 15:05:13 +0100	[thread overview]
Message-ID: <20120131140512.GC2950@redhat.com> (raw)
In-Reply-To: <CAKkO-EgF=NKpj-duK5oOTCMdbOnc0HwmBT9oc9FhtqT5KqZgeg@mail.gmail.com>

On Mon, Jan 30, 2012 at 03:23:15PM +0100, Luigi Tarenga wrote:
> -	int rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0);
> -	int rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1);
> -	int rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2);
> +	s8 rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0);
> +	s8 rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1);
> +	s8 rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2);
>  	u16 eeprom;
>  	u8 offset0;
>  	u8 offset1;
> @@ -539,11 +539,12 @@
>  	/*
>  	 * Convert the value from the descriptor into the RSSI value
>  	 * If the value in the descriptor is 0, it is considered invalid
> -	 * and the default (extremely low) rssi value is assumed
> +	 * and the default (extremely low) rssi value is assumed.
> +         * HW rssiX values go from -13 (strongest) to positive number
> (weakest).
>  	 */
> -	rssi0 = (rssi0) ? (-12 - offset0 - rt2x00dev->lna_gain - rssi0) : -128;
> -	rssi1 = (rssi1) ? (-12 - offset1 - rt2x00dev->lna_gain - rssi1) : -128;
> -	rssi2 = (rssi2) ? (-12 - offset2 - rt2x00dev->lna_gain - rssi2) : -128;
> +	rssi0 = (rssi0) ? (-13 - offset0 - rt2x00dev->lna_gain - rssi0) : -128;
> +	rssi1 = (rssi1) ? (-13 - offset1 - rt2x00dev->lna_gain - rssi1) : -128;
> +	rssi2 = (rssi2) ? (-13 - offset2 - rt2x00dev->lna_gain - rssi2) : -128;

Not sure if change -12 to -13 is needed, seems not compatible with
vendor driver. If you just change rssiX type to s8, will it
fix the problem? That seems to be correct and enough to fix
(example why this make difference: 0xc0 gives s8: -64 int: 192).

If you will be reposting please follow
http://linux.yyz.us/patch-format.html
especially add Signed-off-by: line.

Thanks
Stanislaw

      reply	other threads:[~2012-01-31 14:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30 14:23 PROBLEM: rt2800lib return -128db when signal is stronger than -12db Luigi Tarenga
2012-01-31 14:05 ` Stanislaw Gruszka [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=20120131140512.GC2950@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=IvDoorn@gmail.com \
    --cc=gwingerde@gmail.com \
    --cc=helmut.schaa@googlemail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luigi.tarenga@gmail.com \
    --cc=users@rt2x00.serialmonkey.com \
    /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).