Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2014 18:03:17 +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:  <20140710100317.GA16286@ns.kevlo.org>
In-Reply-To: <20140710112344.86496b02b2d62197a1e467ba@fbsd.es>
References:  <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> <20140710050524.GA14437@ns.kevlo.org> <20140710112344.86496b02b2d62197a1e467ba@fbsd.es>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 10, 2014 at 11:23:44AM +0200, Carlos Jacobo Puga Medina wrote:
> 
> On Thu, 10 Jul 2014 13:05:24 +0800
> Kevin Lo <kevlo@FreeBSD.org> wrote:
> 
> > 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,
> >
> > I'm just rebuilding the kernel.
> 
> It works! Thanks a lot for your help :)

Excellent, glad to hear it’s working well for you.

> # ifconfig -v wlan0
> wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	ether 10:fe:ed:27:f6:5d
> 	inet6 fe80::12fe:edff:fe27:f65d%wlan0 prefixlen 64 scopeid 0x4 
> 	inet 192.168.1.42 netmask 0xffffff00 broadcast 192.168.1.255 
> 	nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
> 	media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
> 	status: associated
> 	ssid XXXXXXXXXX channel 11 (2462 MHz 11g) bssid f8:8e:85:c7:11:3d
> 	regdomain ETSI2 country ES anywhere -ecm authmode WPA -wps -tsn
> 	privacy ON deftxkey UNDEF
> 	TKIP 2:128-bit powersavemode OFF powersavesleep 100 txpower 30
> 	txpowmax 50.0 -dotd rtsthreshold 2346 fragthreshold 2346 bmiss 7
> 	11a     ucast NONE    mgmt  6 Mb/s mcast  6 Mb/s maxretry 6
> 	11b     ucast NONE    mgmt  1 Mb/s mcast  1 Mb/s maxretry 6
> 	11g     ucast NONE    mgmt  1 Mb/s mcast  1 Mb/s maxretry 6
> 	turboA  ucast NONE    mgmt  6 Mb/s mcast  6 Mb/s maxretry 6
> 	turboG  ucast NONE    mgmt  1 Mb/s mcast  1 Mb/s maxretry 6
> 	sturbo  ucast NONE    mgmt  6 Mb/s mcast  6 Mb/s maxretry 6
> 	11na    ucast NONE    mgmt 12 MCS  mcast 12 MCS  maxretry 6
> 	11ng    ucast NONE    mgmt  2 MCS  mcast  2 MCS  maxretry 6
> 	half    ucast NONE    mgmt  3 Mb/s mcast  3 Mb/s maxretry 6
> 	quarter ucast NONE    mgmt  1 Mb/s mcast  1 Mb/s maxretry 6
> 	scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250
> 	roam:11a     rssi    7dBm rate 12 Mb/s
> 	roam:11b     rssi    7dBm rate  1 Mb/s
> 	roam:11g     rssi    7dBm rate  5 Mb/s
> 	roam:turboA  rssi    7dBm rate 12 Mb/s
> 	roam:turboG  rssi    7dBm rate 12 Mb/s
> 	roam:sturbo  rssi    7dBm rate 12 Mb/s
> 	roam:11na    rssi    7dBm  MCS  1    
> 	roam:11ng    rssi    7dBm  MCS  1    
> 	roam:half    rssi    7dBm rate  6 Mb/s
> 	roam:quarter rssi    7dBm rate  3 Mb/s
> 	-pureg protmode CTS -ht -htcompat -ampdu ampdulimit 64k
> 	ampdudensity 8 -amsdu -shortgi htprotmode RTSCTS -puren -smps -rifs
> 	-wme -burst -dwds roaming MANUAL bintval 100
> 	groups: wlan 
> 
> # 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  <802.11n>
>   iProduct = 0x0002  <USB WLAN>
>   iSerialNumber = 0x0003  <00e04c000001>
>   bNumConfigurations = 0x0001 
> 
> # netstat -I urtwn0
> Name    Mtu Network       Address              Ipkts Ierrs Idrop    Opkts Oerrs  Coll
> urtwn  2290 <Link#3>      10:fe:ed:27:f6:5d        0     0     0     1055     0     0
> 
> Could you commit this little tweak to -HEAD?

Committed as r268487, thanks.

> Regards,
> -- 
> Carlos Jacobo Puga Medina <cpm@fbsd.es>

	Kevin



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