OSDN Git Service

wcn36xx: Implement get_snr()
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Sat, 15 Jan 2022 00:16:43 +0000 (00:16 +0000)
committerKalle Valo <quic_kvalo@quicinc.com>
Wed, 19 Jan 2022 08:49:14 +0000 (10:49 +0200)
The wcn36xx BD phy descriptor returns both Received Signal Strength
Information (RSSI) and Signal To Noise Ratio (SNR) with each delivered BD.

The macro to extract this data is a simple-one liner, easily imported from
prima driver. This data will be useful to us when implementing
mac80211-ops->get_survey().

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220115001646.3981501-2-bryan.odonoghue@linaro.org
drivers/net/wireless/ath/wcn36xx/txrx.c

index dd58dde..425d388 100644 (file)
@@ -23,6 +23,11 @@ static inline int get_rssi0(struct wcn36xx_rx_bd *bd)
        return 100 - ((bd->phy_stat0 >> 24) & 0xff);
 }
 
+static inline int get_snr(struct wcn36xx_rx_bd *bd)
+{
+       return ((bd->phy_stat1 >> 24) & 0xff);
+}
+
 struct wcn36xx_rate {
        u16 bitrate;
        u16 mcs_or_legacy_index;