Finished: CALL FOR TESTERS Ralink wireless run(4) usb driver for FreeBSD

I was very excited to find this thread, but I need help getting rt2870 working.

Interface: Cisco (Linksys) WUSB600N, Version 2.0 (wedge-like shape).
It was first attached to a Windows machine, with hardware encryption enabled.
OS: amd64 FreeBSD-STABLE csup'd on 2009-12-19
System: AMD Opteron 1207

Module compiles without error, but when I load the module, I get this:

Code:
%tail -f /var/log/messages
Dec 22 12:09:49 putnam root: Unknown USB device: vendor 0x1737 product 0x0079 bus uhub1

Any help would be greatly appreciated.
 
rossgohlke said:
I was very excited to find this thread, but I need help getting rt2870 working.

Interface: Cisco (Linksys) WUSB600N, Version 2.0 (wedge-like shape).
It was first attached to a Windows machine, with hardware encryption enabled.
OS: amd64 FreeBSD-STABLE csup'd on 2009-12-19
System: AMD Opteron 1207

Module compiles without error, but when I load the module, I get this:

Code:
%tail -f /var/log/messages
Dec 22 12:09:49 putnam root: Unknown USB device: vendor 0x1737 product 0x0079 bus uhub1

Any help would be greatly appreciated.

Hm, you have new Linksys WUSB600N v2, i have tested my driver only with v1. It is easy to adjust the driver so it will also be loaded for WUSB600N v2, but i don't know if the driver will work.
But you can try it.

Edit rt2870.c and add the following line:

Code:
static const struct usb_device_id rt2870_usb_devid[] =
{
	{ USB_VP(USB_VENDOR_LINKSYS4, USB_PRODUCT_LINKSYS4_WUSB600N) },		/* Linksys WUSB600N */
+       { USB_VP(USB_VENDOR_LINKSYS4, 0x0079) },		/* Linksys WUSB600N v2 */

	{ USB_VP(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA140) },			/* D-Link DWA-140 */
	{ USB_VP(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA160AREVB) },		/* D-Link DWA-160A Rev. B */
	{ USB_VP(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_RT2770F) },				/* Asus RT2770F */
};

After that, recompile the driver and post your feeback here please.
Thanks.

UPDATE
Sorry, but my rt2870 driver will not work with your NIC because WUSB600N v2
has another chipset (RT3572) :-(

See this link: http://forums.remote-exploit.org/backtrack-4-non-working-hardware/29502-rt3572-wusb600n-v2.html
 
rossgohlke said:
Wow, thanks the for quick response and for the link.
Should I try ndis_wrapper?
Keep up the great work.

i don't know about ndis but there is already a Linux driver fot this chipset on Ralink web site. I know the Linux driver for rt2870 very well and it is very similar to rt3572, but EEPROM is quite different :e I guess i could port my rt2870 driver
for rt3572, but i don't have any rt3572 hardware so i could test the driver.
 
I have added support for WUSB600N ver.2. My driver supports some RT30XX chips to begin with.

I don't have the device with that chipset. I cannot test. It may works, or may not work at all. Try it at your own risk! Don't blame me if your device get toasted.

-- updated on Jan 09, 2010 --
Please go to the first post for the latest update.
 

Attachments

  • run-test.tar.bz2
    68.3 KB · Views: 253
I'm not able to load the if_run.

Code:
% make
Warning: Object directory not changed from original /stg/sfw/dld/run-test/sys/modules/usb/run
:> opt_usb.h
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/usbdevs2h.awk @/dev/usb/usbdevs -h
cc -O2 -pipe -funroll-loops -DWITNESS -DINVARIANT_SUPPORT -DINVARIANTS -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ 
-I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer 
-mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables 
-ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-
prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c /stg/sfw/dld/run-test/sys/modules/usb/run
/../../../dev/usb/wlan/if_run.c
ld  -d -warn-common -r -d -o if_run.ko if_run.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk if_run.ko  export_syms | xargs -J% objcopy % if_run.ko
objcopy --strip-debug if_run.ko
# make install
install -o root -g wheel -m 555   if_run.ko /boot/kernel
kldxref /boot/kernel
# kldload if_run
kldload: can't load if_run: Exec format error

Also, README needs small edit:
Code:
-        %cd sys/modules/usb/runfw
+        %cd sys/modules/runfw

Any ideas? I have a custom kernel installed, as well as ccache. I also tried this make command:
#env -i make -j8 -DALWAYS_CHECK_MAKE -DNOCCACHE KERNCONF=TUNED
 
A ha! I changed Makefile

Code:
-CFLAGS += -DWITNESS -DINVARIANT_SUPPORT -DINVARIANTS
+#CFLAGS += -DWITNESS -DINVARIANT_SUPPORT -DINVARIANTS

#kldload if_run


Code:
1) After created wlan device, please run
        #ifconfig wlan0 country
   with proper country code, before doing anything.

