From owner-freebsd-wireless@FreeBSD.ORG Thu Jul 10 05:06:14 2014 Return-Path: Delivered-To: freebsd-wireless@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 43C19478; Thu, 10 Jul 2014 05:06:14 +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)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D254E20D8; Thu, 10 Jul 2014 05:06:13 +0000 (UTC) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.8/8.14.8) with ESMTP id s6A55QmT014455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Jul 2014 13:05:27 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.8/8.14.8/Submit) id s6A55O2x014454; Thu, 10 Jul 2014 13:05:24 +0800 (CST) (envelope-from kevlo) Date: Thu, 10 Jul 2014 13:05:24 +0800 From: Kevin Lo To: Carlos Jacobo Puga Medina Subject: Re: TP-LINK TL-WN821N Message-ID: <20140710050524.GA14437@ns.kevlo.org> References: <20140707144056.351e26df0d1512c6fc48a954@fbsd.es> <20140707204636.50ae92cf9022cd13263932d3@fbsd.es> <20140707211035.5ce0a482fe062bc1ea64ace7@fbsd.es> <20140708022220.GA87876@ns.kevlo.org> <20140708124550.c60683f2c01f3f9aa6a4ff70@fbsd.es> <20140709100229.GA6733@ns.kevlo.org> <20140709154223.9623a93c2d458dc32339b554@fbsd.es> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140709154223.9623a93c2d458dc32339b554@fbsd.es> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: "freebsd-wireless@freebsd.org" X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2014 05:06:14 -0000 On Wed, Jul 09, 2014 at 03:42:23PM +0200, Carlos Jacobo Puga Medina wrote: > > On Wed, 9 Jul 2014 18:02:29 +0800 > Kevin Lo wrote: > > > On Tue, Jul 08, 2014 at 12:45:50PM +0200, Carlos Jacobo Puga Medina wrote: > > > > > > On Tue, 8 Jul 2014 10:22:20 +0800 > > > Kevin Lo wrote: > > > > > > > On Mon, Jul 07, 2014 at 12:16:12PM -0700, Adrian Chadd wrote: > > > > > > > > > > On 7 July 2014 12:10, Carlos Jacobo Puga Medina wrote: > > > > > > On Mon, 7 Jul 2014 11:48:36 -0700 > > > > > > Adrian Chadd wrote: > > > > > > > > > > > >> I'd just look at porting over the openbsd driver. There's no 11n > > > > > >> support in the openbsd code though! > > > > > > > > > > > > That's bad, I hope that the 802.11n protocol will be implemented since it was released in 2009. > > > > > > > > > > > > What do you recommend to do? > > > > > > > > > > I'd be happy if the driver showed up from OpenBSD. We can always try > > > > > to add 11n support. > > > > > > > > > > I'm sorry, I don't have much else to say at the moment and as my day > > > > > job is decidedly not wireless, I can't be much help. :( > > > > > > > > I'm trying to get D-Link DWA-160 rev. A1 usb wifi adapter working with > > > > latest OpenBSD snapshot (2014/07/06). It seems to me that there's a > > > > problem with otus(4). > > > > > > > > dmesg: > > > > otus0 at uhub1 port 7 "ATHER USB2.0 WLAN" rev 2.00/1.07 addr 2 > > > > otus0: MAC/BBP AR9170, RF AR9104, MIMO 2T2R, address 00:22:b0:57:fc:dc > > > > > > > > ifconfig otus0 scan doesn't yield any result. > > > > > > > > # ifconfig otus0 scan > > > > otus0: flags=28802 mtu 1500 > > > > lladdr 00:22:b0:57:fc:dc > > > > priority: 4 > > > > groups: wlan > > > > media: IEEE802.11 autoselect > > > > status: no network > > > > ieee80211: nwid "" > > > > none > > > > # > > > > > > > > > -a > > > > > > > > Kevin > > > > > > Hi, > > > > > > OpenBSD doesn't support 802.11n yet, but some of this cards run in 11g mode for now. So this could be chew better if we work together with them. > > > > All OpenBSD wireless drivers don't support .11n yet. > > What I mean is that driver is not stable. At least for D-Link DWA-160 rev. A1. > > > > > Anyway if you don't mind I'll send you some outputs from TL-WN821N. > > > > No, I don't mind. :-) Thanks. > > > > > Regards, > > > -- > > > Carlos Jacobo Puga Medina > > > > Kevin > > I'm testing a TL-WN821N v4 device. Wait a minute. You mentioned OpenBSD otus(4), I thought we were talking about the Atheros AR9170 chipset, not the Realtek RTL8192CU chip. > # uname -a > FreeBSD box.underbuild.com 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r268070: Tue Jul 1 14:05:40 CEST 2014 root@box.underbuild.com:/usr/obj/usr/src/sys/PROD i386 > > # dmesg | grep urtwn0 > urtwn0: on usbus2 > urtwn0: MAC/BB RTL8192CU, RF 6052 2T2R > urtwn0: timeout waiting for firmware readiness > > # usbconfig -u 2 -a 3 dump_device_desc > ugen2.3: at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA) > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0200 > bDeviceClass = 0x0000 > bDeviceSubClass = 0x0000 > bDeviceProtocol = 0x0000 > bMaxPacketSize0 = 0x0040 > idVendor = 0x0bda > idProduct = 0x8178 > bcdDevice = 0x0200 > iManufacturer = 0x0001 > iProduct = 0x0002 > iSerialNumber = 0x0003 > bNumConfigurations = 0x0001 > > # ifconfig urtwn0 > urtwn0: flags=8803 metric 0 mtu 2290 > ether 10:fe:ed:27:f6:5d > nd6 options=21 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: associated > > I noticed that wireless never goes up. Not much luck here, I get the error: > urtwn0: timeout waiting for firmware readiness Ok, I know where the problem lies. Please try this patch, thanks. Index: sys/dev/usb/wlan/if_urtwn.c =================================================================== --- sys/dev/usb/wlan/if_urtwn.c (revision 268479) +++ sys/dev/usb/wlan/if_urtwn.c (working copy) @@ -2281,9 +2281,6 @@ urtwn_fw_reset(struct urtwn_softc *sc) } /* Force 8051 reset. */ urtwn_write_2(sc, R92C_SYS_FUNC_EN, reg & ~R92C_SYS_FUNC_EN_CPUEN); - urtwn_write_2(sc, R92C_SYS_FUNC_EN, - urtwn_read_2(sc, R92C_SYS_FUNC_EN) | - R92C_SYS_FUNC_EN_CPUEN); } static void @@ -2383,6 +2380,11 @@ urtwn_load_firmware(struct urtwn_softc *sc) urtwn_write_1(sc, R92C_MCUFWDL, 0); } + if (!(sc->chip & URTWN_CHIP_88E)) { + urtwn_write_2(sc, R92C_SYS_FUNC_EN, + urtwn_read_2(sc, R92C_SYS_FUNC_EN) | + R92C_SYS_FUNC_EN_CPUEN); + } urtwn_write_1(sc, R92C_MCUFWDL, urtwn_read_1(sc, R92C_MCUFWDL) | R92C_MCUFWDL_EN); urtwn_write_1(sc, R92C_MCUFWDL + 2,