FreeBSD Bugzilla – Attachment 239366 Details for
Bug 247528
rtwn(4) RTL8192EU usb wifi dongle can't connect to AP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch.
pr247528 (text/plain), 2.63 KB, created by
Cy Schubert
on 2023-01-09 19:06:27 UTC
(
hide
)
Description:
Proposed patch.
Filename:
MIME Type:
Creator:
Cy Schubert
Created:
2023-01-09 19:06:27 UTC
Size:
2.63 KB
patch
obsolete
>diff --git a/sys/dev/rtwn/rtl8192e/r92e_chan.c b/sys/dev/rtwn/rtl8192e/r92e_chan.c >index 0211e2883888..56b414e77c64 100644 >--- a/sys/dev/rtwn/rtl8192e/r92e_chan.c >+++ b/sys/dev/rtwn/rtl8192e/r92e_chan.c >@@ -212,9 +212,15 @@ void > r92e_set_chan(struct rtwn_softc *sc, struct ieee80211_channel *c) > { > struct r92e_softc *rs = sc->sc_priv; >+ struct rtwn_usb_softc *uc; > u_int chan; > int i; > >+ if ((uc = RTWN_USB_SOFTC(sc)) != NULL) { >+ RTWN_LOCK(sc) >+ uc->uc_set_chan = 1; >+ RTWN_UNLOCK(sc) >+ } > chan = rtwn_chan2centieee(c); > > for (i = 0; i < sc->nrxchains; i++) { >@@ -229,4 +235,9 @@ r92e_set_chan(struct rtwn_softc *sc, struct ieee80211_channel *c) > > /* Set Tx power for this new channel. */ > r92e_set_txpower(sc, c); >+ if (uc != NULL) { >+ RTWN_LOCK(sc) >+ uc->uc_set_chan = 0; >+ RTWN_UNLOCK(sc) >+ } > } >diff --git a/sys/dev/rtwn/usb/rtwn_usb_attach.c b/sys/dev/rtwn/usb/rtwn_usb_attach.c >index 4e881b2d0de5..570605ea6aff 100644 >--- a/sys/dev/rtwn/usb/rtwn_usb_attach.c >+++ b/sys/dev/rtwn/usb/rtwn_usb_attach.c >@@ -372,6 +372,10 @@ rtwn_usb_sysctlattach(struct rtwn_softc *sc) > 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, >+ "USB delay microseconds", CTLFLAG_RDTUN, &uc->uc_delay_us, >+ uc->uc_delay_us, str); > } > > static int >diff --git a/sys/dev/rtwn/usb/rtwn_usb_reg.c b/sys/dev/rtwn/usb/rtwn_usb_reg.c >index fad6d04ec5ff..98ae3ae89ffb 100644 >--- a/sys/dev/rtwn/usb/rtwn_usb_reg.c >+++ b/sys/dev/rtwn/usb/rtwn_usb_reg.c >@@ -91,12 +91,16 @@ rtwn_usb_write_region_1(struct rtwn_softc *sc, uint16_t addr, uint8_t *buf, > 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_set_chan == 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 >index 7ef214632b12..8f283f1127ba 100644 >--- a/sys/dev/rtwn/usb/rtwn_usb_var.h >+++ b/sys/dev/rtwn/usb/rtwn_usb_var.h >@@ -28,6 +28,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 1000 > > #define RTWN_IFACE_INDEX 0 > >@@ -79,6 +80,8 @@ struct rtwn_usb_softc { > > int ntx; > int tx_agg_desc_num; >+ int uc_delay_us; >+ int uc_set_chan; > }; > #define RTWN_USB_SOFTC(sc) ((struct rtwn_usb_softc *)(sc)) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247528
:
239366
|
239399
|
239429
|
239455
|
240612
|
253233
|
253264
|
253301
|
253303
|
253304