Re: Wifi TEW-649UB RSU(4) problem

2016-07-26 Thread Jake Swensen
Thank you, Stefan.  How should I implement the below fix in my system?

Should I install the latest OpenBSD snapshot after a few days?

Regards,
Jake Swensen

On 07/26/16 10:33, Stefan Sperling wrote:
> On Tue, Jul 26, 2016 at 09:26:47AM -0500, Jake Swensen wrote:
>> Hello,
>>
>> My name is Jake Swensen and I would appreciate any help with using the
>> rsu wireless network adapter driver.
>>
>> My friend's RTL8187L 802.11g USB wifi adapter works well (with the urtw
>> driver) on my laptop with OpenBSD 5.9 and 6.0 but I am not able to get a
>> Trendnet TEW-649UB to work.  It worked when I had FreeBSD installed on
>> this laptop, so I don't think the hardware is damaged.
> Yes, it was broken in r1.32 (before 5.9):
>
> @@ -2274,8 +2274,8 @@
>   ic->ic_bss->ni_chan = ic->ic_ibss_chan;
>  
>   /* We're ready to go. */
> - ifp->if_flags &= ~IFF_OACTIVE;
>   ifp->if_flags |= IFF_RUNNING;
> + ifq_set_oactive(>if_snd);
>
> So the driver sets IFF_OACTIVE at init and no frames will pass out.
>
> This fixes it:
>
> Index: if_rsu.c
> ===
> RCS file: /cvs/src/sys/dev/usb/if_rsu.c,v
> retrieving revision 1.34
> diff -u -p -r1.34 if_rsu.c
> --- if_rsu.c  13 Apr 2016 11:03:37 -  1.34
> +++ if_rsu.c  26 Jul 2016 15:31:44 -
> @@ -2263,7 +2263,7 @@ rsu_init(struct ifnet *ifp)
>  
>   /* We're ready to go. */
>   ifp->if_flags |= IFF_RUNNING;
> - ifq_set_oactive(>if_snd);
> + ifq_clr_oactive(>if_snd);
>  
>  #ifdef notyet
>   if (ic->ic_flags & IEEE80211_F_WEPON) {



Re: Wifi TEW-649UB RSU(4) problem

2016-07-26 Thread Stefan Sperling
On Tue, Jul 26, 2016 at 09:26:47AM -0500, Jake Swensen wrote:
> Hello,
> 
> My name is Jake Swensen and I would appreciate any help with using the
> rsu wireless network adapter driver.
> 
> My friend's RTL8187L 802.11g USB wifi adapter works well (with the urtw
> driver) on my laptop with OpenBSD 5.9 and 6.0 but I am not able to get a
> Trendnet TEW-649UB to work.  It worked when I had FreeBSD installed on
> this laptop, so I don't think the hardware is damaged.

Yes, it was broken in r1.32 (before 5.9):

@@ -2274,8 +2274,8 @@
ic->ic_bss->ni_chan = ic->ic_ibss_chan;
 
/* We're ready to go. */
-   ifp->if_flags &= ~IFF_OACTIVE;
ifp->if_flags |= IFF_RUNNING;
+   ifq_set_oactive(>if_snd);

So the driver sets IFF_OACTIVE at init and no frames will pass out.

This fixes it:

Index: if_rsu.c
===
RCS file: /cvs/src/sys/dev/usb/if_rsu.c,v
retrieving revision 1.34
diff -u -p -r1.34 if_rsu.c
--- if_rsu.c13 Apr 2016 11:03:37 -  1.34
+++ if_rsu.c26 Jul 2016 15:31:44 -
@@ -2263,7 +2263,7 @@ rsu_init(struct ifnet *ifp)
 
/* We're ready to go. */
ifp->if_flags |= IFF_RUNNING;
-   ifq_set_oactive(>if_snd);
+   ifq_clr_oactive(>if_snd);
 
 #ifdef notyet
if (ic->ic_flags & IEEE80211_F_WEPON) {



Wifi TEW-649UB RSU(4) problem

2016-07-26 Thread Jake Swensen
Hello,

My name is Jake Swensen and I would appreciate any help with using the
rsu wireless network adapter driver.

My friend's RTL8187L 802.11g USB wifi adapter works well (with the urtw
driver) on my laptop with OpenBSD 5.9 and 6.0 but I am not able to get a
Trendnet TEW-649UB to work.  It worked when I had FreeBSD installed on
this laptop, so I don't think the hardware is damaged.

I understand that 802.11n mode is not supported by rsu(4) but I also
tried "sudo ifconfig rsu0 mode 11g" and "sudo ifconfig rsu0 mode 11b" --
neither mode worked.  I am running a fresh install of OpenBSD 6.0
snapshot from 2016-07-24 because I thought it might have a newer driver
than OpenBSD 5.9, which I was previously running on my laptop.

Initially the firmware did not load at bootup because it's not included
with the default install, so I ran fw_update and then it appears to have
loaded at bootup.  However, some error messages are displayed and an
IPaddress cannot be assigned.

user@pc15 ~ % sudo fw_update -v
Path to firmware: http://firmware.openbsd.org/firmware/6.0/
Updating: rsu-firmware-1.2p0


user@pc15 ~myConf % ls /etc/firmware/rsu*
/etc/firmware/rsu-license /etc/firmware/rsu-rtl8712fw


Partial dmesg output for the rsu0:
rsu0 at uhub3 port 2 configuration 1 interface 0 "Manufacturer Realtek
11n USB Adapter" rev 2.00/2.00 addr 3
rsu0: MAC/BB RTL8712 cut 3, address d8:eb:97:14:b6:7a
rsu0: could not send join command
rsu0: could not send site survey command


This SSID does not require authentication:
user@pc15 ~myConf % cat /etc/hostname.rsu0
nwid mywifi-ssid
dhcp


After login to Gnome:
user@pc15 /etc/firmware % ifconfig
lo0: flags=8049 mtu 32768
index 2 priority 0 llprio 3
groups: lo
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff00
enc0: flags=0<>
index 1 priority 0 llprio 3
groups: enc
status: active
rsu0: flags=8c43 mtu 1500
lladdr d8:eb:97:14:b6:7a
index 3 priority 4 llprio 3
groups: wlan
media: IEEE802.11 autoselect (DS1)
status: no network
ieee80211: nwid mywifi-ssid
pflog0: flags=141 mtu 33144
index 4 priority 0 llprio 3
groups: pflog


user@pc15 ~ % sudo sh /etc/netstart
Password:
DHCPDISCOVER on rsu0 - interval 3
DHCPDISCOVER on rsu0 - interval 3
DHCPDISCOVER on rsu0 - interval 5
DHCPDISCOVER on rsu0 - interval 13
DHCPDISCOVER on rsu0 - interval 21
DHCPDISCOVER on rsu0 - interval 16
No acceptable DHCPOFFERS received.
No working leases in persistent database - sleeping.


Thanks,

Jake Swensen
jakedo...@gmail.com