From: Arend van Spriel <arend@broadcom.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Hante Meuleman <meuleman@broadcom.com>,
Arend van Spriel <arend@broadcom.com>
Subject: [PATCH 07/11] brcmfmac: Add RSSI information to get_station.
Date: Thu, 8 Oct 2015 20:33:17 +0200 [thread overview]
Message-ID: <1444329201-3696-8-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1444329201-3696-1-git-send-email-arend@broadcom.com>
From: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 23 ++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
index 73eddad..ca9d239 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
@@ -2432,6 +2432,9 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
struct brcmf_sta_info_le sta_info_le;
u32 sta_flags;
u32 is_tdls_peer;
+ s32 total_rssi;
+ s32 count_rssi;
+ u32 i;
brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac);
if (!check_vif_up(ifp->vif))
@@ -2492,6 +2495,26 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
sinfo->filled |= BIT(NL80211_STA_INFO_RX_BYTES);
sinfo->rx_bytes = le64_to_cpu(sta_info_le.rx_tot_bytes);
}
+ total_rssi = 0;
+ count_rssi = 0;
+ for (i = 0; i < BRCMF_ANT_MAX; i++) {
+ if (sta_info_le.rssi[i]) {
+ sinfo->chain_signal_avg[count_rssi] =
+ sta_info_le.rssi[i];
+ sinfo->chain_signal[count_rssi] =
+ sta_info_le.rssi[i];
+ total_rssi += sta_info_le.rssi[i];
+ count_rssi++;
+ }
+ }
+ if (count_rssi) {
+ sinfo->filled |= BIT(NL80211_STA_INFO_CHAIN_SIGNAL);
+ sinfo->chains = count_rssi;
+
+ sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
+ total_rssi /= count_rssi;
+ sinfo->signal = total_rssi;
+ }
}
done:
brcmf_dbg(TRACE, "Exit\n");
--
1.9.1
next prev parent reply other threads:[~2015-10-08 18:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-08 18:33 [PATCH 00/11] brcmfmac: cfg80211 callbacks and coredump Arend van Spriel
2015-10-08 18:33 ` [PATCH 01/11] brcmfmac: expose device memory to devcoredump subsystem Arend van Spriel
2015-10-08 18:59 ` kbuild test robot
2015-10-12 8:59 ` Kalle Valo
2015-10-12 20:05 ` Arend van Spriel
2015-10-14 11:01 ` Kalle Valo
2015-10-14 13:36 ` Arend van Spriel
2015-10-15 10:06 ` Kalle Valo
2015-10-21 7:57 ` [01/11] " Kalle Valo
2015-10-08 18:33 ` [PATCH 02/11] brcmfmac: Fix race condition between USB probe/load and disconnect Arend van Spriel
2015-10-08 18:33 ` [PATCH 03/11] brcmfmac: rename firmware_path to alternative_fw_path Arend van Spriel
2015-10-08 18:33 ` [PATCH 04/11] brcmfmac: remove conversational comment Arend van Spriel
2015-10-08 18:33 ` [PATCH 05/11] brcmfmac: Rework p2p attach, use single method for p2p dev creation Arend van Spriel
2015-10-08 18:33 ` [PATCH 06/11] brcmfmac: Fix station info rate information Arend van Spriel
2015-10-08 18:33 ` Arend van Spriel [this message]
2015-10-08 18:33 ` [PATCH 08/11] brcmfmac: Add dump_station support to cfg80221 ops Arend van Spriel
2015-10-08 18:33 ` [PATCH 09/11] brcmfmac: Move brcmf_c_preinit_dcmds prototype to correct file Arend van Spriel
2015-10-08 18:33 ` [PATCH 10/11] brcmfmac: Remove unused state AP creating Arend van Spriel
2015-10-08 18:33 ` [PATCH 11/11] brcmfmac: Properly set carrier state of netdev Arend van Spriel
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=1444329201-3696-8-git-send-email-arend@broadcom.com \
--to=arend@broadcom.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=meuleman@broadcom.com \
/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).