Skip to content

Commit

Permalink
wlcore: add antenna diversity reading
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guy Mishol authored and Kalle Valo committed Jul 21, 2015
1 parent 6301566 commit 5d6af28
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/wireless/ti/wlcore/rx.c
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions drivers/net/wireless/ti/wlcore/rx.h
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 5d6af28

Please sign in to comment.