# Belkin USB wireless G adapter - zd1201 module

## iancognito85

Hi there,

I am 100% sure that my USB adapter uses the zd12xx chipset to begin with...

I have compiled the zd1201 module and have then loaded it by doing modprobe zd1201

I then plug in my USB network adapter and it doesn't identify it as the zd1201; it just says:

```
New high speed USB device using ehci_hcd and address 3

configuration 1 chosen from 1 choice.
```

I have already emerged the zd1201-firmware. 

I'm stuck! Help!!  :Smile: 

Offie.

----------

## NeddySeagoon

offie,

If its zd1201, thats a change. I've had a few of these devices and they have all been rt73.

Tell us the Vendor and Device ID from lsusb or /proc/bus/usb/devices so we can check it out.

If you discover it is rt73 , then this post provides some guidanace

----------

## iancognito85

I'm confused...

In windows and on the driver disc, it says ZD1201 but when I do lsusb I get "Belkin Components" just like in the post you've linked to me, so I'm presuming I do indeed have a rt73 as opposed to the zd.

Thanks!

O. x

----------

## NeddySeagoon

offie,

We need the numbers ... if the windows driver says ZD1201 then Belkin have probably changed the chip and you need the ZD1201driver.

My device shows 

```
Bus 003 Device 009: ID 050d:705a Belkin Components 
```

but what is your ID ?

```
ID 050d:705a
```

The 050d means Belkin, the 705a part will tell us the chip you have.

Its probably not rt73 though

----------

## iancognito85

```
ID 050d:705c Belkin Components
```

----------

## NeddySeagoon

offie,

Thats a version 4000 device you have there and it is ZD1201 based. Mine were ver 2000/3000 devices.

What kernel do you have?

The module for ZD1201 is in later kernels ?

To see if its in your current kernel, try 

```
zgrep ZD1201 /proc/config.gz
```

The response

```
# CONFIG_USB_ZD1201 is not set
```

, means the option is disabled. IF there is no respose, its either not in your kernel at all or the section its in is off.

Knowing your kernel version would help here.  uname -a will tell that.

----------

## iancognito85

Hey there

ok I have done a zgrep and it came back:

```
#CONFIG_USB_ZD1201 is not set
```

So i have set it to m in the menuconfig and compiled it all etc...

and heres the output of the uname -a:

```
2.6.22-gentoo-r5
```

----------

## NeddySeagoon

offie,

Yes, you will also need the higher level wireless options in my rt73 link, they are needed for all wireless cards.

There is a short cut you may be able to take advantage of in building your kernel.

Go into make menuconfig.

Providing you only change setting from < > (off) to <M> (Module) you only need the following steps

```
make modules

make modules_install
```

When you change a setting using a <*> (built in) you need to do the full process.

Adding modules does not need a reboot.

With the code built, plug in your device and look in dmesg for errors.

If all is well, you can use iwconfig and ifconfig to set it up manually.

The Gentoo Handbook tells you how to set up your /etc/conf.d/net.

----------

## iancognito85

Hi there

By the higher level options do you mean stuff like the mac80211 etc options? If so I already have those enabled. 

I plugged in my device and modprobed zd1201 and vica versa, but it just carries on saying 

```
New high speed USB device using ehci_hcd and address 3

configuration 1 chosen from 1 choice.
```

So... still at square 1.  :Sad: 

----------

## NeddySeagoon

offie,

Looking at the kernel source code in /usr/src/linux/drivers/net/wireless/zd1201.c , the kernel knows nothing of your device as its USB ID is not in this table

```
static struct usb_device_id zd1201_table[] = {

        {USB_DEVICE(0x0586, 0x3400)}, /* Peabird Wireless USB Adapter */

        {USB_DEVICE(0x0ace, 0x1201)}, /* ZyDAS ZD1201 Wireless USB Adapter */

        {USB_DEVICE(0x050d, 0x6051)}, /* Belkin F5D6051 usb  adapter */

        {USB_DEVICE(0x0db0, 0x6823)}, /* MSI UB11B usb  adapter */

        {USB_DEVICE(0x1044, 0x8005)}, /* GIGABYTE GN-WLBZ201 usb adapter */

        {}

};
```

