# US. Robotic Wireless Lan Stick



## emka81 (May 24, 2010)

Good Evening guys,

again i need your professional thoughts. I have an USB wireless lan Stick. It is called US. Robotics USR5422 (It is a Prism54 Chipset inside, because under Linux Debian the Stick works with p54USB and isl3890usb firmeware ) http://wiki.debian.org/prism54

I was looking around the inet of an nativ driver for freebsd, because when i stick on it said

```
ugen3.2: <U5> at usbus3
```
nothing more .... 

so i read http://www.freebsd.org/doc/en/books/handbook/network-wireless.html and http://www.freebsd.org/doc/en/books/handbook/config-network-setup.html 

and tried to build a ndis driver
`# ndisgen /path/to/W32DRIVER.INF /path/to/W32DRIVER.SYS`

and it looked, like the stick began to work (a led was going on)

dmesg output:

```
can't re-use a leaf (BusType)!
ndis0: NDIS API version: 5.1
```

ifconfig output:

```
ndis0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:c2:41:54:f0:d4
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
```

everything was looking so good ! then i build a wlan0 device
`# ifconfig wlan0 create wlandev ndis0 inet 192.168.0.20 netmask 255.255.255.0`
`# ifconfig wlan0 ssid ringe`

ifconfig now:

```
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:c2:41:54:f0:d4
        inet 192.168.0.20 netmask 0xffffff00 broadcast 192.168.0.255
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid ringe channel 1 (2412 MHz 11g)
        country US authmode OPEN privacy OFF txpower 0 bmiss 7 mcastrate 6
        mgmtrate 6 scanvalid 60 protmode CTS bintval 0
```

and there is the fault !! I don't have channel 1 ->   I have channel 11.

I tried to `# ifonfig wlan0 channel 11 up` but it didn't work. There is NO connection, i can't ping the router etc. 

Could it be, that the windows driver is only build for channel 1 ?? But the Stick is working under Windows, with the same driver...

I hope you guys could bring me some good thoughts !

cheers Martin


----------



## aragon (May 25, 2010)

It might have native driver support.  If you paste the full dmesg after inserting it we can see its device IDs to try match with a driver.


----------



## emka81 (May 25, 2010)

It was the full dmesg output, after inserting there is only one new line and that's this one

```
ugen3.2: <U5> at usbus3
```
nothing more ....

`# cat /var/log/messages` brings this result


```
May 25 21:41:54 homer root: Unknown USB device: vendor 0x0baf product 0x0118 bus uhub3
May 25 21:41:54 homer kernel: ugen3.2: <U5> at usbus3
```


----------



## aragon (May 25, 2010)

emka81 said:
			
		

> ```
> May 25 21:41:54 homer root: Unknown USB device: vendor 0x0baf product 0x0118 bus uhub3
> ```


That's what I was after, thanks.

Well, your stick is based on a Prism54 controller and FreeBSD has a driver for that.  It just doesn't recognise your particular rebranding of it (US Robotics U5).  Do you know how to apply patches and recompile source?


----------



## wblock@ (May 25, 2010)

See upgt(4).  I don't think it does WPA, or at least I never got a Linksys WUSB54G to do it.


----------



## emka81 (May 26, 2010)

Hello,

@aragon
i don't know how to patch and recompile the driver. 
I took the driver from
http://www.usr.com/support/product-template.asp?prod=5422 and then i unzipped the exe - file. The driver's are compiled for Windows, so what i did was to ndisgen the inf and sys file. There is no driver source.

Just a guess, but the major problem is, that country mode. It is US, when installing it on Windows, after the installation there is a window to choose the country mode

greets Martin


----------



## emka81 (May 26, 2010)

@wblock

thanks, but the upgt driver is also not working. I followed the install instruction of the man page, but when i put the stick inside there is only the ugen message, exactly the same as before. 


