Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7355294rwr; Tue, 25 Apr 2023 11:39:20 -0700 (PDT) X-Google-Smtp-Source: AKy350YvI1U8ccWzZSCFg5zHi3UzB2MLNW2apqKqMBw6YTh4ajkg4fpTraWpH2Js51dvgSH03oZ2 X-Received: by 2002:a17:902:70c7:b0:1a5:dfd:d167 with SMTP id l7-20020a17090270c700b001a50dfdd167mr9031548plt.8.1682447960433; Tue, 25 Apr 2023 11:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682447960; cv=none; d=google.com; s=arc-20160816; b=ZrTexudICe4OpdRMg2zDHvonA4CmuuWj6WhlyvJI3QAAdjO26yr6NNgmE3QF9qZQIL 3+iDiWsdFj/QBqdgzRlVYZVbECC+rztcHtwTp3vmgfSfTsQchp2/XZIQb4xjWnQRgFnA Qq9pRltnvlkScOCLIsBGu+gkwtR9wwX+G6+aAr8jKkMUGLsI+wwmOh37LX/F6HF179Bw icozvCc5mUZG0LH2LCOz2lhMCJ21s71VBefIabjU1kaYr9VbhKyzDFQNhQweJEKRp5Y4 REboVQL+Mu+5EWxMMHpSTJJQ6B5x/ezZR8vpw9H4H7pQj16U26Uei3oyuXElr+tKO+9O JzKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=s4FvWSqMiOBPOzhODz7wI+80TVwIjGjbEnBS1kGAvbo=; b=WQ0CCblnesKb07hWxwlw8prdD9Y1snSbyV4qBR9oXCX4Xj7/t0IXuglZv0KMJoTe9z vK3GzKSqRVAmmUnRsU906gGVeE34hxSm5x2Bd4+IKU0li3miWcCmaQ1Uj3H2Rtyj2CLF d1+TRQ5m8vPK80SXK1OZmLB4fN8f8qw+4KakZgKdLyhXqywkeMrLG6N3ro6c2nWlVA1Z D65at4zA7H5PEQ9JT5fx26YYJmJIjunbf+SmRU4OQimGRP1kzenm5a6e8eujhES1Swzi CdiXK/KIlcQs/aawhQXWmnw87rdZ4uUh9VVXKFTmSHPFG2M4/bwBSf62fLf9KbZthqYw uALQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=l8BaiqUj; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a17090341cc00b001a664075202si15116751ple.542.2023.04.25.11.39.12; Tue, 25 Apr 2023 11:39:20 -0700 (PDT) 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=@mediatek.com header.s=dk header.b=l8BaiqUj; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234560AbjDYSch (ORCPT + 63 others); Tue, 25 Apr 2023 14:32:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234503AbjDYScc (ORCPT ); Tue, 25 Apr 2023 14:32:32 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 788ACCC19 for ; Tue, 25 Apr 2023 11:32:28 -0700 (PDT) X-UUID: 84dca9a8e39711eda9a90f0bb45854f4-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=s4FvWSqMiOBPOzhODz7wI+80TVwIjGjbEnBS1kGAvbo=; b=l8BaiqUj1e7cgLT5rXqEliiSHAUklFpAjYaZtWhiEliKOvsXjJ0yQdjRJVM6YjUthkninA0JCgTKgG8K5zm2Iz/4qEtM8LTccop1mr089EN4pAVPYfe3d+WkRNa61PPn/E05401kADU46NwoGFp0CmqxUW88wkUtRitlRPyqK48=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:02ec4e34-639a-4d13-ae01-3e59e2a5b8c0,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.22,REQID:02ec4e34-639a-4d13-ae01-3e59e2a5b8c0,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:120426c,CLOUDID:b6727ca2-8fcb-430b-954a-ba3f00fa94a5,B ulkID:230426023224SYFO5X4A,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 84dca9a8e39711eda9a90f0bb45854f4-20230426 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 418966747; Wed, 26 Apr 2023 02:32:22 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 26 Apr 2023 02:32:17 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 02:32:17 +0800 From: Ryder Lee To: Felix Fietkau , CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , Peter Chiu , Ryder Lee Subject: [PATCH v2 3/3] wifi: mt76: report non-binding skb tx rate when WED is active Date: Wed, 26 Apr 2023 02:32:15 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 In-Reply-To: <8febf5d1f44e7f0b1e9f6ca099bd5ffcc8816f86.1682446940.git.ryder.lee@mediatek.com> References: <8febf5d1f44e7f0b1e9f6ca099bd5ffcc8816f86.1682446940.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Peter Chiu AQL relies on accurate tx rate reporting, so add this patch for non-binding skb rate when WED is enabled. Co-developed-by: Ryder Lee Signed-off-by: Ryder Lee Signed-off-by: Peter Chiu --- drivers/net/wireless/mediatek/mt76/tx.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c index 99d395bd1bba..37337595c65d 100644 --- a/drivers/net/wireless/mediatek/mt76/tx.c +++ b/drivers/net/wireless/mediatek/mt76/tx.c @@ -269,8 +269,22 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff * #endif if (cb->pktid < MT_PACKET_ID_FIRST) { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_rate_status rs = {}; + hw = mt76_tx_status_get_hw(dev, skb); status.sta = wcid_to_sta(wcid); + if (mtk_wed_device_active(&dev->mmio.wed) && + (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS)) { + info->status.rates[0].idx = -1; + if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) { + rs.rate_idx = wcid->rate; + status.rates = &rs; + status.n_rates = 1; + } else { + status.n_rates = 0; + } + } spin_lock_bh(&dev->rx_lock); ieee80211_tx_status_ext(hw, &status); spin_unlock_bh(&dev->rx_lock); -- 2.18.0