Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142178390
D47562.id147010.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D47562.id147010.diff
View Options
diff --git a/sys/dev/rtwn/rtl8188e/r88e_reg.h b/sys/dev/rtwn/rtl8188e/r88e_reg.h
--- a/sys/dev/rtwn/rtl8188e/r88e_reg.h
+++ b/sys/dev/rtwn/rtl8188e/r88e_reg.h
@@ -121,5 +121,6 @@
/* Bits for R88E_XCK_OUT_CTRL. */
#define R88E_XCK_OUT_CTRL_EN 1
+#define R88E_USB_DELAY_US_DEF 1000
#endif /* R88E_REG_H */
diff --git a/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c b/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c
--- a/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c
+++ b/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c
@@ -48,6 +48,8 @@
#include <dev/rtwn/rtl8192c/r92c.h>
#include <dev/rtwn/rtl8192c/r92c_var.h>
+#include <dev/rtwn/usb/rtwn_usb_var.h>
+
#include <dev/rtwn/rtl8188e/usb/r88eu.h>
#include <dev/rtwn/rtl8188e/usb/r88eu_reg.h>
@@ -76,8 +78,12 @@
if (res != 0) \
return (EIO); \
} while(0)
+ struct rtwn_usb_softc *uc;
int ntries;
+ if ((uc = RTWN_USB_SOFTC(sc)) != NULL)
+ uc->uc_write_delay = 1;
+
/* Wait for power ready bit. */
for (ntries = 0; ntries < 5000; ntries++) {
if (rtwn_read_4(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_SUS_HOST)
@@ -85,6 +91,8 @@
rtwn_delay(sc, 10);
}
if (ntries == 5000) {
+ if (uc != NULL)
+ uc->uc_write_delay = 0;
device_printf(sc->sc_dev,
"timeout waiting for chip power up\n");
return (ETIMEDOUT);
@@ -112,7 +120,10 @@
break;
rtwn_delay(sc, 10);
}
- if (ntries == 5000)
+ if (ntries == 5000) {
+ if (uc != NULL)
+ uc->uc_write_delay = 0;
+ }
return (ETIMEDOUT);
/* Enable LDO normal mode. */
@@ -128,6 +139,8 @@
((sc->sc_hwcrypto != RTWN_CRYPTO_SW) ? R92C_CR_ENSEC : 0) |
R92C_CR_CALTMR_EN));
+ if (uc != NULL)
+ uc->uc_write_delay = 0;
return (0);
#undef RTWN_CHK
}
diff --git a/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c b/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c
--- a/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c
+++ b/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c
@@ -100,6 +100,7 @@
/* USB part. */
uc->uc_align_rx = r12au_align_rx;
uc->tx_agg_desc_num = 3;
+ uc->uc_delay_us = R88E_USB_DELAY_US_DEF;
/* Common part. */
sc->sc_flags = RTWN_FLAG_EXT_HDR;
diff --git a/sys/dev/rtwn/usb/rtwn_usb_attach.c b/sys/dev/rtwn/usb/rtwn_usb_attach.c
--- a/sys/dev/rtwn/usb/rtwn_usb_attach.c
+++ b/sys/dev/rtwn/usb/rtwn_usb_attach.c
@@ -377,6 +377,11 @@
uc->uc_rx_buf_size = RTWN_USB_RXBUFSZ_MIN;
if (uc->uc_rx_buf_size > RTWN_USB_RXBUFSZ_MAX)
uc->uc_rx_buf_size = RTWN_USB_RXBUFSZ_MAX;
+
+ uc->uc_delay_us = RTWN_USB_DELAY_US_DEF;
+ SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+ "delay_us", CTLFLAG_RWTUN, &uc->uc_delay_us,
+ uc->uc_delay_us, "RTWN USB set channel delay microseconds");
}
static int
@@ -390,6 +395,11 @@
device_set_usb_desc(self);
uc->uc_udev = uaa->device;
+ /*
+ XXX: Circumvent associate with USB 3.0 attached devices. We
+ need to be more specific as USB 2.0 is not affected.
+ */
+ uc->uc_write_delay = 1;
sc->sc_dev = self;
ic->ic_name = device_get_nameunit(self);
diff --git a/sys/dev/rtwn/usb/rtwn_usb_reg.c b/sys/dev/rtwn/usb/rtwn_usb_reg.c
--- a/sys/dev/rtwn/usb/rtwn_usb_reg.c
+++ b/sys/dev/rtwn/usb/rtwn_usb_reg.c
@@ -88,12 +88,16 @@
int len)
{
usb_device_request_t req;
+ struct rtwn_usb_softc *uc;
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
req.bRequest = R92C_REQ_REGS;
USETW(req.wValue, addr);
USETW(req.wIndex, 0);
USETW(req.wLength, len);
+ uc = RTWN_USB_SOFTC(sc);
+ if (uc->uc_write_delay == 1)
+ (sc->sc_delay)(sc,uc->uc_delay_us);
return (rtwn_do_request(sc, &req, buf));
}
diff --git a/sys/dev/rtwn/usb/rtwn_usb_var.h b/sys/dev/rtwn/usb/rtwn_usb_var.h
--- a/sys/dev/rtwn/usb/rtwn_usb_var.h
+++ b/sys/dev/rtwn/usb/rtwn_usb_var.h
@@ -27,6 +27,7 @@
#define RTWN_USB_RXBUFSZ_DEF (24)
#define RTWN_USB_RXBUFSZ_MAX (64)
#define RTWN_USB_TXBUFSZ (16 * 1024)
+#define RTWN_USB_DELAY_US_DEF 0
#define RTWN_IFACE_INDEX 0
@@ -82,6 +83,8 @@
int tx_agg_desc_num;
uint8_t wme2qid[4];
+ int uc_delay_us;
+ int uc_write_delay;
};
#define RTWN_USB_SOFTC(sc) ((struct rtwn_usb_softc *)(sc))
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 17, 9:03 PM (7 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27699179
Default Alt Text
D47562.id147010.diff (3 KB)
Attached To
Mode
D47562: rtwn: Fix RTL8188EU & RTL8192EU cannot associate in STA mode
Attached
Detach File
Event Timeline
Log In to Comment