You fix that with a little kernel hacking. Make a copy of the file, called /usr/src/linux/drivers/net/wireless/zd1201.c.org so you have an undo. Open the file (not the copy) in your text editor, find that block of code and copy the existing Belkin line, so the code reads

```
static struct usb_device_id zd1201_table[] = {

        {USB_DEVICE(0x0586, 0x3400)}, /* Peabird Wireless USB Adapter */

        {USB_DEVICE(0x0ace, 0x1201)}, /* ZyDAS ZD1201 Wireless USB Adapter */

        {USB_DEVICE(0x050d, 0x6051)}, /* Belkin F5D6051 usb  adapter */

        {USB_DEVICE(0x050d, 0x6051)}, /* Belkin F5D6051 usb  adapter */

        {USB_DEVICE(0x0db0, 0x6823)}, /* MSI UB11B usb  adapter */

        {USB_DEVICE(0x1044, 0x8005)}, /* GIGABYTE GN-WLBZ201 usb adapter */

        {}

};
```

Now change one the lines to match your USB ID

```
        {USB_DEVICE(0x0ace, 0x1201)}, /* ZyDAS ZD1201 Wireless USB Adapter */

        {USB_DEVICE(0x050d, 0x6051)}, /* Belkin F5D6051 usb  adapter */

        {USB_DEVICE(0x050d, 0x705c)}, /* Belkin F5D6051 usb  adapter */

        {USB_DEVICE(0x0db0, 0x6823)}, /* MSI UB11B usb  adapter */
```

and fix the comment too, if you wish, thats the 

```
/* Belkin F5D6051 usb  adapter */
```

bit.

Save the changes and rebuild and reinstall the module

```
make modules

make modules_install
```

Or do the whole process if its not a module.

unload the old module with modprobe -r <module>

load the new one modprobe <module>

and test.

If it works, file a bug at bugs.gentoo.org so everyone else can share your work. The gentoo kernel devs will pass it upstream to the kernel maintainers and it will be included in a future kernel release. Yon can attach a patch to you bug if you want but as its an add an new device to an existing driver, nobody will mind

My code comes from the 2.6.23-rc6 kernel, yours may not be identical but its the same process.

----------

## iancognito85

Hey 

Okay that seems to have made some headway, however, it is now moaning that:

```
Failed to load zd1201.fw file!

Make sure hotplug firmware loader is installed.

```

It's only said that once and all the other times it identifies it is a zd1201 but it has 

```

Failed to upload the driver.
```

Or something around that wording.

Thanks by the way for all the great help so far... so close now!!

----------

## NeddySeagoon

offie,

You need to put the firmware file into /etc/firmware or /lib/firware either works.

The emerge installs it correctly

```
>>> Merging net-wireless/zd1201-firmware-0.14 to /

--- /lib/

--- /lib/firmware/

>>> /lib/firmware/zd1201.fw

>>> /lib/firmware/zd1201-ap.fw
```

Check its there.

Do you have hotplug support in your kernel?

Check that

```
grep HOTPLUG /proc/config.gz
```

gives  *Quote:*   

> CONFIG_HOTPLUG=y

 too.

The firmware is only loaded once, each time the device is powered up.

----------

## iancognito85

grepping gives nothing. what should I do?

----------

## NeddySeagoon

offie,

Go into make menuconfig, press / and enter HOT - it will tell you where hotpug is and how its set now

It sounds like you have hotplug off, so the firmware does not get loaded.

I have a feeling thats not a modular option too, so you need to redo your kernel

----------

## iancognito85

Hotplug is on... I checked and recompiled the kernel enabling PCI hotplugging and the hotplug in the Small system configuration under the general settings tab.

As I have said, it is now saying nothing about hotplug in dmesg, just that it has failed to upload the firmware.

Offie

----------

## NeddySeagoon

offie,

See if you can get newer firmware from the web.

