wifi: rtw89: configure PPDU max user by chip
authorZong-Zhe Yang <kevin_yang@realtek.com>
Fri, 27 Oct 2023 01:50:57 +0000 (09:50 +0800)
committerKalle Valo <kvalo@kernel.org>
Mon, 30 Oct 2023 17:25:30 +0000 (19:25 +0200)
Different chip can support different max user in one PPDU report.
So, we now configure it in chip info.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231027015059.10032-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/rtw8851b.c
drivers/net/wireless/realtek/rtw89/rtw8852a.c
drivers/net/wireless/realtek/rtw89/rtw8852b.c
drivers/net/wireless/realtek/rtw89/rtw8852c.c

index a3624eb..4327f72 100644 (file)
@@ -1407,6 +1407,7 @@ static int rtw89_core_rx_process_mac_ppdu(struct rtw89_dev *rtwdev,
                                          struct sk_buff *skb,
                                          struct rtw89_rx_phy_ppdu *phy_ppdu)
 {
+       const struct rtw89_chip_info *chip = rtwdev->chip;
        const struct rtw89_rxinfo *rxinfo = (const struct rtw89_rxinfo *)skb->data;
        bool rx_cnt_valid = false;
        u8 plcp_size = 0;
@@ -1416,8 +1417,9 @@ static int rtw89_core_rx_process_mac_ppdu(struct rtw89_dev *rtwdev,
        rx_cnt_valid = le32_get_bits(rxinfo->w0, RTW89_RXINFO_W0_RX_CNT_VLD);
        plcp_size = le32_get_bits(rxinfo->w1, RTW89_RXINFO_W1_PLCP_LEN) << 3;
        usr_num = le32_get_bits(rxinfo->w0, RTW89_RXINFO_W0_USR_NUM);
-       if (usr_num > RTW89_PPDU_MAX_USR) {
-               rtw89_warn(rtwdev, "Invalid user number in mac info\n");
+       if (usr_num > chip->ppdu_max_usr) {
+               rtw89_warn(rtwdev, "Invalid user number (%d) in mac info\n",
+                          usr_num);
                return -EINVAL;
        }
 
index 91e4d4e..2eb29ea 100644 (file)
@@ -2815,7 +2815,6 @@ struct rtw89_ra_info {
        u8 csi_bw:3;
 };
 
-#define RTW89_PPDU_MAX_USR 4
 #define RTW89_PPDU_MAC_INFO_USR_SIZE 4
 #define RTW89_PPDU_MAC_INFO_SIZE 8
 #define RTW89_PPDU_MAC_RX_CNT_SIZE 96
@@ -3644,6 +3643,7 @@ struct rtw89_chip_info {
        u8 bacam_num;
        u8 bacam_dynamic_num;
        enum rtw89_bacam_ver bacam_ver;
+       u8 ppdu_max_usr;
 
        u8 sec_ctrl_efuse_size;
        u32 physical_efuse_size;
index 50522ff..ffc464b 100644 (file)
@@ -2393,6 +2393,7 @@ const struct rtw89_chip_info rtw8851b_chip_info = {
        .bacam_num              = 2,
        .bacam_dynamic_num      = 4,
        .bacam_ver              = RTW89_BACAM_V0,
+       .ppdu_max_usr           = 4,
        .sec_ctrl_efuse_size    = 4,
        .physical_efuse_size    = 1216,
        .logical_efuse_size     = 2048,
index 0c36e61..0d6f87b 100644 (file)
@@ -2129,6 +2129,7 @@ const struct rtw89_chip_info rtw8852a_chip_info = {
        .bacam_num              = 2,
        .bacam_dynamic_num      = 4,
        .bacam_ver              = RTW89_BACAM_V0,
+       .ppdu_max_usr           = 4,
        .sec_ctrl_efuse_size    = 4,
        .physical_efuse_size    = 1216,
        .logical_efuse_size     = 1536,
index 9d4e6f0..62c2fea 100644 (file)
@@ -2563,6 +2563,7 @@ const struct rtw89_chip_info rtw8852b_chip_info = {
        .bacam_num              = 2,
        .bacam_dynamic_num      = 4,
        .bacam_ver              = RTW89_BACAM_V0,
+       .ppdu_max_usr           = 4,
        .sec_ctrl_efuse_size    = 4,
        .physical_efuse_size    = 1216,
        .logical_efuse_size     = 2048,
index 3b7d8ab..7bb5d35 100644 (file)
@@ -2877,6 +2877,7 @@ const struct rtw89_chip_info rtw8852c_chip_info = {
        .bacam_num              = 8,
        .bacam_dynamic_num      = 8,
        .bacam_ver              = RTW89_BACAM_V0_EXT,
+       .ppdu_max_usr           = 8,
        .sec_ctrl_efuse_size    = 4,
        .physical_efuse_size    = 1216,
        .logical_efuse_size     = 2048,