Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wlcore: add antenna diversity reading

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>

authored by

Guy Mishol and committed by
Kalle Valo
5d6af28a 6301566e

+5 -1
+2 -1
drivers/net/wireless/ti/wlcore/rx.c
··· 74 74 if (desc->rate <= wl->hw_min_ht_rate) 75 75 status->flag |= RX_FLAG_HT; 76 76 77 - status->signal = desc->rssi; 77 + status->signal = ((desc->rssi & RSSI_LEVEL_BITMASK) | BIT(7)); 78 + status->antenna = ((desc->rssi & ANT_DIVERSITY_BITMASK) >> 7); 78 79 79 80 /* 80 81 * FIXME: In wl1251, the SNR should be divided by two. In wl1271 we
+3
drivers/net/wireless/ti/wlcore/rx.h
··· 30 30 #define WL1271_RX_MAX_RSSI -30 31 31 #define WL1271_RX_MIN_RSSI -95 32 32 33 + #define RSSI_LEVEL_BITMASK 0x7F 34 + #define ANT_DIVERSITY_BITMASK BIT(7) 35 + 33 36 #define SHORT_PREAMBLE_BIT BIT(0) 34 37 #define OFDM_RATE_BIT BIT(6) 35 38 #define PBCC_RATE_BIT BIT(7)