Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Fix an issue with 11g beacon frames.
details: https://anonhg.NetBSD.org/src/rev/31ba3fb91f70
branches: trunk
changeset: 328187:31ba3fb91f70
user: zafer <zafer%NetBSD.org@localhost>
date: Sat Mar 29 00:59:05 2014 +0000
description:
Fix an issue with 11g beacon frames.
>From FreeBSD Rev. 226465
Makes 11g wep, wpa2 and hostap work again.
diffstat:
sys/dev/usb/if_rum.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diffs (48 lines):
diff -r b572310ca21c -r 31ba3fb91f70 sys/dev/usb/if_rum.c
--- a/sys/dev/usb/if_rum.c Fri Mar 28 23:22:27 2014 +0000
+++ b/sys/dev/usb/if_rum.c Sat Mar 29 00:59:05 2014 +0000
@@ -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@localhost>
@@ -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 @@
{
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);
+
+ /* 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, buf);
- if (error != 0) {
- printf("%s: could not multi write MAC register: %s\n",
- device_xname(sc->sc_dev), usbd_errstr(error));
+ 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));
+ }
}
}
Home |
Main Index |
Thread Index |
Old Index