linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
	wcn36xx@lists.infradead.org, linux-arm-msm@vger.kernel.org
Cc: loic.poulain@linaro.org, benl@squareup.com, bryan.odonoghue@linaro.org
Subject: [PATCH v3 1/4] wcn36xx: Implement get_snr()
Date: Sat, 15 Jan 2022 00:16:43 +0000	[thread overview]
Message-ID: <20220115001646.3981501-2-bryan.odonoghue@linaro.org> (raw)
In-Reply-To: <20220115001646.3981501-1-bryan.odonoghue@linaro.org>

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
downstream. This data will be useful to us when implementing
mac80211-ops->get_survey().

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/txrx.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c
index ed4e8f201f510..a3eb476c2cbc4 100644
--- a/drivers/net/wireless/ath/wcn36xx/txrx.c
+++ b/drivers/net/wireless/ath/wcn36xx/txrx.c
@@ -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;
-- 
2.33.0


  reply	other threads:[~2022-01-15  0:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-15  0:16 [PATCH v3 0/4] wcn36xx: Add spectrum survey reporting Bryan O'Donoghue
2022-01-15  0:16 ` Bryan O'Donoghue [this message]
2022-01-15 14:19   ` [PATCH v3 1/4] wcn36xx: Implement get_snr() Loic Poulain
2022-01-17 12:13   ` Kalle Valo
2022-01-19  8:49   ` Kalle Valo
2022-01-15  0:16 ` [PATCH v3 2/4] wcn36xx: Track the band and channel we are tuned to Bryan O'Donoghue
2022-01-15  0:16 ` [PATCH v3 3/4] wcn36xx: Track SNR and RSSI for each RX frame Bryan O'Donoghue
2022-01-15  0:16 ` [PATCH v3 4/4] wcn36xx: Add SNR reporting via get_survey() Bryan O'Donoghue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220115001646.3981501-2-bryan.odonoghue@linaro.org \
    --to=bryan.odonoghue@linaro.org \
    --cc=benl@squareup.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=wcn36xx@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).