D-Link DWA-110 on OpenBSD 4.4

In order to reduce power consumption and simplify my home network, I wanted to remove my WIFI router and replace it by adding an USB WIFI dongle on my router (a fit-PC with OpenBSD on it).

Choosing a dongle

As WIFI hardware is mostly proprietary stuff with Windows-only drivers, not all of them are able to run on OpenBSD (or Linux).

So my requirements are:

  • USB WIFI dongle (USB is the only kind of connectors I can use on my fit-PC)
  • recognized by OpenBSD
  • does not require non-free (as in free speech) binary firmware
  • can work as an access point

I already had an Acer WLAN-G-US1 dongle, it has a ZyDAS chipset, which is supported by the zyd driver, but it can't act as an access point.

From the OpenBSD's supported WIFI hardware page I randomly selected the rum driver (working with Ralink RT2501USB and RT2601USB chipsets) and went to a store with the list of dongle models supported.

So I bought a refurbished D-Link DWA-110.

Plugging the dongle

When plugging it in the fit-PC, I got the following message in /var/log/messages:

$ sudo tail -f /var/log.messages
(…)
Nov  7 20:00:32 hal /bsd: ugen0 at uhub0
Nov  7 20:00:32 hal /bsd: port 1 "Ralink 802.11 bg WLAN" rev 2.00/0.01 addr 2
(…)

What did just happened? The dongle is not recognized and the generic USB driver is associated with it.

Digging a bit in the manuals I found that in rum manual on my OpenBSD do not have D-Link DWA-110 in the hardware list. In fact, the online manual is more up to date than the one in OpenBSD which is already at least two weeks old… So my dongle will be supported in next OpenBSD release.

So what? Can't do anything to fix that?

Compiling the kernel

The problem here is just that OpenBSD do not know that D-Link DWA-110 works with the current rum driver.

It's quite easy to change that, but it requires recompiling OpenBSD's kernel and rebooting.

First, download kernel sources:

# cd /usr/src
# wget ftp://ftp.crans.org/pub/OpenBSD/4.4/sys.tar.gz
# tar zxvf sys.tar.gz

Then, add the relevant changes to the drivers source files and the USB devices list.

  • Add the following line in the file /usr/src/sys/dev/usb/if_rum.c in the vendors/products list:

    { USB_VENDOR_DLINK2,            USB_PRODUCT_DLINK2_DWA110 },
    
  • In /usr/src/sys/dev/usb/usbdevs in the D-Link products add:

    product DLINK2 DWA110           0x3c07  DWA-110
    
  • In /usr/src/sys/dev/usb/usbdevs_data.h in the usb_known_products structure add:

    {
        USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA110,
        "DWA-110",
    },
    
  • And in /usr/src/sys/dev/usb/usbdevs.h:

    #define USB_PRODUCT_DLINK2_DWA110       0x3c07          /* DWA-110 */
    

Then compile the kernel and reboot (this can be a bit long, especially on a slow computer like my fit-PC, it was about half an hour):

# cd /usr/src/sys/arch/`arch -s`/conf
# config GENERIC
# cd ../compile/GENERIC/
# make depend
# make
# make install
# reboot

Now we can check the USB devices:

# usbdevs -dv
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), AMD(0x1022), rev 1.00
  uhub0
 port 1 addr 2: full speed, power 300 mA, config 1, 802.11 bg WLAN(0x3c07), Ralink(0x07d1), rev 0.01
  rum0
 port 2 powered
 port 3 powered
 port 4 powered

The rum driver is associated with the D-Link dongle.

We can see that it uses around 300 mA on a 5 V USB power source, so I assume that the dongle is using 1.5 W. My actual WIFI router consumes 4 W.

The fit-PC was consuming 3.7 W, now with the dongle plugged in and running it consumes 5.5 W, that's 1.8 W for the dongle, not so far from the theory.

Anyway, it seems that DWA-110 was already in -current, so it should have been in November's release.

Useful links:

Comments Add one by sending me an email.