wifi: brcmfmac: support CQM RSSI notification with older firmware
authorJohn Keeping <john@metanate.com>
Tue, 24 Jan 2023 10:42:48 +0000 (10:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:17 +0000 (23:03 +0900)
commit0022a3936e4ddd41a732341c887ff1c297bf7be9
tree9a6e4cbb38ce4f4b7b145cb85bcb6079b66e2a65
parent9354826c02e04e2ae4cdc4cb567baa67a9c2e11d
wifi: brcmfmac: support CQM RSSI notification with older firmware

[ Upstream commit ec52d77d077529f198fd874c550a26b9cc86a331 ]

Using the BCM4339 firmware from linux-firmware (version "BCM4339/2 wl0:
Sep  5 2019 11:05:52 version 6.37.39.113 (r722271 CY)" from
cypress/cyfmac4339-sdio.bin) the RSSI respose is only 4 bytes, which
results in an error being logged.

It seems that older devices send only the RSSI field and neither SNR nor
noise is included.  Handle this by accepting a 4 byte message and
reading only the RSSI from it.

Fixes: 7dd56ea45a66 ("brcmfmac: add support for CQM RSSI notifications")
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230124104248.2917465-1-john@metanate.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c