Skip to contentSkip to conversation

wlcore: add antenna diversity reading

PATCH Applied Guy Mishol 2 participants 2 messages Jul 16, 2015 – Jul 21, 2015 TI wilink wireless drivers

lore
Share & tools
lore

Guy Mishol

author
#0 lore raw

PATCH 1/1 wlcore: add antenna diversity reading

update the rssi reading on rx_status
to read both RSSI level (7 bits) and
antenna diversity (msb)

---
 drivers/net/wireless/ti/wlcore/rx.c |    3 ++-
 drivers/net/wireless/ti/wlcore/rx.h |    3 +++
 2 files changed, 5 insertions(+), 1 deletions(-)
drivers/net/wireless/ti/wlcore/rx.c +2 -1
index 3844944..c2f673f 100644
@@ -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
drivers/net/wireless/ti/wlcore/rx.h +3 -0
index a3b1618..f5a7087c 100644
@@ -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)
Signature · 1 line
1.7.9
Applied
#1 lore raw
Quoted 6 lines

update the rssi reading on rx_status
to read both RSSI level (7 bits) and
antenna diversity (msb)

Thanks, applied to wireless-drivers-next.git.

Kalle Valo