1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-25 14:44:09 +00:00

Enable USB 2.0/3.0 switch for RTL8812AU/21AU

This commit is contained in:
Sergei Makarenkov 2017-02-07 23:02:30 +03:00
parent bed896f9a5
commit ce40d4dab1

View File

@ -625,8 +625,25 @@ static int usb_reprobe_to_usb3(PADAPTER Adapter)
struct registry_priv *registry_par = &Adapter->registrypriv;
u8 ret = _FALSE;
#if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A)
if (IS_HIGH_SPEED_USB(Adapter)) {
if ((rtw_read8(Adapter, 0x74) & (BIT(2)|BIT(3))) != BIT(3)) {
rtw_write8(Adapter, 0x74, 0x8);
rtw_write8(Adapter, 0x70, 0x2);
rtw_write8(Adapter, 0x3e, 0x1);
rtw_write8(Adapter, 0x3d, 0x3);
/* usb disconnect */
rtw_write8(Adapter, 0x5, 0x80);
ret = _TRUE;
}
} else if (IS_SUPER_SPEED_USB(Adapter)) {
rtw_write8(Adapter, 0x70, rtw_read8(Adapter, 0x70) & (~BIT(1)));
rtw_write8(Adapter, 0x3e, rtw_read8(Adapter, 0x3e) & (~BIT(0)));
}
#else
rtw_hal_set_hwreg(Adapter, HW_VAR_USB_MODE, &ret);
#endif
return ret;
}