From owner-svn-src-stable-8@FreeBSD.ORG Sat Oct 22 01:29:36 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14AB71065674; Sat, 22 Oct 2011 01:29:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE3CF8FC13; Sat, 22 Oct 2011 01:29:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9M1TZAF051088; Sat, 22 Oct 2011 01:29:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9M1TZsY051086; Sat, 22 Oct 2011 01:29:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201110220129.p9M1TZsY051086@svn.freebsd.org> From: Adrian Chadd Date: Sat, 22 Oct 2011 01:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226624 - stable/8/sys/dev/usb/wlan X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2011 01:29:36 -0000 Author: adrian Date: Sat Oct 22 01:29:35 2011 New Revision: 226624 URL: http://svn.freebsd.org/changeset/base/226624 Log: Merge r226465 (below message) and r226467 (subsequent compile fixes). 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 Modified: stable/8/sys/dev/usb/wlan/if_rum.c Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Fri Oct 21 22:28:15 2011 (r226623) +++ stable/8/sys/dev/usb/wlan/if_rum.c Sat Oct 22 01:29:35 2011 (r226624) @@ -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