This gives me pause. I'm going to man ifconfig first...
 
It loaded!

Code:
#kldload if_run
#ifconfig
run0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:25:9c:0a:77:90
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier

#ifconfig wlan create wlandev run0
#ifconfig wlan0 list countries
#ifconfig wlan0 country US
#ifconfig
run0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:25:9c:0a:77:90
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:25:9c:0a:77:90
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid "" channel 1 (2412 Mhz 11b)
        regdomain FCC country US authmode OPEN privacy OFF txpower 30 bmiss 7
        scanvalid 60 wme bintval 0

README should be updated with first command.
#ifconfig wlan create wlandev run0

Now, to configure it...

Thanks for all the help!
 
Is it working now? Let me know how the driver doing.

I guess I have to update README file, too.

Thanks for taking risks (oops testing the driver).
 
PseudoCylon said:
I have added support for WUSB600N ver.2. My driver supports some RT30XX chips to begin with.

I don't have the device with that chipset. I cannot test. It may works, or may not work at all. Try it at your own risk! Don't blame me if your device get toasted.

1. I'm running with a GENERIC kernel, so I had to change the definition of RUN_LOCK_ASSERT to the empty string.

2. After plugging in my Zonet ZEW2500P (04), my log said:
Code:
Dec 25 19:28:16 milk kernel: ugen2.2: <Ralink> at usbus2
Dec 25 19:28:16 milk kernel: run0: <.0> on usbus2
Dec 25 19:28:16 milk kernel: run0: MAC/BBP RT3070 (rev 0x0201), RF RT3020 (MIMO 
1T1R), address 00:a1:b0:c0:25:e8
Dec 25 19:28:16 milk kernel: run0: You are using firmware RT2870.

3. When I typed "ifconfig run0 country US", I got:
ifconfig: unable to get regulatory domain info: Invalid argument

4. When I typed "ifconfig run0 up", the system immediately crashed. The crash summary is at:
http://www.m5p.com/~george/core.txt.0

What do you suggest I do next? (And thanks for all the work!)
 
You need to create wlan0, first.

After kldload if_run, do
# ifconfig wlan create wlandev run0
# ifconfig [b]wlan0[/b] country US
# ifconfig [b]wlan0[/b] up

Once you create wlan0, use wlan0 instead of run0. This is new for 8.0.

I definitely need to update README, after holidays.

Merry Christmas.
 
egorenar said:
Hm, did you modified your rc.conf as i said and of cause you need to configure your wpa_supplicant. Did you do this ?

PS: you can write to my ICQ account and i can help you faster.

I am having a similar issue. I have edited rd.conf as you said with:

wlans_rt28600="wlan0"
ifconfig_wlan0="ssid KretNet WPA DHCP"

