Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6766006rwr; Tue, 9 May 2023 21:56:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5w3BWmn1jo8G1MwpLhXnKD+Hj/3XcozgYu+B0JYEUdOsf49blJXaO13dmo2l+/El20i672 X-Received: by 2002:a05:6a20:1584:b0:100:eb6e:8d0a with SMTP id h4-20020a056a20158400b00100eb6e8d0amr8750128pzj.44.1683694583902; Tue, 09 May 2023 21:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683694583; cv=none; d=google.com; s=arc-20160816; b=GWOLZjbmWha9aWSdcqaSHtvZxQBf+qHB6QCk/kJx7fTijT+rvMlvb1XaynhEoLgtz6 z1p88jFx7xINlRGPnzd/COPRj+4cO5BO5xC3zlkwXFKgFef506rnCaGC88FXbrUhku2I rZVKd5/6hE6w7ZwNSANrqjuR/PBTp7Rc3hfPk7H0ybVuX2PWgblv6MHlJz0hzah+CJ/R BnUUqguwe6+WioewkomspOAQYktOSr2zchzDTLD3k3QOiqqZCV0oAvfXL4h5E6p1Rkd/ MWVXeVFIYmQo3/8Q67zBvH3Srh63xctgJZmdiN6TUy1eVbVUNKicUPnosfTI3l/ZKT7c Duxw== 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=Nt2hHib5mf6xyYGxVJ/P2VnqopjDuIJovEZBziMyC5s=; b=lTkOA4g1LG+srp15IsiCVERbbUjlWhK9oqRxA+68SF5l3flcbHb7WyvDHpD1938S9x W0hpxCVgz+CD85ILSc5unsvdavoZ9UyY9Skqpe8n8cHToOypfya3w6XOL0s2ar3l/1BZ OUZogEXrQKmNfJOaRD6/vXoa+qYduYK7FSQG2eglQcJsOkflLROVIlLNa783QhenmHei eH2HSWRvfEmSiJfRSwM9WqNoYHPSYy3shfCWLKlta36UKKx5VZzQxGNSESAO+FP7YQJW Eat1PXviHfKrCS83/QMHXgTTuYw0FjnvWkGerd+wT826WnouTkUqNh95s+XLGTOnzQK5 Mgkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=MI7iQj2I; 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 l1-20020a639841000000b005301be3eed8si3083805pgo.811.2023.05.09.21.56.16; Tue, 09 May 2023 21:56:23 -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=MI7iQj2I; 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 S235525AbjEJExh (ORCPT + 61 others); Wed, 10 May 2023 00:53:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234911AbjEJExc (ORCPT ); Wed, 10 May 2023 00:53:32 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2A74E5C for ; Tue, 9 May 2023 21:53:30 -0700 (PDT) X-UUID: 991dadceeeee11edb20a276fd37b9834-20230510 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=Nt2hHib5mf6xyYGxVJ/P2VnqopjDuIJovEZBziMyC5s=; b=MI7iQj2IJfUiUjT3LjAhkhGbo1LcAqyHEMKc6AjasYXx9nAv/5BWUxpeuDZFIqRqmcTHC19QVfjl+7PsNmiQ1sKwQEjYWEcyHAmwJqqlmDSHB0+l9YX016jkPVlhssJZFSqeE6HLS9MwEvyf92vjT+LxZmKA/l5eb7Gm6rKyToU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.24,REQID:e0dedce2-037a-45c5-a8b5-211e936141d7,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:178d4d4,CLOUDID:27a4526b-2f20-4998-991c-3b78627e4938,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 991dadceeeee11edb20a276fd37b9834-20230510 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 720066426; Wed, 10 May 2023 12:53:25 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 10 May 2023 12:53:24 +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.26 via Frontend Transport; Wed, 10 May 2023 12:53:24 +0800 From: Ryder Lee To: Felix Fietkau , CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , Peter Chiu , Ryder Lee Subject: [PATCH v3 4/6] wifi: mt76: report non-binding skb tx rate when WED is active Date: Wed, 10 May 2023 12:53:19 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 In-Reply-To: References: 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 --- v3: fill rate info when cb->pktid < MT_PACKET_ID_FIRST --- drivers/net/wireless/mediatek/mt76/tx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c index 99d395bd1bba..54c2beff16aa 100644 --- a/drivers/net/wireless/mediatek/mt76/tx.c +++ b/drivers/net/wireless/mediatek/mt76/tx.c @@ -269,8 +269,17 @@ 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_rate_status rs = {}; + hw = mt76_tx_status_get_hw(dev, skb); status.sta = wcid_to_sta(wcid); + 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