Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp878518pxb; Wed, 27 Oct 2021 14:19:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvzvo5W20Xd5n82LMlWM3NkxcqWCCJzUvDdcx99IyfRXscFCqQnmlLy35eWI++s3t/J9GA X-Received: by 2002:a50:e0c9:: with SMTP id j9mr426510edl.336.1635369565509; Wed, 27 Oct 2021 14:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369565; cv=none; d=google.com; s=arc-20160816; b=seSLiwjf/PSiGqkDssR208znYC0frcHyqWI49bPLfcpD+JeC5KDh482l7mCdAq/qhD PGIdka3hILiHPqBga0X7t0Lx8MMtPz8a68GmqhlKhAUP12/aqB5Qi+c0az8/KI9K+7ou xqC82qZU9ux77hujIpTz6yVM16qxgASfenGagcqjArsqfCrP++eDlyzaxO3dSRpJ07XB 6W2k2dqjHAGhv9j43kRm44cmjpVBekC0Sx5uFmrHCcmJyQ2BQMhDZtuJA0lgyXSZwTny AtCXldyKKecJt6eyyZi5ILO+y6IkQYCpRaHROh2KDua1zskfNHCy9rIvs1EB4STBmYtG iU6Q== 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; bh=MH2T2AXSCWS0JoSt2noDFJBk4p+WAYxwqAGba6jzRNU=; b=Bl6iGYutCZjPu8fx+IdMszEB06gHCmgpXHuKcJtIIjwujImZs8hN/kwN/ZcGTIMu13 gsYzxKt9yWRankTPYM9zkOD8LJ7T/LDRGijsAoQU1/JQzw2UCubR/jIX0pIGpt5f3Bkb 9k8JP9dEeNbC7zYS7TS69cDGRJWSFfPzfZnLf6lHM5uG+MJ2vX/amPSsNpZPZ0b8J0XW oHxdxuCO7lvNgrSCQmjU6X0Up9zK/RVk0Y9uNiq/oCmOIjaRcYJYQbySU5dUrW6veBlS 05LR+G+lqNrN9AV0h/57rS9mqonyFrvHKKlOS2EGmUm0iNQttT/of53IEqhHHpmwC0+y ljSg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb32si1414160ejc.344.2021.10.27.14.19.06; Wed, 27 Oct 2021 14:19:25 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241171AbhJ0JMK (ORCPT + 67 others); Wed, 27 Oct 2021 05:12:10 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:53630 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S241169AbhJ0JMJ (ORCPT ); Wed, 27 Oct 2021 05:12:09 -0400 X-UUID: 5b23af73a31945ccbe46b408ff7d409e-20211027 X-UUID: 5b23af73a31945ccbe46b408ff7d409e-20211027 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 164411175; Wed, 27 Oct 2021 17:09:39 +0800 Received: from MTKMBS34N1.mediatek.inc (172.27.4.172) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Wed, 27 Oct 2021 17:09:38 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS34N1.mediatek.inc (172.27.4.172) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 27 Oct 2021 16:40:36 +0800 Received: from mcddlt001.gcn.mediatek.inc (10.19.240.15) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 27 Oct 2021 16:40:35 +0800 From: Bo Jiao To: Felix Fietkau CC: linux-wireless , Ryder Lee , Xing Song , Sujuan Chen , Shayne Chen , "Evelyn Tsai" , linux-mediatek , Bo Jiao Subject: [PATCH 06/11] mt76: mt7915: enlarge wcid size to 544 Date: Wed, 27 Oct 2021 16:40:14 +0800 Message-ID: X-Mailer: git-send-email 2.17.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Bo Jiao The mt7916 can support up to 544 wcid entries. This is an intermediate patch to add mt7916 support. Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Co-developed-by: Ryder Lee Signed-off-by: Ryder Lee Signed-off-by: Bo Jiao --- drivers/net/wireless/mediatek/mt76/mt76.h | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index ce687d5..0f1197e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -225,7 +225,7 @@ enum mt76_wcid_flags { MT_WCID_FLAG_HDR_TRANS, }; -#define MT76_N_WCIDS 288 +#define MT76_N_WCIDS 544 /* stored in ieee80211_tx_info::hw_queue */ #define MT_TX_HW_QUEUE_EXT_PHY BIT(3) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index 8d16c96..4dfa1c1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -430,7 +430,7 @@ static void mt7915_mac_init(struct mt7915_dev *dev) /* enable hardware de-agg */ mt76_set(dev, MT_MDP_DCR0, MT_MDP_DCR0_DAMSDU_EN); - for (i = 0; i < MT7915_WTBL_SIZE; i++) + for (i = 0; i < mt7915_wtbl_size(dev); i++) mt7915_mac_wtbl_update(dev, i, MT_WTBL_UPDATE_ADM_COUNT_CLEAR); for (i = 0; i < 2; i++) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index ba39f3d..4212dbb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -1492,7 +1492,7 @@ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data) if (pid < MT_PACKET_ID_FIRST) return; - if (wcidx >= MT7915_WTBL_SIZE) + if (wcidx >= mt7915_wtbl_size(dev)) return; rcu_read_lock(); diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h b/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h index 3e2e900..e8fbe69 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h @@ -12,7 +12,8 @@ #define MT7915_MAX_INTERFACES 19 #define MT7915_MAX_WMM_SETS 4 #define MT7915_WTBL_SIZE 288 -#define MT7915_WTBL_RESERVED (MT7915_WTBL_SIZE - 1) +#define MT7916_WTBL_SIZE 544 +#define MT7915_WTBL_RESERVED (mt7915_wtbl_size(dev) - 1) #define MT7915_WTBL_STA (MT7915_WTBL_RESERVED - \ MT7915_MAX_INTERFACES) @@ -477,6 +478,11 @@ static inline bool is_mt7915(struct mt76_dev *dev) return mt76_chip(dev) == 0x7915; } +static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev) +{ + return is_mt7915(&dev->mt76) ? MT7915_WTBL_SIZE : MT7916_WTBL_SIZE; +} + void mt7915_dual_hif_set_irq_mask(struct mt7915_dev *dev, bool write_reg, u32 clear, u32 set); -- 2.18.0