svn commit: r229111 - stable/9/sys/dev/usb/wlan

Hans Petter Selasky hselasky at FreeBSD.org
Sat Dec 31 14:57:53 UTC 2011


Author: hselasky
Date: Sat Dec 31 14:57:52 2011
New Revision: 229111
URL: http://svn.freebsd.org/changeset/base/229111

Log:
  MFC r226465 and r226467:
  Fix an issue with 11g beacon frames which looks to be a limitation
  on the largest multi-write size.

Modified:
  stable/9/sys/dev/usb/wlan/if_rum.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- stable/9/sys/dev/usb/wlan/if_rum.c	Sat Dec 31 14:56:26 2011	(r229110)
+++ stable/9/sys/dev/usb/wlan/if_rum.c	Sat Dec 31 14:57:52 2011	(r229111)
@@ -1407,20 +1407,27 @@ rum_write_multi(struct rum_softc *sc, ui
 {
 	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, (char *)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);
+
+	return (USB_ERR_NORMAL_COMPLETION);
 }
 
 static void


More information about the svn-src-stable-9 mailing list