wlcore: add antenna diversity reading
authorGuy Mishol <guym@ti.com>
Thu, 16 Jul 2015 08:22:47 +0000 (11:22 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 21 Jul 2015 15:07:34 +0000 (18:07 +0300)
update the rssi reading on rx_status
to read both RSSI level (7 bits) and
antenna diversity (msb)

Signed-off-by: Guy Mishol <guym@ti.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ti/wlcore/rx.c
drivers/net/wireless/ti/wlcore/rx.h

index e125974285cc890e0b40671886815c996ef37a11..7df672a84530b0217378d8f9b66c2e10d31e044e 100644 (file)
@@ -74,7 +74,8 @@ static void wl1271_rx_status(struct wl1271 *wl,
        if (desc->rate <= wl->hw_min_ht_rate)
                status->flag |= RX_FLAG_HT;
 
-       status->signal = desc->rssi;
+       status->signal = ((desc->rssi & RSSI_LEVEL_BITMASK) | BIT(7));
+       status->antenna = ((desc->rssi & ANT_DIVERSITY_BITMASK) >> 7);
 
        /*
         * FIXME: In wl1251, the SNR should be divided by two.  In wl1271 we
index a3b1618db27c202db4377c8e529aee4751c8c32a..f5a7087cfb97831fea0296186d59b3acbc0d7ac5 100644 (file)
@@ -30,6 +30,9 @@
 #define WL1271_RX_MAX_RSSI -30
 #define WL1271_RX_MIN_RSSI -95
 
+#define RSSI_LEVEL_BITMASK     0x7F
+#define ANT_DIVERSITY_BITMASK  BIT(7)
+
 #define SHORT_PREAMBLE_BIT   BIT(0)
 #define OFDM_RATE_BIT        BIT(6)
 #define PBCC_RATE_BIT        BIT(7)