summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorzafer <zafer@NetBSD.org>2014-03-29 00:59:05 +0000
committerzafer <zafer@NetBSD.org>2014-03-29 00:59:05 +0000
commitdaefd626abb92bd80a5bb40bf7dc8399676a8118 (patch)
tree9e16171f56fd96eadb921302c6c4cebb643f8b53 /sys
parentdd1b6be29eee72fdbf5daeb04ed0b9ce06c91807 (diff)
Fix an issue with 11g beacon frames.
From FreeBSD Rev. 226465 Makes 11g wep, wpa2 and hostap work again.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_rum.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c
index 8ee32a7bc20..2cb349a884a 100644
--- a/sys/dev/usb/if_rum.c
+++ b/sys/dev/usb/if_rum.c
@@ -1,5 +1,5 @@
/* $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $ */
-/* $NetBSD: if_rum.c,v 1.47 2013/01/22 12:40:42 jmcneill Exp $ */
+/* $NetBSD: if_rum.c,v 1.48 2014/03/29 00:59:05 zafer Exp $ */
/*-
* Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini@free.fr>
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.47 2013/01/22 12:40:42 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.48 2014/03/29 00:59:05 zafer Exp $");
#include <sys/param.h>
#include <sys/sockio.h>
@@ -1476,17 +1476,22 @@ rum_write_multi(struct rum_softc *sc, uint16_t reg, void *buf, size_t len)
{
usb_device_request_t req;
usbd_status 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 = usbd_do_request(sc->sc_udev, &req, buf);
- if (error != 0) {
- printf("%s: could not multi write MAC register: %s\n",
- device_xname(sc->sc_dev), 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 = usbd_do_request(sc->sc_udev, &req, (char *)buf + offset);
+ if (error != 0) {
+ printf("%s: could not multi write MAC register: %s\n",
+ device_xname(sc->sc_dev), usbd_errstr(error));
+ }
}
}