diff mbox series

[v2,1/4] wifi: rtw89: set entry size of address CAM to H2C field by chip

Message ID 20231027015059.10032-2-pkshih@realtek.com (mailing list archive)
State Accepted
Commit 0f4aa3af137175dc5c5723781ec96e7792d5cda0
Delegated to: Kalle Valo
Headers show
Series wifi: rtw89: update address CAM size and PPDU parser to support WiFi 7 chips | expand

Commit Message

Ping-Ke Shih Oct. 27, 2023, 1:50 a.m. UTC
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 <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/cam.c | 16 +++++++++++++++-
 drivers/net/wireless/realtek/rtw89/mac.h |  1 +
 2 files changed, 16 insertions(+), 1 deletion(-)

Comments

Kalle Valo Oct. 30, 2023, 5:26 p.m. UTC | #1
Ping-Ke Shih <pkshih@realtek.com> wrote:

> 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 <pkshih@realtek.com>

4 patches applied to wireless-next.git, thanks.

0f4aa3af1371 wifi: rtw89: set entry size of address CAM to H2C field by chip
76d45f48e4fc wifi: rtw89: configure PPDU max user by chip
e343face52b0 wifi: rtw89: consider RX info for WiFi 7 chips
944496bada22 wifi: rtw89: extend PHY status parser to support WiFi 7 chips
diff mbox series

Patch

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