From owner-freebsd-net@FreeBSD.ORG Sun Oct 16 23:34:04 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5636C106572C; Sun, 16 Oct 2011 23:34:03 +0000 (UTC) (envelope-from steven@pyro.eu.org) Received: from falkenstein-1.sn.de.cluster.ok24.net (maidenhead-1.wnm.uk.cluster.ok24.net [IPv6:2002:4e2f:2f89:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 441228FC13; Sun, 16 Oct 2011 23:34:03 +0000 (UTC) Received: from maidenhead-1.wnm.uk.cluster.ok24.net ([10.1.0.1] helo=falkenstein-1.sn.de.cluster.ok24.net) by falkenstein-1.sn.de.cluster.ok24.net with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1RFaDR-0000NE-V6; Mon, 17 Oct 2011 00:34:01 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=pyro.eu.org; s=10.2011; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=ZG11fQ8C2RifE86Ekr9ngM3mqcJLnvcMrbKoVEVq6pE=; b=ZbxTIw/jdPA8Z2533EwH5tGn4mb4RPdalUCK4KW94Ynthzs54peSr6HvM5BiKkx5R27JHbv8SYBpShw8M21fDan8wbIyFmZTqjD49YNWlWNTuqhxGxog9jJrTlmY6q4FNE71Lr+vuBzM1rHJUJJ1a8p9R6siJhOHcQI2mDJFEnU=; Received: from 188-220-33-66.zone11.bethere.co.uk ([188.220.33.66] helo=guisborough-1.rcc.uk.cluster.ok24.net) by falkenstein-1.sn.de.cluster.ok24.net with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1RFaDR-0000NB-QE; Mon, 17 Oct 2011 00:34:01 +0100 X-Spam-Status: No, score=-4.1 required=2.0 tests=ALL_TRUSTED, AWL, BAYES_00, DKIM_POLICY_SIGNALL, SARE_OBFU_VALUE Received: from [192.168.0.110] (helo=[192.168.0.9]) by guisborough-1.rcc.uk.cluster.ok24.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1RFaDM-00072A-Ls; Mon, 17 Oct 2011 00:34:01 +0100 Message-ID: <4E9B69E4.8030600@pyro.eu.org> Date: Mon, 17 Oct 2011 00:33:56 +0100 From: Steven Chamberlain User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20111006 Icedove/3.0.11 MIME-Version: 1.0 To: Adrian Chadd References: <201110152200.p9FM0QUO044812@freefall.freebsd.org> <4E9A5FB6.7040904@pyro.eu.org> <4E9B062A.9050408@pyro.eu.org> <4E9B315A.6030607@pyro.eu.org> In-Reply-To: <4E9B315A.6030607@pyro.eu.org> X-Enigmail-Version: 1.0.1 Content-Type: multipart/mixed; boundary="------------090903000206030603090609" 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 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2011 23:34:04 -0000 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--