From patchwork Wed Feb 13 14:12:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pillai X-Patchwork-Id: 10810015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2ED5C1390 for ; Wed, 13 Feb 2019 14:12:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A2EF2D2F8 for ; Wed, 13 Feb 2019 14:12:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 177912D2F6; Wed, 13 Feb 2019 14:12:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7FFF92D302 for ; Wed, 13 Feb 2019 14:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=JnXYvH1TDLKEJNuB5HTAvJFTdwOQbYjQx4jI5J40EWo=; b=NoC FCQRf3dCu0hdPE6wDagKTnucST9D/ASRxPY+JkPANLKncYsqQkok8JykcpWFFNKqxsWY5cwLY6smG 7uF/HKJh7F9k7TXOLOUGftHbI1odqcLBrrWJOmCgiugugFkXXcOp8jTWK7dtOK7G5jtAre/bvnpIh Z3j2u05G4E1jnrnjJfTSgRuNeQ8dph71zw1yaaW327si0Fp0dxHx2q0oqgR3N74midyl4+zZOyM85 dfa4+6xLPKeZpIRJsAD6E2pf8RQGoHrWzVbeESKbmS2v0lzzGC+XtPOGTamrJRozX/mE192gGnwO5 XV1FS5o4IxYy6FF9gcnqc/2Kgo1wzyA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtvHO-0004XZ-2l; Wed, 13 Feb 2019 14:12:50 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtvHL-0004Um-7H for ath10k@lists.infradead.org; Wed, 13 Feb 2019 14:12:48 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id AAAAA60960; Wed, 13 Feb 2019 14:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550067164; bh=FfbnkInw/xz1x7lH3WXzSutRZmdoYxn85ofqibEiAI8=; h=From:To:Cc:Subject:Date:From; b=P6CUhhF1t/XdlUtj+5S010cAkt6KBeE2Kw7Zjs8SpzITd5oknvS2U94e+e+3A/wBT XgPfoBmOcs9ZuNo14C7HrhsRnKiuhoKAP3O45PiUQIS+OUglIhcc9ezMyG+TVbABJv 09oDDfvT3rktE14j0XHYxTVXkrKTdsNXKjT6KFv4= Received: from pillair-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pillair@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 691D36086B; Wed, 13 Feb 2019 14:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550067162; bh=FfbnkInw/xz1x7lH3WXzSutRZmdoYxn85ofqibEiAI8=; h=From:To:Cc:Subject:Date:From; b=NRldXanX1F/8xd38OJ1aJzO96n+kg1M6zyF3FOkQDA3DPfIqU7tOWVqZTFK5xxHsB 5VznbfQFu2Q1qL/5KjjgUyatfBsOAFDXABV0pcxvn8TrGtSwx9PKXx2KiNmzvWkBe7 b4ouBPJHR+uS3rvo7Ovf1j4iRQrhBl2EmU299zXo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 691D36086B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pillair@codeaurora.org From: Rakesh Pillai To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: Report low ack rssi based on the reason code Date: Wed, 13 Feb 2019 19:42:30 +0530 Message-Id: <1550067150-8796-1-git-send-email-pillair@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190213_061247_311915_E35D15E1 X-CRM114-Status: GOOD ( 12.64 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rakesh Pillai , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 ++ drivers/net/wireless/ath/ath10k/wmi.c | 9 ++++++--- drivers/net/wireless/ath/ath10k/wmi.h | 12 ++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 90617e1..63ca9c5 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -885,6 +885,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.c b/drivers/net/wireless/ath/ath10k/wmi.c index b99b3a1..75707d6b 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -3393,9 +3393,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); @@ -3405,10 +3402,16 @@ 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; + ieee80211_report_low_ack(sta, 10); exit: rcu_read_unlock(); + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi event peer sta kickout %pM reason code %d\n", + arg.mac_addr, arg.reason); } /* diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 1f82f10..492ce0f 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -6498,6 +6498,7 @@ struct wmi_10_4_chan_info_event { struct wmi_peer_sta_kickout_event { struct wmi_mac_addr peer_macaddr; + __le32 reason; } __packed; #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0) @@ -6737,6 +6738,8 @@ struct wmi_vdev_start_ev_arg { struct wmi_peer_kick_ev_arg { const u8 *mac_addr; + u32 reason; + bool reason_code_valid; }; struct wmi_swba_ev_arg { @@ -6827,6 +6830,15 @@ struct wmi_pdev_bss_chan_info_event { __le32 reserved; } __packed; +enum wmi_peer_sta_kickout_reason { + WMI_PEER_STA_KICKOUT_REASON_UNSPECIFIED, + WMI_PEER_STA_KICKOUT_REASON_XRETRY, + WMI_PEER_STA_KICKOUT_REASON_INACTIVITY, + WMI_PEER_STA_KICKOUT_REASON_IBSS_DISCONNECT, + WMI_PEER_STA_KICKOUT_REASON_TDLS_DISCONNECT, + WMI_PEER_STA_KICKOUT_REASON_SA_QUERY_TIMEOUT, +}; + /* WOW structures */ enum wmi_wow_wakeup_event { WOW_BMISS_EVENT = 0,