]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rtw89: 8852bx: Accept USB devices and load their MAC address
authorBitterblue Smith <rtl8821cerfe2@gmail.com>
Sat, 5 Jul 2025 19:36:59 +0000 (22:36 +0300)
committerPing-Ke Shih <pkshih@realtek.com>
Sun, 6 Jul 2025 05:11:29 +0000 (13:11 +0800)
Make __rtw8852bx_read_efuse() accept USB devices and load the MAC
address from the correct offset.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/1f58d168-67a9-4d86-9e6a-73789c7a59f4@gmail.com
drivers/net/wireless/realtek/rtw89/rtw8852b_common.c

index 0cf03f18cbb1a6e073db91442052abcb7567f74b..3fb2972ae6f6fa7a9237c3408892e884d33748cf 100644 (file)
@@ -172,14 +172,6 @@ static const struct rtw89_reg3_def rtw8852bx_btc_preagc_dis_defs[] = {
 
 static DECLARE_PHY_REG3_TBL(rtw8852bx_btc_preagc_dis_defs);
 
-static void rtw8852be_efuse_parsing(struct rtw89_efuse *efuse,
-                                   struct rtw8852bx_efuse *map)
-{
-       ether_addr_copy(efuse->addr, map->e.mac_addr);
-       efuse->rfe_type = map->rfe_type;
-       efuse->xtal_cap = map->xtal_k;
-}
-
 static void rtw8852bx_efuse_parsing_tssi(struct rtw89_dev *rtwdev,
                                         struct rtw8852bx_efuse *map)
 {
@@ -261,12 +253,18 @@ static int __rtw8852bx_read_efuse(struct rtw89_dev *rtwdev, u8 *log_map,
 
        switch (rtwdev->hci.type) {
        case RTW89_HCI_TYPE_PCIE:
-               rtw8852be_efuse_parsing(efuse, map);
+               ether_addr_copy(efuse->addr, map->e.mac_addr);
+               break;
+       case RTW89_HCI_TYPE_USB:
+               ether_addr_copy(efuse->addr, map->u.mac_addr);
                break;
        default:
                return -EOPNOTSUPP;
        }
 
+       efuse->rfe_type = map->rfe_type;
+       efuse->xtal_cap = map->xtal_k;
+
        rtw89_info(rtwdev, "chip rfe_type is %d\n", efuse->rfe_type);
 
        return 0;