and have also used your supplied config as well [ifconfig_wlan0="WPA DHCP" with the same results.

when I restart netif, I get the errors:

Code:
wlan0: Ethernet address: 00:1e:e5:e8:d5:4f
ifconfig: DHCP: bad vaule
rt28600 initializing
/etc/rc.d/wpa_supplicant: Warning: /etc/wpa_supplicant.conf is not readable
/etc/rc.d/wpa_supplicant: Warning:failed precmd routine for wpa_supplicant
Starting Network lo0
lo0 flags=8049(UP,LOOPBACK,RUNNING,MULTICAST) metric 0 mtu 16384
options=3(RXCSUM,TXCSUM)
inet6 fe80::1%1o0 prefixlen 64 scopeid 0x5
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000


You'll have to excuse any silly errors as I'm still pretty new to FreeBSD
 
TheBiggestGnome said:
I am having a similar issue. I have edited rd.conf as you said with:

wlans_rt28600="wlan0"
ifconfig_wlan0="ssid KretNet WPA DHCP"

and have also used your supplied config as well [ifconfig_wlan0="WPA DHCP" with the same results.

when I restart netif, I get the errors:

Code:
wlan0: Ethernet address: 00:1e:e5:e8:d5:4f
ifconfig: DHCP: bad vaule
rt28600 initializing
/etc/rc.d/wpa_supplicant: Warning: /etc/wpa_supplicant.conf is not readable
/etc/rc.d/wpa_supplicant: Warning:failed precmd routine for wpa_supplicant
Starting Network lo0
lo0 flags=8049(UP,LOOPBACK,RUNNING,MULTICAST) metric 0 mtu 16384
options=3(RXCSUM,TXCSUM)
inet6 fe80::1%1o0 prefixlen 64 scopeid 0x5
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000


You'll have to excuse any silly errors as I'm still pretty new to FreeBSD

Hi,

you also have to configure WPA supplicant properly.
What looks your /etc/wpa_supplicant.conf like ?
 
I think you cannot mix "ssid foo" and "WPA". You define the ssid and the wpa key in /etc/wpa_supplicant.conf and the supplicant takes care of connecting to the right network.
 
egorenar said:
Hi,

you also have to configure WPA supplicant properly.
What looks your /etc/wpa_supplicant.conf like ?

because I have to manually type out anything from the other pc, what exactly are you looking for?

I'll provide you with the first few lines:

Code:
#!/bin/sh
#
# $FreeBSD: src/etc/rc.d/wpa_supplicant,v 1.6.2.2.2.1 2009/10/25 01:10:29 kensmith Exp$
#

# PROVIDE: wpa_supplicant
# REQUIRE: mountcritremote
# KEYWORD: nojail nostart

. /etc/rc.subr
. /etc/network.subr

name="wpa_supplicant"
rcvar=

ifn="$2"
 
TheBiggestGnome said:
because I have to manually type out anything from the other pc, what exactly are you looking for?

I'll provide you with the first few lines:

Code:
#!/bin/sh
#
# $FreeBSD: src/etc/rc.d/wpa_supplicant,v 1.6.2.2.2.1 2009/10/25 01:10:29 kensmith Exp$
#

# PROVIDE: wpa_supplicant
# REQUIRE: mountcritremote
# KEYWORD: nojail nostart

. /etc/rc.subr
. /etc/network.subr

name="wpa_supplicant"
rcvar=

ifn="$2"

I assume you want to use WPA or WPA2 with your NIC :)

You have to edit /etc/wpa_supplicant.conf.

Here is an example of /etc/wpa_supplicant.conf:

Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
        ssid="my_network"
        proto=RSN WPA
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk="secret_password"
}

Change ssid "my_network" to your network ssid and
psk "secret_password" to your password.
Then restart netif as root with

Code:
# /etc/rc.d/netif restart

See also this link:
http://www.freebsd.org/doc/en/books/handbook/network-wireless.html
 
egorenar said:
I assume you want to use WPA or WPA2 with your NIC :)

You have to edit /etc/wpa_supplicant.conf.

Here is an example of /etc/wpa_supplicant.conf:

Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
        ssid="my_network"
        proto=RSN WPA
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk="secret_password"
}

Change ssid "my_network" to your network ssid and
psk "secret_password" to your password.
Then restart netif as root with

Code:
# /etc/rc.d/netif restart

