From patchwork Thu Jul 19 13:26:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balaji Pothunoori X-Patchwork-Id: 10534405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4D3B600F4 for ; Thu, 19 Jul 2018 13:27:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D3FF2989F for ; Thu, 19 Jul 2018 13:27:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 918CA298A8; Thu, 19 Jul 2018 13:27:14 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham 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 3C4B62989F for ; Thu, 19 Jul 2018 13:27:14 +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:References: In-Reply-To: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:List-Owner; bh=ZYVUvi0g9URyw73cH3vXNQPLj6AQeW4EsG2XoMTTGUE=; b=B0Drfw/GunGoxlnQg/BBLYV4OL edwZeL3c7yC3ivG8vDP6rgLPeE95gGGB7fuf33/H+sDXqF8mweGm96rf4LOf76nTOJVNT8XxLU/pt i2E/M+gfik0ZkXwx65R9RhwehBjkLS/roE6uj3kZ9sH1EWt+0oY2aSrsMgyDxd13prHBkHJXwBSg1 LKNFPySIOL/PmcY1uH27NdfXW0cHd/0Oxr25u9DRcXrVZ1OfbD7vUqD0BixNPfL4BTcg8HX4yqIQf zjZnh//i2QtoDiOY7ZEBgS7M0mbqIwi3buNOSAGX/UAvrGyOHn+Z/64EHRIZBS6JXQwPk9xyrRoHt IO3XfatQ==; 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 1fg8xa-00019M-Ba; Thu, 19 Jul 2018 13:27:10 +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 1fg8xX-00010D-F8 for ath10k@lists.infradead.org; Thu, 19 Jul 2018 13:27:09 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2921960116; Thu, 19 Jul 2018 13:26:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532006817; bh=PUse/wTGPxoTAtPq04WqNLkE2U7wfqiSUOwfFcaqkYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CFyWIx7sUVhU34nPt5EifuaFM+zlfWSHAxohGG6e53FusiXHLqDYtw6SqwWFrhKgI 8sObNRwRrbojVs2aO1EvncXsl0c15cqOKcTdXGVWUaLYg3Gwe6HmMgs3YZaQenboa8 +9bmUCj3RxfuFd59QIH5fgS4i/tf+p/NJn7iSnsQ= Received: from tejas.qca.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: bpothuno@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 689F1606DB; Thu, 19 Jul 2018 13:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532006816; bh=PUse/wTGPxoTAtPq04WqNLkE2U7wfqiSUOwfFcaqkYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UfeChl8NBgOSBEqAG1DqAxAQrjLf7dwqFiOEzN1E4YoqQ8keJCCaqJJ+f6xGffGCT JXvVQ1CnyFumgOOfbSIRUj0gFOFpi76N8zE0FOtojfNyv+/0iM3yVgOdZcWe/oEqy9 jYMz0lwmDvZVzXZrnBI/Rne+XaFXA1Cm5SuSMFmw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 689F1606DB 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=bpothuno@codeaurora.org From: Balaji Pothunoori To: johannes@sipsolutions.net, ath10k@lists.infradead.org Subject: [PATCH v2 2/3] mac80211: Extend avg ack rssi support for mgmt frames Date: Thu, 19 Jul 2018 18:56:28 +0530 Message-Id: <1532006789-32454-3-git-send-email-bpothuno@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1532006789-32454-1-git-send-email-bpothuno@codeaurora.org> References: <1532006789-32454-1-git-send-email-bpothuno@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180719_062707_538442_B45D06C2 X-CRM114-Status: GOOD ( 10.12 ) 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: Balaji Pothunoori , 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 Used defined API to make common average ack rssi support irrespective of data or mamagement tx ack packet. Signed-off-by: Balaji Pothunoori --- v2: Addressed Johannes comments Modified subject and commit log net/mac80211/sta_info.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index aa8fe77..1364f0b 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -2317,19 +2317,19 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo, sinfo->expected_throughput = thr; } - if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL)) && - sta->status_stats.ack_signal_filled) { - sinfo->ack_signal = sta->status_stats.last_ack_signal; - sinfo->filled |= BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL); - } - - if (ieee80211_hw_check(&sta->local->hw, REPORTS_TX_ACK_STATUS) && - !(sinfo->filled & BIT_ULL(NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG))) { - sinfo->avg_ack_signal = - -(s8)ewma_avg_signal_read( - &sta->status_stats.avg_ack_signal); - sinfo->filled |= - BIT_ULL(NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG); + if (ieee80211_hw_check(&sta->local->hw, REPORTS_TX_ACK_STATUS)) { + if (sta->status_stats.ack_signal_filled && + (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL)) || + !(sinfo->filled & BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG)))) { + sinfo->ack_signal = + sta->status_stats.last_ack_signal; + sinfo->filled |= + BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL); + sinfo->avg_ack_signal = + -(s8)ewma_avg_signal_read(&sta->status_stats.avg_ack_signal); + sinfo->filled |= + BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG); + } } }