diff options
author | adrian <adrian@FreeBSD.org> | 2011-10-17 13:12:47 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2011-10-17 13:12:47 +0000 |
commit | 38dbb1146beb40a992c010bbe14e59992d32ba22 (patch) | |
tree | 64902007685abc62a765eaee54ae8d965f48e678 | |
parent | 505a4146dc10e53888ad4248c24cab53673f3d62 (diff) | |
download | FreeBSD-src-38dbb1146beb40a992c010bbe14e59992d32ba22.zip FreeBSD-src-38dbb1146beb40a992c010bbe14e59992d32ba22.tar.gz |
Fix an issue with 11g beacon frames which looks to be a limitation
on the largest multi-write size.
From the submitter:
==
I looked further into the magic 88-byte threshold after which the bug
occurs. It turns out that figure included the 24-byte tx_desc, and up
to 64 bytes of beacon frame (header+data).
rum_write_multi doesn't seem happy with writing >64 bytes at a time to
the MAC register. If I break it up into separate calls (e.g. bytes
0-63, then bytes 64-65, written at the appropriate offset) I see the
proper beacon frames being transmitted now.
==
Submitted by: Steven Chamberlain <steven@pyro.eu.org>
MFC after: 3 days
-rw-r--r-- | sys/dev/usb/wlan/if_rum.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index 5a69792..87d92aa 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -1407,20 +1407,25 @@ rum_write_multi(struct rum_softc *sc, uint16_t reg, void *buf, size_t len) { struct usb_device_request req; usb_error_t error; + int offset; req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = RT2573_WRITE_MULTI_MAC; USETW(req.wValue, 0); - USETW(req.wIndex, reg); - USETW(req.wLength, len); - error = rum_do_request(sc, &req, buf); - if (error != 0) { - device_printf(sc->sc_dev, - "could not multi write MAC register: %s\n", - usbd_errstr(error)); + /* write at most 64 bytes at a time */ + for (offset = 0; offset < len; offset += 64) { + USETW(req.wIndex, reg + offset); + USETW(req.wLength, MIN(len - offset, 64)); + + error = rum_do_request(sc, &req, buf + offset); + if (error != 0) { + device_printf(sc->sc_dev, + "could not multi write MAC register: %s\n", + usbd_errstr(error)); + return (error); + } } - return (error); } static void |