]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rtw89: 8851b: Accept USB devices and load their MAC address
authorBitterblue Smith <rtl8821cerfe2@gmail.com>
Mon, 30 Jun 2025 20:40:58 +0000 (23:40 +0300)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 4 Jul 2025 02:39:14 +0000 (10:39 +0800)
Make rtw8851b_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/6b2a1382-3be4-4038-8005-cf96922e4332@gmail.com
drivers/net/wireless/realtek/rtw89/rtw8851b.c

index 7801732d5b8b13b5c942a18eca1439dbf138f8b3..11584ef6ef48175b42166d14ce4d444c835a6ff0 100644 (file)
@@ -461,14 +461,6 @@ static int rtw8851b_pwr_off_func(struct rtw89_dev *rtwdev)
        return 0;
 }
 
-static void rtw8851b_efuse_parsing(struct rtw89_efuse *efuse,
-                                  struct rtw8851b_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 rtw8851b_efuse_parsing_tssi(struct rtw89_dev *rtwdev,
                                        struct rtw8851b_efuse *map)
 {
@@ -549,12 +541,18 @@ static int rtw8851b_read_efuse(struct rtw89_dev *rtwdev, u8 *log_map,
 
        switch (rtwdev->hci.type) {
        case RTW89_HCI_TYPE_PCIE:
-               rtw8851b_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;