All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Jaap Jan Meijer <jjmeijer88@gmail.com>, linux-wireless@vger.kernel.org
Cc: kvalo@codeaurora.org, brcm80211-dev-list@broadcom.com
Subject: Re: [PATCH v2] brcmfmac: add fallback for devices that do not report per-chain values
Date: Thu, 12 May 2016 23:37:35 +0200	[thread overview]
Message-ID: <5734F79F.1020703@broadcom.com> (raw)
In-Reply-To: <1463070308-30789-1-git-send-email-jjmeijer88@gmail.com>

On 12-05-16 18:25, Jaap Jan Meijer wrote:
> If brcmf_cfg80211_get_station fails to determine the RSSI from the
> per-chain values get the value individually as a fallback.
> 
> Fixes: 1f0dc59a6de9 ("brcmfmac: rework .get_station() callback")

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Jaap Jan Meijer <jjmeijer88@gmail.com>
> ---
> change log:
> v2:
>  - remove beacon period and dtim, these values are obtained differently
>  - add reverence to fixed commit
> ---
>  .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c  | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index d5c2a27..e19847c 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -2480,12 +2480,14 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
>  			   const u8 *mac, struct station_info *sinfo)
>  {
>  	struct brcmf_if *ifp = netdev_priv(ndev);
> +	struct brcmf_scb_val_le scb_val;
>  	s32 err = 0;
>  	struct brcmf_sta_info_le sta_info_le;
>  	u32 sta_flags;
>  	u32 is_tdls_peer;
>  	s32 total_rssi;
>  	s32 count_rssi;
> +	int rssi;
>  	u32 i;
>  
>  	brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac);
> @@ -2569,6 +2571,20 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
>  			sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
>  			total_rssi /= count_rssi;
>  			sinfo->signal = total_rssi;
> +		} else if (test_bit(BRCMF_VIF_STATUS_CONNECTED,
> +			&ifp->vif->sme_state)) {
> +			memset(&scb_val, 0, sizeof(scb_val));
> +			err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
> +						     &scb_val, sizeof(scb_val));
> +			if (err) {
> +				brcmf_err("Could not get rssi (%d)\n", err);
> +				goto done;
> +			} else {
> +				rssi = le32_to_cpu(scb_val.val);
> +				sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
> +				sinfo->signal = rssi;
> +				brcmf_dbg(CONN, "RSSI %d dBm\n", rssi);
> +			}
>  		}
>  	}
>  done:
> 

  reply	other threads:[~2016-05-12 21:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11 19:40 [PATCH] brcmfmac: add fallback for devices that do not report per-chain values Jaap Jan Meijer
2016-05-11 20:55 ` Arend van Spriel
2016-05-12  6:32   ` Kalle Valo
2016-05-12 16:19     ` Jaap Jan Meijer
2016-05-12 16:25       ` [PATCH v2] " Jaap Jan Meijer
2016-05-12 21:37         ` Arend van Spriel [this message]
2016-05-13 10:42         ` Kalle Valo
2016-05-27 17:52         ` [v2] " Kalle Valo

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=5734F79F.1020703@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list@broadcom.com \
    --cc=jjmeijer88@gmail.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.