Some RX descriptors from the FW have an RSSI level of 0. wl1271_rx_status() always sets the sign bit, so these frames are reported as -128 dBm and end up in the station's last signal, its signal average, and BSS entries built from received frames. Before the commit below they were reported as 0 dBm. Set RX_FLAG_NO_SIGNAL_VAL for them instead. Found while testing the following commit, which makes mac80211 report the last RX signal right after association: on WL1807MOD (FW 8.9.1.0.2), signal_poll returned -128 in 10 of 14 reconnects without this patch, and in none with it. An AI assistant (Claude) helped analyse the code and draft this patch. Fixes: 5d6af28a2d24 ("wlcore: add antenna diversity reading") Signed-off-by: Leav Oz-Ari --- drivers/net/wireless/ti/wlcore/rx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c index 4d6f5a047..95c7c00b5 100644 --- a/drivers/net/wireless/ti/wlcore/rx.c +++ b/drivers/net/wireless/ti/wlcore/rx.c @@ -69,6 +69,10 @@ static void wl1271_rx_status(struct wl1271 *wl, status->signal = ((desc->rssi & RSSI_LEVEL_BITMASK) | BIT(7)); status->antenna = ((desc->rssi & ANT_DIVERSITY_BITMASK) >> 7); + /* some frames carry no RSSI; don't report them as -128 dBm */ + if (!(desc->rssi & RSSI_LEVEL_BITMASK)) + status->flag |= RX_FLAG_NO_SIGNAL_VAL; + /* * FIXME: In wl1251, the SNR should be divided by two. In wl1271 we * need to divide by two for now, but TI has been discussing about -- 2.53.0