From patchwork Thu Dec 28 12:52:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkateswara Naralasetty X-Patchwork-Id: 10134631 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 E77A06037D for ; Thu, 28 Dec 2017 12:53:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D98582D408 for ; Thu, 28 Dec 2017 12:53:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE3952D410; Thu, 28 Dec 2017 12:53:41 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 3B6242D408 for ; Thu, 28 Dec 2017 12:53:41 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=duLkF49gBJIe+8BR7f4Ay9F8wjpM4FLrjoxD5tR6EfA=; b=JTZCfvAHOsN41O lDq6z2PDkSGhvGII/GsJgwcIExctAVzGUoeWQqDMwlAR1CW637ipa4j2NOWNUvIG7hKIjZi6pPdLW bJ7+P3A19Mt81RKd4MlfMGuRQjnGvfpi8zJAUecimut6l2pwqysWhDf3xPg30S07Fahm4hVcOhCyx Pnh97hjAInLE+Dq2UqtGXJ8sfvbSiWey0ImUSd7les5/qxXC4Vr+c9hfr7UcEJ4MhmAsDZRdB2DQT AJtrjpfpWfDmItPyBmpWtl0wYPO/1NH+gGW75XGh4iVAdoHN60rydunuGcJb2/cBVR++6ALiBuxGr R/TE+n2egXOXRb+4cAQQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eUXgh-0006Df-Aa; Thu, 28 Dec 2017 12:53:31 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eUXgK-0005zT-Fd for ath10k@lists.infradead.org; Thu, 28 Dec 2017 12:53:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1514465588; x=1546001588; h=from:to:cc:subject:date:message-id:mime-version; bh=whvmJFLAP8V26CAYZC94Yz4gPwVdVo4J9j8cOTA5YRY=; b=j526GYUwoWxI2dJiLasNbRz5CwT7P0LRzYpQvWHNlX7rFSOdLuYGwRs5 gkM3/oFGeySuefez5HQQUJk5S/4EzxtwTlUyQx6/KBCSzYoaj6vc7Z1QH gOrdZ9EwiHa5X08X+vIFYaA1XpIdj/XvkxrqlwpGFFLDNrr+Q5FZv52qJ A=; Received: from ironmsg02-r-new.qualcomm.com (HELO ironmsg02-R.qualcomm.com) ([10.53.140.106]) by alexa-out.qualcomm.com with ESMTP; 28 Dec 2017 04:52:56 -0800 X-IronPort-AV: E=McAfee;i="5900,7806,8757"; a="1095118977" X-MGA-submission: =?us-ascii?q?MDHD0+jOhYWV+OZZOYvRQ8/gPrd9A9eU9XAn45?= =?us-ascii?q?50BtfkiciEtG90tCdfsX6SxIn6wjFffrCM2Ti3AX9BJDjYnK84VY7OmT?= =?us-ascii?q?WAovNFLdWnp0zxD0MGI2r2TFVHq39nbl9FV4AiTiwrYUuYC5GEzOcnTU?= =?us-ascii?q?Bn?= Received: from nasanexm03h.na.qualcomm.com ([10.85.0.50]) by ironmsg02-R.qualcomm.com with ESMTP/TLS/AES256-SHA; 28 Dec 2017 04:52:55 -0800 Received: from aphydexm01a.ap.qualcomm.com (10.252.127.10) by nasanexm03h.na.qualcomm.com (10.85.0.50) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Thu, 28 Dec 2017 04:52:54 -0800 Received: from localhost (10.80.80.8) by aphydexm01a.ap.qualcomm.com (10.252.127.10) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Thu, 28 Dec 2017 18:22:50 +0530 From: To: Subject: [PATCHv2] ath10k: Add tx ack signal support for management frames Date: Thu, 28 Dec 2017 18:22:38 +0530 Message-ID: <1514465558-15861-1-git-send-email-vnaralas@qti.qualcomm.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01G.na.qualcomm.com (10.85.0.33) To aphydexm01a.ap.qualcomm.com (10.252.127.10) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171228_045308_694506_E51F3CD0 X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. 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: Venkateswara Naralasetty Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Venkateswara Naralasetty This patch add support to get RSSI from acknowledgment frames for transmitted management frames. hardware_used: QCA4019, QCA9984. firmware version: 10.4-3.5.3-00052. Signed-off-by: Venkateswara Naralasetty --- v2: * renamed HTT_MGMT_TX_CMPL_INFO_ACK_RSSI to HTT_MGMT_TX_CMPL_INFO_ACK_RSSI_MASK * removed WMI_SERVICE_TDLS_WIDER_BANDWIDTH, which has already added recently. drivers/net/wireless/ath/ath10k/core.h | 2 ++ drivers/net/wireless/ath/ath10k/htt.h | 9 ++++++++- drivers/net/wireless/ath/ath10k/htt_rx.c | 7 +++++++ drivers/net/wireless/ath/ath10k/txrx.c | 4 ++++ drivers/net/wireless/ath/ath10k/wmi.h | 13 +++++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index fe6b303..21d9beb 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -51,6 +51,8 @@ /* Antenna noise floor */ #define ATH10K_DEFAULT_NOISE_FLOOR -95 +#define ATH10K_INVALID_RSSI 128 + #define ATH10K_MAX_NUM_MGMT_PENDING 128 /* number of failed packets (20 packets with 16 sw reties each) */ diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h index 7836400..ada680c 100644 --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h @@ -533,12 +533,18 @@ struct htt_ver_resp { u8 rsvd0; } __packed; +#define HTT_MGMT_TX_CMPL_FLAG_ACK_RSSI BIT(0) + +#define HTT_MGMT_TX_CMPL_INFO_ACK_RSSI_MASK GENMASK(7, 0) + struct htt_mgmt_tx_completion { u8 rsvd0; u8 rsvd1; - u8 rsvd2; + u8 flags; __le32 desc_id; __le32 status; + __le32 ppdu_id; + __le32 info; } __packed; #define HTT_RX_INDICATION_INFO0_EXT_TID_MASK (0x1F) @@ -1648,6 +1654,7 @@ struct htt_resp { struct htt_tx_done { u16 msdu_id; u16 status; + u8 ack_rssi; }; enum htt_tx_compl_state { diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 6d96f95..a34d5c7d 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2668,6 +2668,13 @@ bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) switch (status) { case HTT_MGMT_TX_STATUS_OK: tx_done.status = HTT_TX_COMPL_STATE_ACK; + if (test_bit(WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, + ar->wmi.svc_map) && + (resp->mgmt_tx_completion.flags & + HTT_MGMT_TX_CMPL_FLAG_ACK_RSSI)) { + tx_done.ack_rssi = FIELD_GET(HTT_MGMT_TX_CMPL_INFO_ACK_RSSI_MASK, + resp->mgmt_tx_completion.info); + } break; case HTT_MGMT_TX_STATUS_RETRY: tx_done.status = HTT_TX_COMPL_STATE_NOACK; diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index 5b3b021..103b8f5 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -117,6 +117,10 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, (info->flags & IEEE80211_TX_CTL_NO_ACK)) info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED; + if (tx_done->ack_rssi && tx_done->ack_rssi != ATH10K_INVALID_RSSI) + info->status.ack_signal = ATH10K_DEFAULT_NOISE_FLOOR + + tx_done->ack_rssi; + ieee80211_tx_status(htt->ar->hw, msdu); /* we do not own the msdu anymore */ diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index b0ed38c..30b77fd 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -197,6 +197,8 @@ enum wmi_service { WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY, WMI_SERVICE_MGMT_TX_WMI, WMI_SERVICE_TDLS_WIDER_BANDWIDTH, + WMI_SERVICE_RESET_CHIP, + WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, /* keep last */ WMI_SERVICE_MAX, @@ -234,6 +236,8 @@ enum wmi_10x_service { WMI_10X_SERVICE_MESH, WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT, WMI_10X_SERVICE_PEER_STATS, + WMI_10X_SERVICE_RESET_CHIP, + WMI_10X_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, }; enum wmi_main_service { @@ -339,6 +343,7 @@ enum wmi_10_4_service { WMI_10_4_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE, WMI_10_4_SERVICE_TDLS_EXPLICIT_MODE_ONLY, WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH, + WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, }; static inline char *wmi_service_name(int service_id) @@ -448,6 +453,8 @@ static inline char *wmi_service_name(int service_id) SVCSTR(WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE); SVCSTR(WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY); SVCSTR(WMI_SERVICE_TDLS_WIDER_BANDWIDTH); + SVCSTR(WMI_SERVICE_RESET_CHIP); + SVCSTR(WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS); default: return NULL; } @@ -538,6 +545,10 @@ static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out, WMI_SERVICE_EXT_RES_CFG_SUPPORT, len); SVCMAP(WMI_10X_SERVICE_PEER_STATS, WMI_SERVICE_PEER_STATS, len); + SVCMAP(WMI_10X_SERVICE_RESET_CHIP, + WMI_SERVICE_RESET_CHIP, len); + SVCMAP(WMI_10X_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, + WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, len); } static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out, @@ -746,6 +757,8 @@ static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out, WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY, len); SVCMAP(WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH, WMI_SERVICE_TDLS_WIDER_BANDWIDTH, len); + SVCMAP(WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, + WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, len); } #undef SVCMAP