Skip to content

Commit 6d40a49

Browse files
Bitterblue Smithgregkh
authored andcommitted
wifi: rtl8xxxu: Fix reading the vendor of combo chips
[ Upstream commit 6f103ae ] The wifi + bluetooth combo chips (RTL8723AU and RTL8723BU) read the chip vendor from the wrong register because the val32 variable gets overwritten. Add one more variable to avoid this. This had no real effect on RTL8723BU. It may have had an effect on RTL8723AU. Fixes: 26f1fad ("New driver: rtl8xxxu (mac80211)") Signed-off-by: Bitterblue Smith <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 355f16f commit 6d40a49

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,18 +1607,18 @@ static void rtl8xxxu_print_chipinfo(struct rtl8xxxu_priv *priv)
16071607
static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
16081608
{
16091609
struct device *dev = &priv->udev->dev;
1610-
u32 val32, bonding;
1610+
u32 val32, bonding, sys_cfg;
16111611
u16 val16;
16121612

1613-
val32 = rtl8xxxu_read32(priv, REG_SYS_CFG);
1614-
priv->chip_cut = (val32 & SYS_CFG_CHIP_VERSION_MASK) >>
1613+
sys_cfg = rtl8xxxu_read32(priv, REG_SYS_CFG);
1614+
priv->chip_cut = (sys_cfg & SYS_CFG_CHIP_VERSION_MASK) >>
16151615
SYS_CFG_CHIP_VERSION_SHIFT;
1616-
if (val32 & SYS_CFG_TRP_VAUX_EN) {
1616+
if (sys_cfg & SYS_CFG_TRP_VAUX_EN) {
16171617
dev_info(dev, "Unsupported test chip\n");
16181618
return -ENOTSUPP;
16191619
}
16201620

1621-
if (val32 & SYS_CFG_BT_FUNC) {
1621+
if (sys_cfg & SYS_CFG_BT_FUNC) {
16221622
if (priv->chip_cut >= 3) {
16231623
sprintf(priv->chip_name, "8723BU");
16241624
priv->rtl_chip = RTL8723B;
@@ -1640,7 +1640,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
16401640
if (val32 & MULTI_GPS_FUNC_EN)
16411641
priv->has_gps = 1;
16421642
priv->is_multi_func = 1;
1643-
} else if (val32 & SYS_CFG_TYPE_ID) {
1643+
} else if (sys_cfg & SYS_CFG_TYPE_ID) {
16441644
bonding = rtl8xxxu_read32(priv, REG_HPON_FSM);
16451645
bonding &= HPON_FSM_BONDING_MASK;
16461646
if (priv->fops->tx_desc_size ==
@@ -1688,7 +1688,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
16881688
case RTL8188E:
16891689
case RTL8192E:
16901690
case RTL8723B:
1691-
switch (val32 & SYS_CFG_VENDOR_EXT_MASK) {
1691+
switch (sys_cfg & SYS_CFG_VENDOR_EXT_MASK) {
16921692
case SYS_CFG_VENDOR_ID_TSMC:
16931693
sprintf(priv->chip_vendor, "TSMC");
16941694
break;
@@ -1705,7 +1705,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
17051705
}
17061706
break;
17071707
default:
1708-
if (val32 & SYS_CFG_VENDOR_ID) {
1708+
if (sys_cfg & SYS_CFG_VENDOR_ID) {
17091709
sprintf(priv->chip_vendor, "UMC");
17101710
priv->vendor_umc = 1;
17111711
} else {

0 commit comments

Comments
 (0)