```
kldstat 
Id Refs Address    Size     Name
 1   43 0xc0400000 b976f4   kernel
 2    1 0xc0f98000 353c     splash_bmp.ko
 3    1 0xc0f9c000 6538     vesa.ko
 4    2 0xc1063000 577a4    sound.ko
 5    1 0xc10bb000 8240     snd_via8233.ko
 6    3 0xc10c4000 2bf38    vboxdrv.ko
 7    1 0xc3eb9000 8000     linprocfs.ko
 8    1 0xc3ec1000 26000    linux.ko
 9    2 0xc3f74000 5000     vboxnetflt.ko
10    2 0xc3f79000 b000     netgraph.ko
11    1 0xc3f8b000 4000     ng_ether.ko
12    1 0xc3f8f000 3000     vboxnetadp.ko
13    1 0xc40c6000 68000    radeon.ko
14    1 0xc412f000 14000    drm.ko
15    1 0xc4500000 9000     upgtfw.ko
```

cheers Martin


----------



## wblock@ (May 27, 2010)

The vendor code (USR) is already in usbdevs, but you'd have to add the product code and modify the upgt module source as aragon mentioned above.


----------



## emka81 (May 27, 2010)

Only for my understanding.


 where do i have to add the product code ? and is this my product code 


```
May 27 09:13:02 homer root: Unknown USB device: vendor 0x0baf [color="Red"]product 0x0118[/color] bus uhub3
```

 What sources of upgt do you mean ? 

```
man upgt(4)
FILES
     This driver requires the upgtfw firmware to be installed before it will
     work.  The firmware files are not publicly available.  A package of the
     firmware which can be installed via pkg_add(1) is available:

	   http://weongyo.org/project/upgt/[color="Red"]upgt-firmware-2.13.1.0.tar.gz[/color]
```


cheers Martin


----------



## wblock@ (May 27, 2010)

Okay, warnings first: I'm not positive upgt will run the USR5422.  Even if it does, I think that hardware doesn't do WPA, which is why my Linksys WUSB54AG is laying on the scrap pile.  (Fifty cents at a yard sale, and turns out it was overpriced.)

That said, I think you'd have to add the product code to /usr/src/sys/dev/usb/usbdevs:


```
/* U.S. Robotics products */
[B][I]product USR USR5422             0x0118  USR5422 WLAN[/I][/B]   <- insert this
product USR USR5423             0x0121  USR5423 WLAN
```

And then modify the source (source code) of the upgt driver in /usr/src/sys/dev/usb/wlan/if_upgt.c:


```
UPGT_DEV(INTERSIL,      PRISM_GT),
        UPGT_DEV(SMC,           2862WG),
        [B][I]UPGT_DEV(USR,           USR5422),[/I][/B]   <- insert this
        UPGT_DEV(WISTRONNEWEB,  UR045G),
        UPGT_DEV(XYRATEX,       PRISM_GT_1),
```

Then compile and test, figure out what I've got wrong or forgotten.  There might be other changes needed to support that particular card.  If/when it works, make patches and submit back to be included in FreeBSD.

...okay, I went ahead and did this, and created a patch for it: View attachment patch-upgt.diff

Note: builds but not tested, use at your own risk, made on FreeBSD8-stable, assumes you have /usr/src and have built and installed world and kernel.  To build and install:
`# cd /usr/src`
`# patch < patch-upgt.diff`
`# cd /usr/src/sys/modules/usb/upgt`
`# make`
`# make install clean`

Install the firmware as upgt(4) describes.  Then you can kldload the if_upgt module and see if attaching the USR5422 identifies it correctly and maybe even works.


----------



## emka81 (May 29, 2010)

Hello,

only one little question, do i have to build a new Kernel, because of usbdevs ?

thanks, Martin

I answered my question myself: YES

Now it is working !!

It is a little bit tricky with that country code. The solution is


```
ifconfig wlan0 create wlandev upgt0
ifconfig wlan0 ssid *your* ssid
ifconfig wlan0 channel 11
ifconfig wlan0 country AT
```

Many thanks to you guys especially wblock!!


----------



## wblock@ (May 29, 2010)

PR entered to add this patch: http://www.freebsd.org/cgi/query-pr.cgi?pr=147190


----------

