# Trouble with usb wifi adapter



## Sragonal (Dec 4, 2009)

Hello FreeBSD people,

I've got an old pc here where I put FreeBSD 8.0 on, the problem is that I can't get the wifi adapter to work. The adapter is a "Siemens Gigaset USB Adapter 108" . I've checked the hardware notes and the device should work with the 'uath' driver. 

It's a fresh install, and I've compiled a whole new kernel for that device. I made sure that all dependencies where met.

When I connect the device this shows up: "ugen0.2 <Atheros Communications Inc> at usbus0". But it doesn't show up in /dev as uath0. The program 'uathload' for loading the right firmware in the device seems to work fine though.

I'm quite a newbie concerning FreeBSD. I hope someone could help me with this problem, I would really appreciate that.


----------



## aragon (Dec 4, 2009)

When it's plugged in, paste us the output of this:


```
usbconfig -u 0 -a 2 dump_device_desc
```

The above assumes it comes up as ugen0.2.


----------



## Sragonal (Dec 4, 2009)

The output of usbconfig -u 0 -a 2 dump_device_desc:


```
gen0.2 <AR5523 Atheros Communications Inc> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON

bLength = 0x0012
bDescriptorTyupe = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x00ff
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = ox0040
idVendor = 0x129b
idProduct = 0x160c
bcdDevice = 0x0001
iManufacturer = 0x0001 <Atheros Communications Inc>
iProduct = 0x002 <AR5523>
iSerialNumber = 0x0003 <1.0>
bNumConfigurations = 0x0001
```

Thanks for replying


----------



## aragon (Dec 4, 2009)

Unfortunately that card is not supported at this time, but it might be possible/easy to add support because the AR5523 controller is supported.  Do you know how to patch source code and recompile your kernel?


----------



## Sragonal (Dec 5, 2009)

I know basic C. And as mentioned in my first post, I have recompiled a kernel with the instructions from the handbook.

Maybe you could give me some more instructions to get my wifi adapter working?

I have no experience patching source code though. :/


----------



## aragon (Dec 5, 2009)

Great.  Download the attached patch.  Apply it as follows:


```
cd /usr/src
patch </path/to/siemens.txt
```

It should apply cleanly on 8.0 source.  After patching, recompile your kernel and hold thumbs.

(it says CYBERTAN in the source because that vendor was already defined for 0x129b)


----------



## Sragonal (Dec 5, 2009)

OK, I have executed the commands in your post. And after that I've executed "make buildkernel KERNELCONF=HOMESERVER", this is my custom kernel, at the moment it is compiling. When it is done I will execute "make installkernel KERNELCONF=HOMESERVER".

I am not really understanding what is happening in the 'siemens.txt' file tough. Maybe you could explain what is happening, or link me to a web address where I could learn more about patch files. What does a line like: "@@ -1120,6 +1120,7 @@" mean? Did you write this file yourself?

I'm holding thumbs right now. 

I really appreciate the work you have put into this.


----------



## aragon (Dec 5, 2009)

The patch file is created with diff(1).  I found this guide.  Take a look at patch(1) too.

Hope it works.


----------



## Sragonal (Dec 5, 2009)

Now there seems to be happening more with the device while booting. But in the end it turns out that there is still no uath0 in /dev.

dmesg with some irrelevant stuff filtered out: 

```
ugen0.3: <Atheros Communications Inc> at usbus0
uath0: <Atheros Communications Inc AR5523, rev 2.00/0.01, addr 3> on usbus0
Root mount waiting for: usbus0
uath0: timeout waiting for reply to cmd 0x1 (1)
uath0: could not initialize adapter
device_attach: uath0 attach returned 35
uath0: <Atheros Communications Inc AR5523, rev 2.00/0.01, addr 3> on usbus0
uath0: timeout waiting for reply to cmd 0x1 (1)
uath0: could not initialize adapter
device_attach: uath0 attach returned 35
```


----------



## aragon (Dec 5, 2009)

Ack.  That's a pity.  Unfortunately it's not an easy fix then, at least not for me.  Since you know some C, you might be able to add support in src/sys/dev/usb/wlan/if_uath.c


----------



## Sragonal (Dec 5, 2009)

Haha, alright. Back to the days when if you wanted something with your pc, you will have to write the code yourself.:e

Thanks for your help anyway.


----------



## aragon (Dec 5, 2009)

Sragonal said:
			
		

> Haha, alright. Back to the days when if you wanted something with your pc, you will have to write the code yourself.:e


Something like that. 

Actually there is more you could still try.  The mailing lists are a good source of help too.

Or you could try another card.  My Cisco/Linksys WUSB54G works great with rum(4).


----------



## Sragonal (Dec 5, 2009)

Strange that the hardware notes say that the device I'm using is supported. While in practice it doesn't seem to work. :/


----------



## aragon (Dec 5, 2009)

Yup.  Usually a patch like mine works fine.  Not so lucky this time.

Something else you can try is ndis(4).


----------



## Sragonal (Dec 8, 2009)

I'll try that, I hope it works. What troubles me is that the uath driver changed the firmware. I've been searching a bit on the net but I couldn't find it. 

I will just try it and see how it works out.


----------

