Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp846657rdh; Thu, 26 Oct 2023 18:46:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7MboQfXPsyuvf+W4KEBPahu3Pj9RdrXYgrXYbQVzM9bz+NH4uEGosOj4dzXDh/vvM6A49 X-Received: by 2002:a05:690c:ec8:b0:5a7:dbd6:14ae with SMTP id cs8-20020a05690c0ec800b005a7dbd614aemr1670114ywb.29.1698371192079; Thu, 26 Oct 2023 18:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698371192; cv=none; d=google.com; s=arc-20160816; b=0v8O6fQTdrsMXK1Y89xnok17+aiAHNs+QVOfN7/3AukM8To4F/hwzHrgCN3YwHUy7H uMDGZC6ihC0d5UegV+y/v99iXw7zF6yJ5u2eteh1gOOnEuFeHC8rcyZo3VXlBXEhwE+y g+JGZtuPc4RdFldWUzJGQEcl2AO2qYf5i+jnFon/VYUl/IfoZnz8OAFzHQTrbOOlTKPV aoSmx/jdQgvs6h8VwqYIA4Wcn3F3JzkgLZAWFRXMa4dLNMpkYR7yljlpzNymJOoN/9uL MsAnbqbFk9H9DIuGp89Yq7jgjt/qTapovvODxZEpje27y34cQUsNXEufzOkKLocU2Rez /pkg== 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=a8YPtldQrXaaJnIXqI6yMBszk518ux8vmrKN62jS4+XVC4vaOlbi2SKwPw+IXW/Rvi UwpkQjdZpdD/Ujm4hUhDYJb9YlhWhokJ7EVd/CD1esBR9DIgiOzXIMSin9p0HtoE3Ew8 2Pdxa8hy98pPjxKeF4TH7S5qVkuah4EUhiXpzj3m+upaRvQL76rFPInqek/3UV6gCp1O 0oi8yO2GVEsoZjowYI/HKME1zYjxiyF14jNWy08Wc9j/xeMofGAJdnZHt0fB85yvMlvC 3RbavBHbUIajIQpAErVjbNPaq9KUda9BGtRPg4hxmCMzL+SJZ8biGWfZ20ouGcX+kzSO lcBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s185-20020a8177c2000000b0059eb9ebb8d7si924472ywc.383.2023.10.26.18.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 18:46:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 0D4B480BD3AE; Thu, 26 Oct 2023 18:45:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbjJ0BpR (ORCPT + 52 others); Thu, 26 Oct 2023 21:45:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjJ0BpQ (ORCPT ); Thu, 26 Oct 2023 21:45:16 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE49FAB for ; Thu, 26 Oct 2023 18:45:13 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 39R1j55c93456141, 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 39R1j55c93456141 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Oct 2023 09:45:05 +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:45:00 +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:44:40 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 1/4] wifi: rtw89: set entry size of address CAM to H2C field by chip Date: Fri, 27 Oct 2023 09:43:59 +0800 Message-ID: <20231027014402.9448-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027014402.9448-1-pkshih@realtek.com> References: <20231027014402.9448-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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 26 Oct 2023 18:45: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