Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp663739pxb; Tue, 5 Apr 2022 17:51:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyu/jfyYK4Uro4A7/Zpq5cv5U/KLQPzWF5HtBC3Ih29jhJHdQWQtdm+1gA0HEUzzHfG9E7O X-Received: by 2002:a65:670b:0:b0:382:243d:fa with SMTP id u11-20020a65670b000000b00382243d00famr4987092pgf.360.1649206295924; Tue, 05 Apr 2022 17:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206295; cv=none; d=google.com; s=arc-20160816; b=gYqjuclAQR/KeK4yzDPfvoSdHIkmWfeIJ5kTfdJKGZcNxFZPvXI8yJi5bEuZEZdgHa owYGPsMoY7yrMqaKzMRbF3Gd7/YsVMLOUNTI4Mk64pJAETBgZrHVIn++9LspNmZyFNIb Ze34vb5MpFANmWjFLXzsxbvnZoG/ARekciVQhiLZxDbg4+fY6rVMH63XKr8CLc7lp+ay uy627ML3XQTTGsUy18xWnwB/SRgqQJIR0Qk4gF3ig59OZo6EqSCJ8zxOH9fSZYjIupSL A87U/6DI+h74Va4Txfr0m8Gvd0D8iuXFa3R/L4fC4SM7GjXdIgBY57q+gGf+XiRGtzO8 a90Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ECMM5cziAylFhBtwvXc+SZz4kOCiPCyku+dQgm1Yklw=; b=v6CDP/DPOSN8q50eKtAnSEGtPvYtVu/w0l8PUSyjHo10UOFJtcXnZbnb78Y70CvAaJ zhJ3zzEW8NvRYdN+ZecKZobAaQm4kLcAVGuGgT/HTWUx3+YuzpOBI1DkeIyijM1DtM6r 53YXALsIQgcHxOf13UC9XUplW4sWIf7Tzf20T4FRqgAhuGjjKxqNQhXQUkKLJJRBu9iP +b5A9Xd+9iB49Hvep25dp/KmvZ0XPh7ufmP9/61PC6wk8q8zZDAJncpjEW4GzvuWetLl qoFyoGnRk2Y6Lfac7senaTT7rsW7iKpqS/5EQRuT4qzuFPxJ1/yS/mZ4ymTVEw1P1L+T hSqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Epdz4/K8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nn18-20020a17090b38d200b001cab35fecb9si3783166pjb.187.2022.04.05.17.51.21; Tue, 05 Apr 2022 17:51:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b="Epdz4/K8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352108AbiDEKDz (ORCPT + 99 others); Tue, 5 Apr 2022 06:03:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237505AbiDEISE (ORCPT ); Tue, 5 Apr 2022 04:18:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7180F69CC6; Tue, 5 Apr 2022 01:06:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BD260B81A32; Tue, 5 Apr 2022 08:06:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36E8EC385A1; Tue, 5 Apr 2022 08:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145986; bh=aIhk6PWvgA5r+4ayB0G884nngyqJ9qOnaKV994l4LlA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Epdz4/K808yleSRRmHh0H8yXKBERlJ+s6H/MLn3rIKCk6/SmX4rvVxdPeXRv8+WsS bvJ448VnjNRKC3B3oIZ3/TMYsle5DGPr49+wWHo0+lzZD6By0phkFEmb/PVPOcfkJf qfFIagehlOF6LlVgEjEzte+FWiqPNpglKt9Rz4ls= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sujuan Chen , Ryder Lee , Bo Jiao , Felix Fietkau , Sasha Levin Subject: [PATCH 5.17 0602/1126] mt76: mt7915: enlarge wcid size to 544 Date: Tue, 5 Apr 2022 09:22:29 +0200 Message-Id: <20220405070425.304342695@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org From: Bo Jiao [ Upstream commit b37d0c9735bc1976f85636e06e07f1a7547d969d ] 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 Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- 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 404c3d1a70d6..1f6f7a44d3f0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -224,7 +224,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 d054cdecd5f7..29517ca08de0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -399,7 +399,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 12567b653607..db267642924d 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -1598,7 +1598,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 42d887383e8d..12ca54566461 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) @@ -449,6 +450,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.34.1