See also this link:
http://www.freebsd.org/doc/en/books/handbook/network-wireless.html

and if its just an open network without any kind of security, do i need to add all of the WPA/TKIP stuff?

I'll see what I can find in the handbook, as well
 
Apparently, you cen't edit until one has so many posts under their belt.

So, I don't need to configure WPA, because well, I don't use it. I have edited rc.conf to reflect that:

Code:
ifconfig_wlan0="ssid NETWORK_HERE DHCP"

Now the only issue I have is:
Code:
Status: no carrier
 
the WMP600N, with your rt28600 loaded, hopefully correct

Code:
# ifconfig
.....
rt28600: flags=8843(UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST) metric 0 MTU 2290
ether 00:1E:E5:E8:D5:4F
media: IEEE 802.11 Wireless Ethernet autoselect mode 11a
status: associated

wlan0: flags=8843(UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST) METRIC 0 MTU 1500
ether: 00:1e:e5:e8:d5:4f
media IEEE 802.11 Wireless Ethernet autoselect (autoselect)
status: no carrier
ssid KretNet channel 132 (5660 Mhz 11a)
country US authmode OPEN privacy OFF txpower 0 bmiss 7 mcastrate 6
mgmtrate 6 scanvaild 60 wme burst bintval 0
 
You can also use wpa_supplicant with a network without securiry.

Example:

Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
	ssid="my_network"
	key_mgmt=NONE
}

Try this config, it should work. I don't know how to associate with
a network without WPA supplicant.

But it is not a good idea to use no security.
WMP600N supports WPA2-AES in hardware and my driver works well with it.
I have the same NIC and it works fine with WPA2.
But it is of course your decision :)
 
egorenar said:
You can also use wpa_supplicant with a network without securiry.

Example:

Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
	ssid="my_network"
	key_mgmt=NONE
}

Try this config, it should work. I don't know how to associate with
a network without WPA supplicant.

But it is not a good idea to use no security.
WMP600N supports WPA2-AES in hardware and my driver works well with it.
I have the same NIC and it works fine with WPA2.
But it is of course your decision :)

Alright, after /etc/rc.d/netif restart:
Code:
rt28600: flags=8802<BROADCAST,SIMPLEX,MULTICAST) metric 0 mtu 2290
ether 00:1e:e5:e8:d5:4f
media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
status: no carrier
ifconfig: interface wlan0 does not exist
wlan0: Ethernet address: 00:1e:e5:e8:d5:4f
Starting wpa_supplicant
Starting Network lo0
.....
[root@~/rt2860_fbsd8]# Dec 30 16:05:05  wpa_supplicant[3785]: Failed to initialize control interface '/var/run/wpa_supplicant'. You may have 
another wpa_suplicant process already running or the file left by an unclean termination of wpa_supplicant in which case you will need to 
manually remove this file before starting wpa_supplicant again.
Dec 30 16:05:05 wpa_supplicant[3785] Failed to disable WPA in the driver
rt28600 initializing
 
TheBiggestGnome said:
Alright, after /etc/rc.d/netif restart:
Code:
rt28600: flags=8802<BROADCAST,SIMPLEX,MULTICAST) metric 0 mtu 2290
ether 00:1e:e5:e8:d5:4f
media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
status: no carrier
ifconfig: interface wlan0 does not exist
wlan0: Ethernet address: 00:1e:e5:e8:d5:4f
Starting wpa_supplicant
Starting Network lo0
.....
[root@~/rt2860_fbsd8]# Dec 30 16:05:05  wpa_supplicant[3785]: Failed to initialize control interface '/var/run/wpa_supplicant'. You may have 
another wpa_suplicant process already running or the file left by an unclean termination of wpa_supplicant in which case you will need to 
manually remove this file before starting wpa_supplicant again.
Dec 30 16:05:05 wpa_supplicant[3785] Failed to disable WPA in the driver
rt28600 initializing

These log messages are OK, but you didn't post the complete log.
What says ifconfig now ?
 
Back
Top