All of lore.kernel.org
 help / color / mirror / Atom feed
From: Senthil Balasubramanian <senthil.lnx@gmail.com>
To: Felix Fietkau <nbd@openwrt.org>
Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com,
	lrodriguez@atheros.com
Subject: Re: [PATCH 1/3] ath9k: fix signal strength of received packets
Date: Tue, 5 Apr 2011 23:37:00 +0530	[thread overview]
Message-ID: <20110405180700.GA2430@ath9k-test> (raw)
In-Reply-To: <1301708388-8416-1-git-send-email-nbd@openwrt.org>

On Sat, Apr 02, 2011 at 03:39:46AM +0200, Felix Fietkau wrote:
> The reported RSSI values are relative to the calibrated noise floor, not
> relative to a hardcoded value of -95.
> 
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> ---
>  drivers/net/wireless/ath/ath9k/recv.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
> index a9c3f46..87d96c5 100644
> --- a/drivers/net/wireless/ath/ath9k/recv.c
> +++ b/drivers/net/wireless/ath/ath9k/recv.c
> @@ -959,6 +959,9 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common,
>  				   struct ieee80211_rx_status *rx_status,
>  				   bool *decrypt_error)
>  {
> +	struct ath_hw *ah = common->ah;
> +	int noise;
> +
>  	memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
>  
>  	/*
> @@ -979,7 +982,13 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common,
>  
>  	rx_status->band = hw->conf.channel->band;
>  	rx_status->freq = hw->conf.channel->center_freq;
> -	rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
In some cases noisefloor values were not reliable and so using
default works for most of the cases. Please refer to our earlier
commit a59b5a5e684652eec035c869ab8911a1689c8f53. Let me see if i
can get more information.
> +
> +	if (ah->curchan)
> +		noise = ah->curchan->noisefloor;
Even otherwise, noisefloor can be zero sometimes and so it can
return incorrect signal strengths.. Please refer to some samples.

BSS 00:10:18:90:3a:9e (on wlan56)
        TSF: 110532917222 usec (1d, 06:42:12)
        freq: 2462
        beacon interval: 100
        capability: ESS (0x0001)
        signal: 50.00 dBm
        last seen: 20 ms ago
        SSID: Broadcom
        Supported rates: 1.0* 2.0* 5.5* 11.0* 18.0 24.0 36.0 54.0
        DS Parameter set: channel 11
        ERP: NonERP_Present Use_Protection Barker_Preamble_Mode
        Extended supported rates: 6.0 9.0 12.0 48.0
        HT capabilities:

SS 00:03:7f:0b:a6:1b (on wlan56)
        TSF: 4376472960 usec (0d, 01:12:56)
        freq: 2462
        beacon interval: 100
        capability: ESS Privacy ShortPreamble (0x0031)
        signal: 60.00 dBm
        last seen: 8 ms ago
        SSID: STRESS-HB125

> +	else
> +		noise = ATH_DEFAULT_NOISE_FLOOR;
> +
> +	rx_status->signal = noise + rx_stats->rs_rssi;
>  	rx_status->antenna = rx_stats->rs_antenna;
>  	rx_status->flag |= RX_FLAG_MACTIME_MPDU;
>  
> -- 
> 1.7.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-04-05 18:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-02  1:39 [PATCH 1/3] ath9k: fix signal strength of received packets Felix Fietkau
2011-04-02  1:39 ` [PATCH 2/3] ath9k: fix beacon slot processing in ad-hoc mode Felix Fietkau
2011-04-02  1:39   ` [PATCH 3/3] ath9k: use the hw opmode to select the beacon timer mode Felix Fietkau
2011-04-05 18:07 ` Senthil Balasubramanian [this message]
2011-04-05 18:19   ` [PATCH 1/3] ath9k: fix signal strength of received packets Felix Fietkau

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=20110405180700.GA2430@ath9k-test \
    --to=senthil.lnx@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lrodriguez@atheros.com \
    --cc=nbd@openwrt.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.