Date: Mon, 17 Oct 2011 00:33:56 +0100 From: Steven Chamberlain <steven@pyro.eu.org> To: Adrian Chadd <adrian@freebsd.org> Cc: freebsd-net@freebsd.org, henry.hu.sh@gmail.com, nox@jelal.kn-bremen.de Subject: Re: kern/149643: [rum] device not sending proper beacon frames in ap mode Message-ID: <4E9B69E4.8030600@pyro.eu.org> In-Reply-To: <4E9B315A.6030607@pyro.eu.org> References: <201110152200.p9FM0QUO044812@freefall.freebsd.org> <CAJ-VmomdNhZd7fEv9CHTBrMaQabO1Xks4Y-gjTMKEe3KNSNPAQ@mail.gmail.com> <4E9A5FB6.7040904@pyro.eu.org> <4E9B062A.9050408@pyro.eu.org> <CAJ-Vmonvs=HaoAGvpLw43S4ATmZUi2vaG8JYFhRZAZhfvwcWbQ@mail.gmail.com> <4E9B315A.6030607@pyro.eu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------090903000206030603090609 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, I'm attaching patches for the rum device driver in freebsd and openbsd latest CVS. Firstly I am testing this on a couple of openbsd i386 boxes which should see some heavy usage tomorrow, but so far it has fixed host AP beacons during my testing here. This has also helped some devices to connect that had trouble before. After this I should be able to test similarly on freebsd and amd64. Anyone else with rum hardware suffering beacon issues is also welcome to give these a try! Thanks, Regards, -- Steven Chamberlain steven@pyro.eu.org --------------090903000206030603090609 Content-Type: text/x-patch; name="openbsd-rum-hostap-beacon-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="openbsd-rum-hostap-beacon-fix.patch" --- if_rum.c.orig 2011-07-03 16:47:17.000000000 +0100 +++ if_rum.c 2011-10-16 21:10:40.000000000 +0100 @@ -1486,17 +1486,23 @@ { 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", - sc->sc_dev.dv_xname, 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, buf + offset); + if (error != 0) { + printf("%s: could not multi write MAC register: %s\n", + sc->sc_dev.dv_xname, usbd_errstr(error)); + return; + } } } --------------090903000206030603090609 Content-Type: text/x-patch; name="freebsd-rum-hostap-beacon-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="freebsd-rum-hostap-beacon-fix.patch" --- if_rum.c.orig 2011-06-24 03:30:02.000000000 +0100 +++ if_rum.c 2011-10-16 21:05:34.000000000 +0100 @@ -1407,20 +1407,25 @@ { 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 --------------090903000206030603090609--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E9B69E4.8030600>