linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Oh <peter.oh@bowerswilkins.com>
To: Rakesh Pillai <pillair@codeaurora.org>,
	"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v2] ath10k: Report low ack rssi based on the reason code
Date: Wed, 3 Apr 2019 16:58:51 +0000	[thread overview]
Message-ID: <5f25f471-5753-7d4a-91f8-9a3986117580@bowerswilkins.com> (raw)
In-Reply-To: <1554276181-7879-1-git-send-email-pillair@codeaurora.org>



On 04/03/2019 12:23 AM, Rakesh Pillai wrote:
> Firmware sends peer sta kickout event to the driver
> along with the reason code for a particular peer.
>
> Currently the sta kickout event is delivered to the
> upper layer without checking if the reason code is
> valid or not. This causes frequent disconnection of
> the STA.
>
> Report low ack rssi event to mac80211 only if the reason
> code is valid.
>
> Tested HW: WCN3990
> Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1
>
> Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
> ---
> Changes from v1:
> - Added reason code in tlv structure, so that it does not break non-tlv wmi event parsing.
> ---
>   drivers/net/wireless/ath/ath10k/wmi-tlv.c |  4 +++-
>   drivers/net/wireless/ath/ath10k/wmi-tlv.h |  5 +++++
>   drivers/net/wireless/ath/ath10k/wmi.c     |  9 ++++++---
>   drivers/net/wireless/ath/ath10k/wmi.h     | 11 +++++++++++
>   4 files changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
> index 582fb11..9d6ee92 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
> @@ -876,7 +876,7 @@ static int ath10k_wmi_tlv_op_pull_peer_kick_ev(struct ath10k *ar,
>   					       struct wmi_peer_kick_ev_arg *arg)
>   {
>   	const void **tb;
> -	const struct wmi_peer_sta_kickout_event *ev;
> +	const struct wmi_tlv_peer_sta_kickout_event *ev;
>   	int ret;
>   
>   	tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
> @@ -893,6 +893,8 @@ static int ath10k_wmi_tlv_op_pull_peer_kick_ev(struct ath10k *ar,
>   	}
>   
>   	arg->mac_addr = ev->peer_macaddr.addr;
> +	arg->reason = __le32_to_cpu(ev->reason);
> +	arg->reason_code_valid = true;
>   
>   	kfree(tb);
>   	return 0;
> diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
> index 65e6aa5..be68ac6 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
> +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
> @@ -1984,6 +1984,11 @@ struct wmi_tlv_diag_data_ev {
>   	__le32 num_items;
>   } __packed;
>   
> +struct wmi_tlv_peer_sta_kickout_event {
> +	struct wmi_mac_addr peer_macaddr;
> +	__le32 reason;
> +} __packed;
> +
>   struct wmi_tlv_sta_keepalive_cmd {
>   	__le32 vdev_id;
>   	__le32 enabled;
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
> index 98a90e4..6603c31 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -3428,9 +3428,6 @@ void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb)
>   		return;
>   	}
>   
> -	ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi event peer sta kickout %pM\n",
> -		   arg.mac_addr);
> -
>   	rcu_read_lock();
>   
>   	sta = ieee80211_find_sta_by_ifaddr(ar->hw, arg.mac_addr, NULL);
> @@ -3440,6 +3437,12 @@ void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb)
>   		goto exit;
>   	}
>   
> +	if (arg.reason_code_valid &&
> +	    arg.reason == WMI_PEER_STA_KICKOUT_REASON_UNSPECIFIED)
> +		goto exit;
> +
Why do we want this event not to be delivered to user space?
> +	ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi event peer sta kickout %pM reason code %d\n",
> +		   arg.mac_addr, arg.reason);
>   	ieee80211_report_low_ack(sta, 10);
>   
>   exit:
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
> index e1c40bb..3ccd79e 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.h
> +++ b/drivers/net/wireless/ath/ath10k/wmi.h
> @@ -6797,6 +6797,8 @@ struct wmi_vdev_start_ev_arg {
>   
>   struct wmi_peer_kick_ev_arg {
>   	const u8 *mac_addr;
> +	u32 reason;
> +	bool reason_code_valid;
>   };
>   
Adding extra members to this structure breaks structure consistency 
between FW and host driver since FW doesn't have such members.

Peter

  reply	other threads:[~2019-04-03 16:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03  7:23 [PATCH v2] ath10k: Report low ack rssi based on the reason code Rakesh Pillai
2019-04-03 16:58 ` Peter Oh [this message]
     [not found]   ` <8c3110f20aec4c4a90bb679c4551b1fc@aphydexm01b.ap.qualcomm.com>
2019-04-04 12:11     ` FW: " Rakesh Pillai
2019-10-03 13:03   ` 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=5f25f471-5753-7d4a-91f8-9a3986117580@bowerswilkins.com \
    --to=peter.oh@bowerswilkins.com \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pillair@codeaurora.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).