linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wlcore: add antenna diversity reading
@ 2015-07-16  8:22 Guy Mishol
  2015-07-21 15:08 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Guy Mishol @ 2015-07-16  8:22 UTC (permalink / raw)
  To: linux-wireless; +Cc: Guy Mishol

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>
---
 drivers/net/wireless/ti/wlcore/rx.c |    3 ++-
 drivers/net/wireless/ti/wlcore/rx.h |    3 +++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c
index 3844944..c2f673f 100644
--- a/drivers/net/wireless/ti/wlcore/rx.c
+++ b/drivers/net/wireless/ti/wlcore/rx.c
@@ -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
diff --git a/drivers/net/wireless/ti/wlcore/rx.h b/drivers/net/wireless/ti/wlcore/rx.h
index a3b1618..f5a7087c 100644
--- a/drivers/net/wireless/ti/wlcore/rx.h
+++ b/drivers/net/wireless/ti/wlcore/rx.h
@@ -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)
-- 
1.7.9


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: wlcore: add antenna diversity reading
  2015-07-16  8:22 [PATCH] wlcore: add antenna diversity reading Guy Mishol
@ 2015-07-21 15:08 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-07-21 15:08 UTC (permalink / raw)
  To: Guy Mishol; +Cc: linux-wireless, Guy Mishol


> 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>

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

Kalle Valo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-21 15:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16  8:22 [PATCH] wlcore: add antenna diversity reading Guy Mishol
2015-07-21 15:08 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).