Skip to content

Commit 29d5e6f

Browse files
Jes SorensenKalle Valo
authored andcommitted
rtl8xxxu: Fix rtl8192eu driver reload issue
The 8192eu suffered from two issues when reloading the driver. The same problems as with the 8723bu where REG_RX_WAIT_CCA bits 22 and 23 didn't get set in rtl8192e_enable_rf(). In addition it also seems prone to issues when setting REG_RF_CTRL to 0 intead of just disabling the RF_ENABLE bit. Similar to what was causing issues with the 8188eu. With this patch I can successfully reload the driver and reassociate to an APi with an 8192eu dongle. Signed-off-by: Jes Sorensen <[email protected]> Cc: [email protected] # 4.8+ Signed-off-by: Kalle Valo <[email protected]>
1 parent ab05e5e commit 29d5e6f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,9 @@ static int rtl8192eu_active_to_emu(struct rtl8xxxu_priv *priv)
14611461
int count, ret = 0;
14621462

14631463
/* Turn off RF */
1464-
rtl8xxxu_write8(priv, REG_RF_CTRL, 0);
1464+
val8 = rtl8xxxu_read8(priv, REG_RF_CTRL);
1465+
val8 &= ~RF_ENABLE;
1466+
rtl8xxxu_write8(priv, REG_RF_CTRL, val8);
14651467

14661468
/* Switch DPDT_SEL_P output from register 0x65[2] */
14671469
val8 = rtl8xxxu_read8(priv, REG_LEDCFG2);
@@ -1593,6 +1595,10 @@ static void rtl8192e_enable_rf(struct rtl8xxxu_priv *priv)
15931595
u32 val32;
15941596
u8 val8;
15951597

1598+
val32 = rtl8xxxu_read32(priv, REG_RX_WAIT_CCA);
1599+
val32 |= (BIT(22) | BIT(23));
1600+
rtl8xxxu_write32(priv, REG_RX_WAIT_CCA, val32);
1601+
15961602
val8 = rtl8xxxu_read8(priv, REG_GPIO_MUXCFG);
15971603
val8 |= BIT(5);
15981604
rtl8xxxu_write8(priv, REG_GPIO_MUXCFG, val8);

0 commit comments

Comments
 (0)