Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp849674rdh; Thu, 26 Oct 2023 18:55:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhuPrIEDs6ZthiZUxuRA/KBnaEr4bek7AWJgs7zkACxsGCccNM0fTenxR6hlVYrma2E89g X-Received: by 2002:a67:e00d:0:b0:457:de3b:9b32 with SMTP id c13-20020a67e00d000000b00457de3b9b32mr1419668vsl.18.1698371748737; Thu, 26 Oct 2023 18:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698371748; cv=none; d=google.com; s=arc-20160816; b=S1O8Gnj8gfbzjFW7poH/TZ5M5cldtblT1UBDGESQOJkmrK9LFO3uAuTaH5Y77/c1ab o2Zl/FCEI6ROF+DO0WxoZ5IUC4PlVEWtIMmtQ43Uk5NCvN1OxxajjsOgEl8tDybxZGDZ gpbvJJfHT4yTPFIwrzmfmsssMjhJjYPU+NCN5vR4qJxqEupnPS4zQTgDobG3XWymxW3l KtNg8QiNV6wSnlsxPqRsG0uzfEE2tUy5YN52UTReTvdjCeBwyT9HVoUgC/KuvcIYxYDq NDmEpDe3QLVYZh648A6gssQs9B9DSC30aVvf+s1JY9SNgctaZlOAzDv/6o22loobNmTA zUsg== 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; bh=60HHe8aKViPv8AJMfx2XE+ORrg7icd919JRuwvwXfZk=; fh=TSuyMlfOTyCx0zt3ucDyTttlN37QPvmvgk5pf20rBgY=; b=V6sZ4HLT0/JC0VKkGmyWsw6D1rbEYCrjUJd4+1093bV6Oa7hhUUdhxis+nq9m1IyXm iqJINu6LDcTU9c4a+JhcS1E1iUQSXFCzKl0/5sibAXboc4T5ldSRDhOkxOxXNXxPeI5j SXEO4Be2BzA5cyRwzY0DyyhqjfHzIILqdoHaK5FPGfVEqUbYVPTJlGhDC/Zjr5lpUq3U /mlpPx2TVMuakj9dk9yDN0s1g/tndNbgtSa/mnenFqJ5M6fnZLISohl50vEtKdWdQmft 9SQh9tzdCXGFxol40FSaStc1+MyUKPlq07Uan3h0RW7h2kckzkBGVNSiBn/SLa5ffXsV e2lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id m63-20020a255842000000b00d9a3f9bf7dcsi1022605ybb.39.2023.10.26.18.55.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 18:55:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3B05F812522E; Thu, 26 Oct 2023 18:55:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbjJ0Bze (ORCPT + 52 others); Thu, 26 Oct 2023 21:55:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjJ0Bzc (ORCPT ); Thu, 26 Oct 2023 21:55:32 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51080AB for ; Thu, 26 Oct 2023 18:55:29 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 39R1tLEF13465344, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.93/5.92) with ESMTPS id 39R1tLEF13465344 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Oct 2023 09:55:21 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Fri, 27 Oct 2023 09:52:36 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 27 Oct 2023 09:51:36 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH v2 1/4] wifi: rtw89: set entry size of address CAM to H2C field by chip Date: Fri, 27 Oct 2023 09:50:56 +0800 Message-ID: <20231027015059.10032-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027015059.10032-1-pkshih@realtek.com> References: <20231027015059.10032-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.94] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 26 Oct 2023 18:55:44 -0700 (PDT) The new chips change hardware design to shrink entry size of address CAM from 0x40 to 0x20, so make this change accordingly. Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/cam.c | 16 +++++++++++++++- drivers/net/wireless/realtek/rtw89/mac.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/cam.c b/drivers/net/wireless/realtek/rtw89/cam.c index f5301c2bbf13..914c94988b2f 100644 --- a/drivers/net/wireless/realtek/rtw89/cam.c +++ b/drivers/net/wireless/realtek/rtw89/cam.c @@ -488,6 +488,20 @@ static int rtw89_cam_get_avail_addr_cam(struct rtw89_dev *rtwdev, return 0; } +static u8 rtw89_get_addr_cam_entry_size(struct rtw89_dev *rtwdev) +{ + const struct rtw89_chip_info *chip = rtwdev->chip; + + switch (chip->chip_id) { + case RTL8852A: + case RTL8852B: + case RTL8851B: + return ADDR_CAM_ENT_SIZE; + default: + return ADDR_CAM_ENT_SHORT_SIZE; + } +} + int rtw89_cam_init_addr_cam(struct rtw89_dev *rtwdev, struct rtw89_addr_cam_entry *addr_cam, const struct rtw89_bssid_cam_entry *bssid_cam) @@ -509,7 +523,7 @@ int rtw89_cam_init_addr_cam(struct rtw89_dev *rtwdev, } addr_cam->addr_cam_idx = addr_cam_idx; - addr_cam->len = ADDR_CAM_ENT_SIZE; + addr_cam->len = rtw89_get_addr_cam_entry_size(rtwdev); addr_cam->offset = 0; addr_cam->valid = true; addr_cam->addr_mask = 0; diff --git a/drivers/net/wireless/realtek/rtw89/mac.h b/drivers/net/wireless/realtek/rtw89/mac.h index c11c904f87fe..cd2e9b850c72 100644 --- a/drivers/net/wireless/realtek/rtw89/mac.h +++ b/drivers/net/wireless/realtek/rtw89/mac.h @@ -10,6 +10,7 @@ #define MAC_MEM_DUMP_PAGE_SIZE 0x40000 #define ADDR_CAM_ENT_SIZE 0x40 +#define ADDR_CAM_ENT_SHORT_SIZE 0x20 #define BSSID_CAM_ENT_SIZE 0x08 #define HFC_PAGE_UNIT 64 #define RPWM_TRY_CNT 3 -- 2.25.1