Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp99114pxt; Wed, 4 Aug 2021 06:51:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfNs+MjdXxQxHZwTzlUoh1PAwE7Whr8f6/E/8mhgFvKim2Ea3n9HrtSyD2j5L5Gs0qi/WR X-Received: by 2002:a17:906:40d7:: with SMTP id a23mr25887698ejk.24.1628085071877; Wed, 04 Aug 2021 06:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628085071; cv=none; d=google.com; s=arc-20160816; b=ZrH6arXaAHP+cSyyH1bef4uSCDJlZ23L1AQ8TtjU9mBoKjzIQTgApaVaCeO7tRZtjV k9TKvpeOB4G8gVcc0DZhBTvoBP06m5yaZlmYIHV8fTGg9GflCPrpqtcLNYVRp643n/iI gUHJa4+h3sC4opsb9m5qU0Afz0HFoRG5r49tWZc0Hd+2CoAYjnZJ1M/H5BfxvTA8YhAN orVd6lwvOBJ3wNXyCFj6msVwB31Wo5trmL5Rj1KSnfWSYCaN2PmscVVJhikWCZdd/tIT GFPYTJ81zVU6UAiC4II2hiAXILeFYWINfL5dLCsUjRnJ4w0iYvvN1yhvDSdtQesdPnCI nSDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=KHYpD+b6xytxxcrD9+j+OyiXjRWI3wqexZfNkU/I1yE=; b=dYOGfJP2RMFgmuA8mirYHBEmYYN3Cjz2q63lhcwwtW2f1I4dKklg0hexHzcZAt8SVd 5kbOuSi4A39CLNIZ3AvLFrMsvcyVX5U3Aaj0UEuaX2HqrlnOb4fsdjBmAXwq7uDjxLCO SWsc245hGZWbW+6LhlMUgKk0G6s4ZND8mM+jGa5ZgLLreC6j8dFdhCQjIWqlrk+dJuHD TBc67KzBR1CCqTtyfpM38sJUm+ZfqEhNzGG0n95PTPqtQ/RCBJ/lac+AXmTmAeKzYB7K jkN0TMW6UVLpb26PG9QSspohur4c1gvpOJN8GiADbHm/SkmuyfMM2Hs4Gv0QXIluErjE A1Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=Ew7F7tU1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si2076743ede.496.2021.08.04.06.50.48; Wed, 04 Aug 2021 06:51:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=Ew7F7tU1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238409AbhHDNpa (ORCPT + 99 others); Wed, 4 Aug 2021 09:45:30 -0400 Received: from dispatch1-us1.ppe-hosted.com ([148.163.129.48]:48208 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238005AbhHDNp2 (ORCPT ); Wed, 4 Aug 2021 09:45:28 -0400 X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.67.133]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id B5E391C0071 for ; Wed, 4 Aug 2021 13:45:14 +0000 (UTC) Received: from mail3.candelatech.com (mail2.candelatech.com [208.74.158.173]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 94222B0007E for ; Wed, 4 Aug 2021 13:45:14 +0000 (UTC) Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 5935413C2BE; Wed, 4 Aug 2021 06:45:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 5935413C2BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1628084714; bh=dno2s6vpZpYzObc7adrbYSpkD2upB9f0haLZnDxJ2yo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ew7F7tU1AqVDSLmmhThWYYTQ54ErHr4L1p5tr45U2Wu7ARWeYhbzDlHQQnEee+enQ 9pctnk2JQDF6BNxILwzf2yiOg+oQ1Lsa0FTSKpyejHOMu5a4DcUm5pZLad+vrgjyTl DD22slZMxosxXDOb2vUQPlPu+Odxpk7TJQiDgPyQ= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: Ben Greear Subject: [PATCH v5 09/11] mt76: mt7915: txfree status to show txcount instead of latency Date: Wed, 4 Aug 2021 06:45:03 -0700 Message-Id: <20210804134505.3208-9-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210804134505.3208-1-greearb@candelatech.com> References: <20210804134505.3208-1-greearb@candelatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MDID: 1628084715-uRowyS1ElJGv Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear Latency is not obviously that useful, but txcount can let us deduce retries, which may be more interesting. Signed-off-by: Ben Greear --- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 3 +++ drivers/net/wireless/mediatek/mt76/mt7915/mac.h | 8 +++++--- drivers/net/wireless/mediatek/mt76/mt7915/regs.h | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index f174cf219724..a0d282771d77 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -304,6 +304,9 @@ static void mt7915_mac_init(struct mt7915_dev *dev) /* enable hardware de-agg */ mt76_set(dev, MT_MDP_DCR0, MT_MDP_DCR0_DAMSDU_EN); + /* disable Tx latency report to enable Tx count in txfree path */ + mt76_clear(dev, MT_PLE_HOST_RPT0, MT_PLE_HOST_RPT0_TX_LATENCY); + for (i = 0; i < MT7915_WTBL_SIZE; i++) mt7915_mac_wtbl_update(dev, i, MT_WTBL_UPDATE_ADM_COUNT_CLEAR); diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.h b/drivers/net/wireless/mediatek/mt76/mt7915/mac.h index 65dba1061376..3f5a80158866 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.h +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.h @@ -304,13 +304,15 @@ struct mt7915_tx_free { #define MT_TX_FREE_MSDU_CNT GENMASK(9, 0) #define MT_TX_FREE_WLAN_ID GENMASK(23, 14) +/* when configured for txfree latency mode. See MT_PLE_HOST_RPT0_TX_LATENCY + * Not enabled by default now. + */ #define MT_TX_FREE_LATENCY GENMASK(12, 0) -/* 0: success, others: dropped */ +/* when configured for txcount mode. See MT_PLE_HOST_RPT0_TX_LATENCY. */ +#define MT_TX_FREE_TXCNT GENMASK(12, 0) #define MT_TX_FREE_STATUS GENMASK(14, 13) #define MT_TX_FREE_MSDU_ID GENMASK(30, 16) #define MT_TX_FREE_PAIR BIT(31) -/* will support this field in further revision */ -#define MT_TX_FREE_RATE GENMASK(13, 0) #define MT_TXS0_FIXED_RATE BIT(31) #define MT_TXS0_BW GENMASK(30, 29) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/regs.h b/drivers/net/wireless/mediatek/mt76/mt7915/regs.h index 62cc32a098fc..ac4d233b8cf2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/regs.h +++ b/drivers/net/wireless/mediatek/mt76/mt7915/regs.h @@ -22,6 +22,10 @@ #define MT_PLE_BASE 0x8000 #define MT_PLE(ofs) (MT_PLE_BASE + (ofs)) +/* Modify whether txfree struct returns latency or txcount. */ +#define MT_PLE_HOST_RPT0 MT_PLE(0x030) +#define MT_PLE_HOST_RPT0_TX_LATENCY BIT(3) + #define MT_PLE_FL_Q0_CTRL MT_PLE(0x1b0) #define MT_PLE_FL_Q1_CTRL MT_PLE(0x1b4) #define MT_PLE_FL_Q2_CTRL MT_PLE(0x1b8) -- 2.20.1