From owner-freebsd-current@FreeBSD.ORG Mon Mar 10 07:41:35 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1C8F41E; Mon, 10 Mar 2014 07:41:35 +0000 (UTC) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5CF2311C; Mon, 10 Mar 2014 07:41:34 +0000 (UTC) Received: from srg.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) by ns.kevlo.org (8.14.8/8.14.8) with ESMTP id s2A7eWEo032466 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 10 Mar 2014 15:40:32 +0800 (CST) (envelope-from kevlo@FreeBSD.org) Message-ID: <531D6C9C.7010607@FreeBSD.org> Date: Mon, 10 Mar 2014 15:41:16 +0800 From: Kevin Lo User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Alexey Dokuchaev , Rui Paulo Subject: Re: urtwn driver for Edimax EW-7811U WLAN nano USB Adapter References: <201310081742.r98HfbBV055077@fire.js.berklix.net> <589BAB21-30E9-4750-A345-BE7AB1116F48@FreeBSD.org> <20140210122146.GA26853@FreeBSD.org> In-Reply-To: <20140210122146.GA26853@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Julian H. Stacey" , Alfred Perlstein , "freebsd-current@freebsd.org bsd" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 07:41:35 -0000 On 2014/02/10 20:21, Alexey Dokuchaev wrote: > On Tue, Oct 15, 2013 at 11:13:56PM -0700, Rui Paulo wrote: >> On 8 Oct 2013, at 10:41, Julian H. Stacey wrote: >>> I too am seeing >>> urtwn0: timeout waiting for checksum report >> Sorry, this is a know problem that I haven't been able to figure out... >> It probably exists in the OpenBSD driver as well. Usually retrying works. > To augment this a bit: I also came across one of these dongles (vendor > 0x0bda product 0x8176) that gave me this "timeout waiting for checksum > report" message. Retrying didn't help, but plugging the dongle out and > then back in did. After powercycling the machine, I had to replug it > again. Once replugged, the dongle seems to work fine (I rebuilt kernel > and some ports via NFS over it thus far). > > This suggests that the driver (or more generic part of the USB stack) > does not initialize something correctly, while full plug-and-play thing > does it. Any ideas? We have to reset the bit of the R92C_MCUFWDL associated with checksum report before writing firmware. Could you try this patch? Thanks. Index: sys/dev/usb/wlan/if_urtwn.c =================================================================== --- sys/dev/usb/wlan/if_urtwn.c (revision 262971) +++ sys/dev/usb/wlan/if_urtwn.c (working copy) @@ -2071,6 +2071,10 @@ urtwn_load_firmware(struct urtwn_softc *sc) urtwn_write_1(sc, R92C_MCUFWDL + 2, urtwn_read_1(sc, R92C_MCUFWDL + 2) & ~0x08); + /* Reset the FWDL checksum. */ + urtwn_write_1(sc, R92C_MCUFWDL, + urtwn_read_1(sc, R92C_MCUFWDL) | R92C_MCUFWDL_CHKSUM_RPT); + for (page = 0; len > 0; page++) { mlen = min(len, R92C_FW_PAGE_SIZE); error = urtwn_fw_loadpage(sc, page, ptr, mlen);