Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236229 > unrolled thread

[PATCH] staging: rtl8192e: rtl_wx: fix negative noise value

Started byLuis de Bethencourt <luisbg@osg.samsung.com>
First post2015-09-30 14:20 +0200
Last post2015-10-01 20:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: rtl8192e: rtl_wx: fix negative noise value Luis de Bethencourt <luisbg@osg.samsung.com> - 2015-09-30 14:20 +0200
    Re: [PATCH] staging: rtl8192e: rtl_wx: fix negative noise value Mateusz Kulikowski <mateusz.kulikowski@gmail.com> - 2015-10-01 20:00 +0200

#1236229 — [PATCH] staging: rtl8192e: rtl_wx: fix negative noise value

FromLuis de Bethencourt <luisbg@osg.samsung.com>
Date2015-09-30 14:20 +0200
Subject[PATCH] staging: rtl8192e: rtl_wx: fix negative noise value
Message-ID<qeowz-4Il-27@gated-at.bofh.it>
wstats->qual.noise is of type uint8, so it shouldn't be assigned a
negative number. Assigning it 0x100 - 100, which is the equivalent
to -100 dBm when IW_QUAL_DBM is set.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 984cb9a..70df6a1 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -1225,7 +1225,7 @@ static struct iw_statistics *_rtl92e_get_wireless_stats(struct net_device *dev)
 	if (ieee->state < RTLLIB_LINKED) {
 		wstats->qual.qual = 10;
 		wstats->qual.level = 0;
-		wstats->qual.noise = -100;
+		wstats->qual.noise = 0x100 - 100;	/* -100 dBm */
 		wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
 		return wstats;
 	}
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1237608

FromMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Date2015-10-01 20:00 +0200
Message-ID<qeQj8-3kO-25@gated-at.bofh.it>
In reply to#1236229
On 30.09.2015 14:12, Luis de Bethencourt wrote:
> wstats->qual.noise is of type uint8, so it shouldn't be assigned a
> negative number. Assigning it 0x100 - 100, which is the equivalent
> to -100 dBm when IW_QUAL_DBM is set.
> 
> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> index 984cb9a..70df6a1 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> @@ -1225,7 +1225,7 @@ static struct iw_statistics *_rtl92e_get_wireless_stats(struct net_device *dev)
>  	if (ieee->state < RTLLIB_LINKED) {
>  		wstats->qual.qual = 10;
>  		wstats->qual.level = 0;
> -		wstats->qual.noise = -100;
> +		wstats->qual.noise = 0x100 - 100;	/* -100 dBm */
>  		wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
>  		return wstats;
>  	}
> 


Tested-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

Although I still don't understand why someone wanted to have unsigned noise
(historical reasons perhaps?)


Mateusz
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web