Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2014 13:05:24 +0800
From:      Kevin Lo <kevlo@FreeBSD.org>
To:        Carlos Jacobo Puga Medina <cpm@fbsd.es>
Cc:        "freebsd-wireless@freebsd.org" <freebsd-wireless@freebsd.org>
Subject:   Re: TP-LINK TL-WN821N
Message-ID:  <20140710050524.GA14437@ns.kevlo.org>
In-Reply-To: <20140709154223.9623a93c2d458dc32339b554@fbsd.es>
References:  <20140707144056.351e26df0d1512c6fc48a954@fbsd.es> <CAJ-VmonsACKLQ4LpkwJAzOeNyhNFCRq2Gw%2ByjTHd9fyDQ2OOXw@mail.gmail.com> <20140707204636.50ae92cf9022cd13263932d3@fbsd.es> <CAJ-VmonuLAk4JS1yR7W%2BZB-zU=JXbhhzCBtowG6C%2BvNLZthGKQ@mail.gmail.com> <20140707211035.5ce0a482fe062bc1ea64ace7@fbsd.es> <CAJ-VmokHTSGU6a7JBAx2=m6zU%2BEmE3eyn0YQJfjkja4uHHurpw@mail.gmail.com> <20140708022220.GA87876@ns.kevlo.org> <20140708124550.c60683f2c01f3f9aa6a4ff70@fbsd.es> <20140709100229.GA6733@ns.kevlo.org> <20140709154223.9623a93c2d458dc32339b554@fbsd.es>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <kevlo@FreeBSD.org> 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 <kevlo@FreeBSD.org> wrote:
> > > 
> > > > On Mon, Jul 07, 2014 at 12:16:12PM -0700, Adrian Chadd wrote:
> > > > > 
> > > > > On 7 July 2014 12:10, Carlos Jacobo Puga Medina <cpm@fbsd.es> wrote:
> > > > > > On Mon, 7 Jul 2014 11:48:36 -0700
> > > > > > Adrian Chadd <adrian@freebsd.org> 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<BROADCAST,SIMPLEX,MULTICAST,NOINET6> 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 <cpm@fbsd.es>
> > 
> > 	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: <vendor 0x0bda product 0x8178, class 0/0, rev 2.00/2.00, addr 3> 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: <product 0x8178 vendor 0x0bda> 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  <retrieving string failed>
>   iProduct = 0x0002  <retrieving string failed>
>   iSerialNumber = 0x0003  <retrieving string failed>
>   bNumConfigurations = 0x0001 
> 
> # ifconfig urtwn0
> urtwn0: flags=8803<UP,BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
> 	ether 10:fe:ed:27:f6:5d
> 	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
> 	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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140710050524.GA14437>