Home > Hacking, Kernel, Networking, Open Source > Belkin F5D8053 Support in Ubuntu – Drivers from Nowhere

Belkin F5D8053 Support in Ubuntu – Drivers from Nowhere

New Hardware

I recently purchased a new wireless ADSL router, which came with a USB WiFi network adapter. Being a fairly new release of the hardware the kernel didn’t recognize it and I couldn’t use it.

However, after some research I found that it is in deed supported by the kernel – but just not recognized due to a change in the hardware ID reported by the device. The kernel module it should work with is the RT2870 driver.

If this is the case, it should be easy to fix.

Making it Work

If you have recently rebuilt your kernel you can skip section (A), and simply proceed with (B) and (C).

A. Preparing Build Environment

The steps for preparing the build environment is based on those needed for Ubuntu 10.04 (Lucid Lynx). If you have problems building the kernel after following these steps (especially for older versions of Ubuntu), see Kernel/Compile for instructions more tailored to your version of Ubuntu.

  1. Prepare your environment for building
    sudo apt-get install fakeroot build-essential
    sudo apt-get install crash kexec-tools makedumpfile kernel-wedge
    sudo apt-get build-dep linux
    sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev 
    sudo apt-get install asciidoc binutils-dev
  2. Create and change into a directory where you want to build the kernel
  3. Then download the kernel source:
    sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
    apt-get source linux-image-$(uname -r)
  4. A new directory will be created containing the kernel source code. Everything else should happen from inside this directory
B. Modifying the Source
  1. Run lsusb and look for your Belkin device. It should look something like this
    Bus 002 Device 010: ID 050d:815f Belkin Components
  2. Note the hardware identifier, which in the above example is 050d:815f. Save this value for later.
  3. Inside the kernel source, edit the file drivers/staging/rt2870/2870_main_dev.c
  4. Search for the string Belkin. You should find a few lines looking like this:
      { USB_DEVICE(0x050D, 0x8053) }, /* Belkin */
      { USB_DEVICE(0x050D, 0x815C) }, /* Belkin */
      { USB_DEVICE(0x050D, 0x825a) }, /* Belkin */
  5. Duplicate one of these lines and replace in the ID noted in (3) above. Split and adapt the format of the 2 parts on either sides of the colon to conform to the syntax used in the lines from (4). In my example the 050D:815F would end up with a line as follows:
      { USB_DEVICE(0x050D, 0x815F) }, /* Belkin */
  6. Save the file and proceed to (C)
C. Rebuilding and Reinstalling the Kernel
  1. Run the following command in the kernel source directory:
    AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-generic
  2. This command will take a few minutes to complete. When it’s done you’ll find the kernel image .deb files one level up from the kernel source directory.
  3. To update your kernel image, you can install these using dpkg. For example:
    sudo dpkg -i linux-image-2.6.32-21-generic_2.6.32-21.32_i386.deb
  4. After installing, reboot your system and the device should be working.

Conclusion

Hardware manufacturers change the device IDs for various reasons, mainly when changes were made to the device that requires distinguishing it from previous releases (for example new functionality added to an existing model). A driver will always have a list of devices with which is it compatible. Sometimes the changes made by the manufacturer doesn’t really change the interface to the device, which means previous drivers would work perfectly fine had they known they are able to control the specified device.

The change above was exactly such a case where the driver is able to work with the device, but doesn’t know it supports this exact model. So all we did was to find the hardware ID actually reported by the device and add this to the list of IDs the driver will recognize and accept.

This is a great thing about Linux and the common Linux distributions. Almost all (if not all) packages you’ll find in your distribution are open source and make it possible to change whatever you need changing. Had this not been the case we would have needed to wait for whomever maintained the drivers to supply us with a version that would identify this device, where the existing drivers could have worked perfectly fine all along.

So in this case, it was like getting a driver for the device out of thin air.

Further, even if you spent time researching it and the change didn’t work, if you’re like me you’ll be just as excited as if it did work as now you can spent time figuring out why it didn’t work. This is actually the case with me, where the change didn’t make my device work. So I’m jumping straight in and fixing it. Will update when I get it working.

So Why Love Linux? Because by having the source code to your whole system available, you have complete freedom and control.

  1. No comments yet.
  1. No trackbacks yet.

Leave a comment