staging: rtl8192u: r8192U_core: fix negative noise value
authorLuis de Bethencourt <luisbg@osg.samsung.com>
Sun, 11 Oct 2015 13:31:07 +0000 (14:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 03:40:48 +0000 (20:40 -0700)
ieee80211_rx_stats.noise is of type uint8, so it shouldn't be assigned a
negative number. Assigning it 0x100 - 98, which is the equivalent
to -98 dBm when IW_QUAL_DBM is set.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/r8192U_core.c

index 0bae93b..eab0d81 100644 (file)
@@ -4778,7 +4778,7 @@ static void rtl8192_rx_nomal(struct sk_buff *skb)
        struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
        struct ieee80211_rx_stats stats = {
                .signal = 0,
-               .noise = -98,
+               .noise = 0x100 - 98,
                .rate = 0,
                .freq = IEEE80211_24GHZ_BAND,
        };
@@ -4889,7 +4889,7 @@ static void rtl8192_rx_cmd(struct sk_buff *skb)
        /* TODO */
        struct ieee80211_rx_stats stats = {
                .signal = 0,
-               .noise = -98,
+               .noise = 0x100 - 98,
                .rate = 0,
                .freq = IEEE80211_24GHZ_BAND,
        };