Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp74375pxb; Wed, 16 Feb 2022 22:13:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7l4mrjZ/Z+C5GxIKGDlCpCUkXHRcOCHRh5bOCc/viGfO5nTSr7u92444c0Awsl4deKcVT X-Received: by 2002:a63:905:0:b0:35e:14cc:a9e0 with SMTP id 5-20020a630905000000b0035e14cca9e0mr1245877pgj.429.1645078407273; Wed, 16 Feb 2022 22:13:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645078407; cv=none; d=google.com; s=arc-20160816; b=vkD7EhrEn9TxpxXlFu97OfTAtO9wdlFOnr/bfIlcjeONQIiLKPaRMkJTyCnLEWMDM7 ksL/amwGkOnCbDtm3z7gBul8esZMsdS4ziDp7K5F1JFYY5WQHPOFUpvAni1umApUqBhS ppqC5z2IoePAzPghCrz/3NKW91t5gBf2hsyIQWlr/LHebHUIejBDsYu4G6Ws2Oflfdaf quwV2fjPpx85glSHyGU3iSCwre8jhf9+wd28v76Wph7mWyHOestBWbg3wsLEMW3qeTNj 1UGHYxw/Z2pE5znmfU8uA0IdiY7pNAk0vg5AOSzB7FUIJlYPJj7Vc259iXejJKj+t0YI nvOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=HpRE/Smcxl8NGQvUYyDEXcz+rmnjQcxULXnXoKQ73H4=; b=lK7pBH7Np1cDn7OppjChpttkh5YZC4kXENlI9VzqKvCymN1q21w24sxXCDVKswCI3f /XD3miel/uYy8M5/ai1JclkKTIWCNKRxi36iUev6BakistKXSZW/LtCCG7fx4Fs9AGXf 4hKMwIfeN2XQkMNVUrI4SRYDch/kSDa6QVfiUdfcCK86XzB73rIk0YojuMXIsDF0R9J+ wCgXTPJuUE5wgO10CtZ2g6ZG77eGX6O1cCmn3tiTg3MjpTUYFWLTxOG5no6q3WDYtA73 k+xWtV2U7WNPl8eeS1YmlYtXDlrzB/36+ii6HIgX1LGlNG5Bxa6olBRtS6JB+/lRrh7X t02g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=NDPMioq1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp8si74718pjb.165.2022.02.16.22.13.17; Wed, 16 Feb 2022 22:13:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=NDPMioq1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbiBQB0m (ORCPT + 73 others); Wed, 16 Feb 2022 20:26:42 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230314AbiBQB0l (ORCPT ); Wed, 16 Feb 2022 20:26:41 -0500 Received: from so254-9.mailgun.net (so254-9.mailgun.net [198.61.254.9]) by lindbergh.monkeyblade.net (Postfix) with UTF8SMTPS id 2C8DDE7F for ; Wed, 16 Feb 2022 17:26:28 -0800 (PST) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1645061188; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=HpRE/Smcxl8NGQvUYyDEXcz+rmnjQcxULXnXoKQ73H4=; b=NDPMioq1kzIrVut02mx47/yEUX0x9Q2BOyPdMzDSmKEiqn/pks3DPInMX8nAosOsIH97jwW6 iTfXaDmlb2oTp3QEbmzQ2XBF6rN7tyWMO+9KCSVCYEbgtZNirzjnr1UeW9VtCeE4CyS11Hoz Utpd4nRtBrGWQS0h1HSfQCun2RI= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-east-1.postgun.com with SMTP id 620da3123047cf1c0a5f1435 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 17 Feb 2022 01:21:22 GMT Sender: pradeepc=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 9A2E7C4360D; Thu, 17 Feb 2022 01:21:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from pradeepc2-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pradeepc) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5D864C4360C; Thu, 17 Feb 2022 01:21:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 5D864C4360C Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Pradeep Kumar Chitrapu To: ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Pradeep Kumar Chitrapu , Miles Hu , John Crispin Subject: [PATCH v10 1/3] ath11k: switch to using ieee80211_tx_status_ext() Date: Wed, 16 Feb 2022 17:21:10 -0800 Message-Id: <20220217012112.31211-2-pradeepc@codeaurora.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220217012112.31211-1-pradeepc@codeaurora.org> References: <20220217012112.31211-1-pradeepc@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This allows us to pass HE rates down into the stack. Co-developed-by: Miles Hu Signed-off-by: Miles Hu Signed-off-by: John Crispin Signed-off-by: Pradeep Kumar Chitrapu --- drivers/net/wireless/ath/ath11k/dp_tx.c | 32 +++++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c index c7d7631efa5a..6f553a870e70 100644 --- a/drivers/net/wireless/ath/ath11k/dp_tx.c +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c @@ -519,9 +519,13 @@ static void ath11k_dp_tx_complete_msdu(struct ath11k *ar, struct sk_buff *msdu, struct hal_tx_status *ts) { + struct ieee80211_tx_status status = { 0 }; struct ath11k_base *ab = ar->ab; struct ieee80211_tx_info *info; struct ath11k_skb_cb *skb_cb; + struct ath11k_peer *peer; + struct ath11k_sta *arsta; + struct rate_info rate; if (WARN_ON_ONCE(ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM)) { /* Must not happen */ @@ -584,12 +588,30 @@ static void ath11k_dp_tx_complete_msdu(struct ath11k *ar, ath11k_dp_tx_cache_peer_stats(ar, msdu, ts); } - /* NOTE: Tx rate status reporting. Tx completion status does not have - * necessary information (for example nss) to build the tx rate. - * Might end up reporting it out-of-band from HTT stats. - */ + spin_lock_bh(&ab->base_lock); + peer = ath11k_peer_find_by_id(ab, ts->peer_id); + if (!peer || !peer->sta) { + ath11k_dbg(ab, ATH11K_DBG_DATA, + "dp_tx: failed to find the peer with peer_id %d\n", + ts->peer_id); + spin_unlock_bh(&ab->base_lock); + dev_kfree_skb_any(msdu); + goto exit; + } + arsta = (struct ath11k_sta *)peer->sta->drv_priv; + status.sta = peer->sta; + status.skb = msdu; + status.info = info; + rate = arsta->last_txrate; + status.rate = &rate; - ieee80211_tx_status(ar->hw, msdu); + spin_unlock_bh(&ab->base_lock); + rcu_read_unlock(); + + ieee80211_tx_status_ext(ar->hw, &status); + return; +exit: + rcu_read_unlock(); } static inline void ath11k_dp_tx_status_parse(struct ath11k_base *ab, -- 2.17.1