staging: vt6656: fix sign of rx_dbm to bb_pre_ed_rssi.
authorMalcolm Priestley <tvboxspy@gmail.com>
Tue, 4 Feb 2020 19:34:02 +0000 (19:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Feb 2020 16:49:10 +0000 (08:49 -0800)
bb_pre_ed_rssi is an u8 rx_dm always returns negative signed
values add minus operator to always yield positive.

fixes issue where rx sensitivity is always set to maximum because
the unsigned numbers were always greater then 100.

Fixes: 63b9907f58f1 ("staging: vt6656: mac80211 conversion: create rx function.")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/aceac98c-6e69-3ce1-dfec-2bf27b980221@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/dpc.c

index 821aae8..a0b60e7 100644 (file)
@@ -98,7 +98,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
 
        vnt_rf_rssi_to_dbm(priv, tail->rssi, &rx_dbm);
 
-       priv->bb_pre_ed_rssi = (u8)rx_dbm + 1;
+       priv->bb_pre_ed_rssi = (u8)-rx_dbm + 1;
        priv->current_rssi = priv->bb_pre_ed_rssi;
 
        skb_pull(skb, sizeof(*head));