Look in /lib/firmware to make sure the *.fw file is there

----------

## iancognito85

Yep it's there, and the newest version of firmware was done in 2005.

----------

## NeddySeagoon

offie,

Does

```
emerge hotplug -s
```

show both items installed?

I'm not sure if they are relevant or not.

----------

## iancognito85

Hey

No theyre not installed, but they don't seem to need installing seeing as their dates are april and september of 2004. :-S

Offie.

----------

## NeddySeagoon

offie, 

Very possibly - still have them so I suppose they don't get in the way

----------

## iancognito85

Well it's still not working! Even with them merged

```
zd1201 firmware upload failed: -110

probe of 1-3:1.0 failed with error -110
```

----------

## NeddySeagoon

offie,

Thats a different error now.  Is that all that dmesg shows or is there some more context ?

----------

## iancognito85

thats all it says!

----------

## NeddySeagoon

offie,

Boot Windows and make the device work. reboot into linux without powering off.

The firmware may be retained.

Can you find firmware on the Windows driver CD?

If so try that

----------

## iancognito85

I boot in and out of windows without cutting the power all the time to reply on here and it's done no good.

How do I go about using the driver CD? You mean linux drivers or using a wrapper?

----------

## NeddySeagoon

offie,

The firmware is loaded into to wireless device. Its controlled by its own microprocessor and this firmware tells it how to operate.

Its needed regardless of the operating system. 

Some windows drivers provide a separate firmware file on the CD provided with the device, some don't

If its there, it will be a file ending in .fw or .bin, try that in place of the firmware you emerged.

The windows to linux switch was aimed at achieving the same thing but allowing Windows to load the firmware.

----------

## iancognito85

Hey there man, nope no *.fw nor *.bin files on the CD.

I can't think what else it could be... how do I find out the name of the file that hotplug is looking for? maybe it has been emerged but the filename is incorrect.

Offie

----------

## iancognito85

update: checked this - it's fine.

----------

## iancognito85

Any further ideas on this?  I have read on the forums on the zd1201's website on sourceforge that a check should be removed in the source code and it should fix it. I had a go at this and still, no avail.

----------

## NeddySeagoon

offie,

The driver source code says

```
          if (apfw)

                  fwfile = "zd1201-ap.fw";

          else

                  fwfile = "zd1201.fw";
```

so it will try to load 

```
/lib/firmware/zd1201.fw
```

unless you tell the module that you want it to operate as a Wireless Access point. The ebuild shows 

```
>>> /lib/firmware/zd1201.fw

>>> /lib/firmware/zd1201-ap.fw
```

so thats as expected.

Two things to try.

1. Rebuild your kernel without the zd1201 driver and  emerge zd1201 in its place.

2. upgrade your kernel to the latest testing vanillia-sources and try the in kernel driver there.

Silly question, you do have a /sys directory?

----------

## iancognito85

The package "zd1201" is masked; I will upgrade to vanillia sources instead. How do I preserve all my kernel options or do I have to do them alll over again?

----------

## NeddySeagoon

offie,

Copy the .config file from the old kernel to the new kernel, then run 

```
make oldconfig
```

in the new kernel tree.

This operation discards all the configuration options that have been dropped and asks you to choose settings for any new options.

There have been some structural changes to make menuconfig, so be sure to check your settings there before you continue the build process.

----------

## iancognito85

Ok;

Changed the kernel, reviewed all settings, made it all updated symlinks etc.... still same problem.

----------

## iancognito85

This might also be of some relevance to the problem:

https://forums.gentoo.org/viewtopic-p-4287623.html

----------

## NeddySeagoon

offie,

That may well be relevant - your Access Point fimware got into /etc/modules.d/ 

Oops.

----------

## teko

Hi,

did you manage to get this working? I'd be pretty interested if you did. I'm new to gentoo, and my 3Com USB adapter worked when I had ubuntu installed but am coming across similar problems as yourself. Anyway am trying the thing mentioned in this thread first.

At this stage I'm recompiling kernel to give hotplug support

----------

