NSLU2-Linux
view · edit · print · history

Wireless Network Adapter

Since the zd1211 driver is not working in 2.4 kernel on unslung 6.8 Beta at present the best remaining options are USB powered external USB Access Point/Network adapters like those linked below. These Wireless Network Adapters have the ability to function as an Access Point or as a Network Card. On the D-Link you can change the function of the unit from Access Point to Network Adapter with the switch of a button.

D-Link DWL-G730AP > High Speed 2.4GHz (802.11g) Wireless Pocket Router/AP

Asus ASUS WL-330Gg Pocket Wireless Access Point + Ethernet adapter

There is a picture of the Asus in use with the NSLU2 linked on this wiki. It is used as a LAN/WLAN Interface for Digital Cameras. Located here

http://webuser.fh-furtwangen.de/~dersch/gphoto/remote.html

Linksys' equivalent product is the WET54G, and it can be used with an NSLU2; however, it isn't USB powered. Its power input is 5V so you could make up a cable to power it from a USB port, but be careful; mine takes about 580 mA, which exceeds the maximum 500 mA allowed by the USB spec. (Mine is powered from a PC's PS/2 keyboard port, which is generally capable of supplying about 750 mA.)

zd1211

http://linuxwireless.org/en/users/Drivers/zd1211rw/devices

The zd1211 driver for the 2.4 kernel (the kernel used by Unslung) is unstable. It suffers from a tendency to lock up not just the NSLU2, but in some cases it will also lock up the access point with which it has associated. Additionally, the driver has a significant unaligned-access problem, which slows it down when it isn't locked up.

The driver is not currently in the feeds because of these stability issues. It may ever be fixed, the developers of the driver have moved on to a full driver rewrite based on the Linux 2.6 kernel, and have no plans to do any work on the existing driver for the 2.4 kernel.

The Zydas ZD1211 chipset is known to work on the slug, in both little and big endian configs. The list of cards using this chipset is available at the driver page http://zd1211.ath.cx/. To use this wifi-dongle, just:

ipkg install zd1211 (This will pull in necessary dependencies like wireless-tools)

Note: You have to `ifconfig wlan0 up` before you can configure the wireless interface!

If you are running SlugOS follow this guide WirelessZD1211

If you're running DebianSlug and want to use the zd1211 module, follow these instructions:

  • Set up a cross-compiling environment (MasterMakefile)
  • (I'm assuming that you set it up in ~/slug)
  • cd ~/slug/debianslug 
    . ./setup-env; bitbake -b openembedded/packages/zd1211/zd1211_r52.bb 
  • After the build has finished, copy the package from
    ~/slug/debianslug/tmp/deploy/ipk/zd1211_r52-r4_ixp4xxle.ipk to the slug. E.g.

scp ~/slug/debianslug/tmp/deploy/ipk/zd1211_r52-r4_ixp4xxle.ipk yoursluguser@slug-ip:/home/sluguser

  • ssh into slug
  • su - (become root)
  • apt-get install wireless-tools
  • dpkg --force-architecture -i /home/sluguser/zd1211_r52-r4_ixp4xxle.ipk
  • Ignore the warnings
  • depmod -a
  • modprobe zd1211
  • Check if it's loaded: lsmod | grep zd1211

It's as simple as that! ;-)

Or not! I'm still having difficulties, lsmod shows the module loaded. ifconfg eth1 up works (wlan0 does not) and opens the device. ifconfig shows the dece, but iwconfig complains that no devices have wireless extensions.

May be you have the wrong driver. modinfo zd1211 will show you some Vendor and Product IDs which are working with this driver. Check this out with lsusb.

If it does not fit together, checkout the zd1211b driver :-)

Well, it works on my machine: (http://zd1211.ath.cx/#Installation)

slug:~# modprobe -v zd1211
insmod /lib/modules/2.6.15/kernel/drivers/net/zd1211.ko
slug:~# lsmod
Module                  Size  Used by
zd1211                223880  0
{snip}
slug:~# ifconfig wlan0 up
slug:~# iwconfig wlan0 essid YOUR-ESSID enc WEP-KEY-IN-HEX
slug:~# ifconfig wlan0 192.168.2.200
slug:~# ifconfig wlan0 
wlan0     Protokoll:Ethernet  Hardware Adresse 00:11:XX:XX:XX:XX
          inet Adresse:192.168.2.200  Bcast:192.168.2.255  Maske:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000
          RX bytes:368 (368.0 b)  TX bytes:336 (336.0 b)
slug:~# route
Kernel IP Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     0      0        0 eth0
192.168.2.0     *               255.255.255.0   U     0      0        0 wlan0
default         192.168.2.1     0.0.0.0         UG    0      0        0 eth0
slug:~# route del default
slug:~# route add default gw 192.168.2.1 wlan0
slug:~# route
Kernel IP Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     0      0        0 eth0
192.168.2.0     *               255.255.255.0   U     0      0        0 wlan0
default         192.168.2.1     0.0.0.0         UG    0      0        0 wlan0
slug:~# ping www.google.de
PING www.l.google.com (66.249.93.99) 56(84) bytes of data.
64 bytes from 66.249.93.99: icmp_seq=1 ttl=244 time=67.1 ms
{snip}

Okay so looking into this further and rebuilding my slug it finaly heit me.. maybe this is debina_slug only. Just configing my new deb_slug will advise later.

Note: Both zd1211 and zd1211b are available in the openslug 3.10 and debianslug feeds.

MA111

DebianSlug works with MA111 802.11B WIRELESS USB ADAPTER with linux-wlan-ng.

I had an old Netgear MA111 lying around and got it working on the slug with the following steps:

  • Installed DebianSlug 3.10. I built this from sources as it wasn't released at the time). This also built a cross compiler and provided the correct kernel sources to build external kernel modules such as linux-wlan-ng.
  • Downloaded linux-wlan-ng-0.2.3.tar.bz2 from ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/
  • Unpack & enter dir
  • Apply patch below
  • Ensure your cross compiler is on your path
  • Edit the LINUX_SRC and TARGET_ROOT_ON_HOST variables in config.in to where you have them.
  • run make config
  • export CROSS_COMPILE=arm-linux-
  • make V=1 ARCH=arm CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld
  • make install
  • copy the contents of $TARGET_ROOT_ON_HOST to device. This should put firmware in /etc/wlan and the modules in /lib/modules/2.6.16/linux-wlan-ng.
  • Add wlan0 to /etc/network/interfaces and add your network settings
  • ifup wlan0 and you shoudl be up and running!

Notes

  • linux-wlan-ng 0.2.5 is now available. I don't know what the changes are - my slug is quite stable with 2.6.16 and linux-wlan-ng 0.2.3
  • This may also work with other prism based 802.11b cards that use linux-wlan-ng

Patch for linux-wlan-ng-0.2.3

diff -ru linux-wlan-ng-0.2.3/config.in linux-wlan-ng-0.2.3-ok/config.in
--- linux-wlan-ng-0.2.3/config.in       2005-10-31 19:54:22.000000000 +0000
+++ linux-wlan-ng-0.2.3-ok/config.in    2006-05-14 19:37:11.000000000 +0100
@@ -2,20 +2,21 @@
 WLAN_PATCHLEVEL=2
 WLAN_SUBLEVEL=3
 WLAN_EXTRAVERSION=
-#LINUX_SRC=/usr/src/linux
+LINUX_SRC="$HOME/build/slug/debianslug/tmp/work/ixp4xx-kernel-2.6.16-r6.2/linux-2.6.16"
 PCMCIA_SRC=
 PREFIX=
 INST_EXEDIR=/sbin
-TARGET_ROOT_ON_HOST=
+TARGET_ROOT_ON_HOST=$HOME/build/slug/debianslug/tmp/staging/wlan
+MODDIR="/lib/modules/2.6.16"
 RC_DIR=/etc/rc.d
 PCMCIA_DIR=/etc/pcmcia
 SYSV_INIT=y
 INSTALL_DEPMOD=y
 WLAN_DEBUG=n
-CROSS_COMPILE_ENABLED=n
-CROSS_COMPILE=
+CROSS_COMPILE_ENABLED=y
+export CROSS_COMPILE=arm-linux-
 HOST_COMPILE=
 PRISM2_PLX=n
-PRISM2_PCMCIA=y
+PRISM2_PCMCIA=n
 PRISM2_PCI=n
-PRISM2_USB=n
+PRISM2_USB=y
diff -ru linux-wlan-ng-0.2.3/src/prism2/driver/prism2_usb.c linux-wlan-ng-0.2.3-ok/src/prism2/driver/prism2_usb.c
--- linux-wlan-ng-0.2.3/src/prism2/driver/prism2_usb.c  2005-09-19 18:57:08.000000000 +0100
+++ linux-wlan-ng-0.2.3-ok/src/prism2/driver/prism2_usb.c       2006-05-14 19:36:19.000000000 +0100
@@ -313,7 +313,7 @@


 struct usb_driver prism2_usb_driver = {
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19))
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19)) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16))
        .owner = THIS_MODULE,
 #endif
        .name = "prism2_usb",

RT73

I ended up with an Ralink RT73 based card after buying a Belkin F5D7050 expecting to get the v4 zd1211 based variant and ending up with a version 3 which is RT73 based.

2007-08-23 : LEVELONE WNC-0301USB HW ver:3.0 - ID 148f:2573 Ralink Technology, Corp.

Unslung

Status: Not working

Don't bother trying! The only RT73 driver that supports 2.4 kernels is the one that Ralink themselves released. Despite various bits of code saying #ifdef BIG_ENDIAN the driver contains lots of code that assumes a little endian machine and it would be a mammoth task to try to fix it.

Debian

Status: Working

You may have to compile the following drivers from source. See Debian/Compiling

If everything looks like it's working, don't just unplug your ethernet. use "ifconfig eth0 down" beforehand, otherwise you'll loose both connections.

Original Driver

One way (the easiest?) to make an RT73 based wifi dongle working is to use the driver provided by Ralink.

WPA2PSK (TKIP+AES) working
`WPA Working

Compiling works with the following packages: build-essential (not sure if it's possible to install fewer packages to get it working) linux-headers-2.6.18-4-ixp4xx (if you install linux-headers-2.6-ixp4xx you will get a newer version which means you'll have to patch the driver source).

You'll also want to install wireless-tools, and probably wpasupplicant if you use WPA-encryption.

The driver expects its config files in /etc/Wireless/RT73STA , so you'll have to create those dirs as they're not Debian-standard.

Follow instructions from here: http://wiki.archlinux.org/index.php/RT73_Wireless and: https://help.ubuntu.com/community/WifiDocs/Driver/RalinkRT73

Try these if you're using WPA:

iwconfig rausb0 mode managed
iwpriv rausb0 set AuthMode=WPAPSK
iwpriv rausb0 set EncrypType=TKIP
iwconfig rausb0 essid <essid>
iwpriv rausb0 set WPAPSK=<WPA key>

For WPA, edit also your /etc/network/interfaces (from http://forum.ubuntuusers.de/topic/91223):

auto rausb0
iface rausb0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.1
pre-up ifconfig rausb0 up

pre-up iwconfig rausb0 essid "Name des WLANs"
pre-up iwconfig rausb0 mode Managed

pre-up iwconfig rausb0 channel 8
pre-up iwpriv rausb0 set AuthMode=WPAPSK
pre-up iwpriv rausb0 set EncrypType=TKIP

pre-up iwpriv rausb0 set WPAPSK="Schlüssel"
pre-up iwpriv rausb0 set SSID="Name des WLANs"

Community Drivers

There is a project at http://rt2x00.serialmonkey.com to create a new driver for the Ralink range of wireless chipsets that uses the Devicescape stack which is expected to eventually appear in the mainline kernel. This driver requires as a minimum kernel 2.6.17

I compiled it native on a slug running Debian RC2. First you need a configured copy of the kernel source. I used the instructions at http://linux.seindal.dk/2004/08/15/getting-a-debian-kernel-source-tree-for-driver-compilation/

Next I downloaded the driver itself from http://rt2x00.serialmonkey.com/rt2x00-cvs-daily.tar.gz and applied a couple of patches that are needed to make it work

cvs diff: Diffing .
Index: rt2x00dev.c
===================================================================
RCS file: /cvsroot/rt2400/source/rt2x00/rt2x00dev.c,v
retrieving revision 1.16
diff -u -r1.16 rt2x00dev.c
--- rt2x00dev.c 8 Mar 2007 21:54:01 -0000       1.16
+++ rt2x00dev.c 15 Apr 2007 18:50:48 -0000
@@ -184,7 +184,7 @@
        struct ieee80211_hw_mode *hwmodes;
        struct ieee80211_channel *channels;
        struct ieee80211_rate *rates;
-       unsigned int i;
+       int i;
        unsigned char tx_power;

        hwmodes = kzalloc(sizeof(*hwmodes) * spec->num_modes, GFP_KERNEL);
@@ -284,7 +284,7 @@
                hwmodes[HWMODE_A].rates = &rates[4];
        }

-       for (i = 0; i < spec->num_modes; i++) {
+       for (i = spec->num_modes-1 ; i >= 0 ; i--) {
                if (ieee80211_register_hwmode(hw, &hwmodes[i]))
                        goto exit_free_rates;
        }
Index: rt73usb.c
===================================================================
RCS file: /cvsroot/rt2400/source/rt2x00/rt73usb.c,v
retrieving revision 1.411
diff -u -r1.411 rt73usb.c
--- rt73usb.c   2 Apr 2007 06:45:12 -0000       1.411
+++ rt73usb.c   15 Apr 2007 18:50:50 -0000
@@ -311,7 +311,7 @@
         * that array is little endian, so no need for byte ordering.
         * We only need to set the BSS ID MASK at the correct offset.
         */
-       rt2x00_register_multiwrite(rt2x00dev, MAC_CSR4, bssid, ETH_ALEN);
+       rt2x00_register_multiwrite(rt2x00dev, MAC_CSR4, bssid, ETH_ALEN+2);

        rt2x00_register_read(rt2x00dev, MAC_CSR5, &reg);
        rt2x00_set_field32(&reg, MAC_CSR5_BSS_ID_MASK, 3);
@@ -821,7 +821,7 @@
         * We only need to set the MAC_CSR3_UNICAST_TO_ME_MASK
         * at the correct offset.
         */
-       rt2x00_register_multiwrite(rt2x00dev, MAC_CSR2, addr, ETH_ALEN);
+       rt2x00_register_multiwrite(rt2x00dev, MAC_CSR2, addr, ETH_ALEN+2);

        rt2x00_register_read(rt2x00dev, MAC_CSR3, &reg);
        rt2x00_set_field32(&reg, MAC_CSR3_UNICAST_TO_ME_MASK, 0xff);
@@ -1523,7 +1523,7 @@

        skb_push(skb, rt2x00dev->hw->extra_tx_headroom);
        txd = (struct data_desc*)skb->data;
-       rt73usb_write_tx_desc(rt2x00dev, txd, ieee80211hdr, skb->len, control);
+       rt73usb_write_tx_desc(rt2x00dev, txd, ieee80211hdr, length, control);
        memcpy(&entry->tx_status.control, control, sizeof(*control));
        entry->skb = skb;

Next I edited the config file to remove all of the PCI devices and the rfkill driver and typed make. Make sure you have installed the RT73 firmware in /lib/firmware before loading the driver as per the readme otherwise you get an Oops on unload. In theory make install should result in the driver being auto loaded when needed but it got the modules directory name wrong when I tried it so I had to move the rt2x00 directory from /lib/modules/2.6.18 to /lib/modules/2.6.18-4-ixp4xx then re-run depmod.

Finally bring the interface up either manually (If iwconfig isn't in /sbin then apt-get install wireless-tools)

sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode managed
sudo ifconfig wlan0 up
sudo iwconfig wlan0 channel xx
sudo iwconfig wlan0 key your-wep-key
sudo iwconfig wlan0 ap your-ap
sudo iwconfig wlan0 essid your-ssid
sudo ifconfig wlan0 desired-ip-addr

Or by adding the necesary commands to /etc/network/interfaces

iface wlan0 inet static
        pre-up ifconfig wlan0 up
        address 192.168.0.7
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.4
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.0.3
        dns-search your-domain
        wireless-channel 11
        wireless-key xxxxxxxxxxxxxxxxxxxx
        wireless-ap xx:xx:xx:xx:xx:xx
        wireless-essid xxxxxxxxxxxx

Please help: Where can I find working sourcecode/the used version? I tried all versions/patches I could find. Unfortunately without success :(

rt2x00 Legacy Drivers

It is also easy to make a rt73 USB adapter work with the rt2x200 project legacy Drivers (see their roadmap: http://rt2x00.serialmonkey.com/wiki/index.php?title=Roadmap).

Basically the steps are:

          VOID    RTMPMoveMemory(
                  OUT PVOID       pDest,
                  IN      PVOID   pSrc,
                  IN      ULONG   Length)
          {
                  memcpy(pDest, pSrc, Length);
          }
  • Compile with 'make arm'.
  • Copy the rt73.ko file to
          /lib/modules/`uname -r`/kernel/drivers/net/wireless/rt2x00-legacy/
  • Copy the rt73.bin file to /lib/firmware/
  • Execute 'depmod'

You can find more detailed instructions here: http://3lled.blogspot.com/2008/02/nslu2-dwl-g122-nas-with-wi-fi.html

Debian Lenny drivers

Debian Lenny contains everything to get USB-Wireless dongles based on ralink rt73 working. I use a TP-LINK TL-WN321G(approve sites) and did the following:

  • Install packages wireless-tools, wpasupplicant and firmware-ralink (from non-free)
  • Pick a file from /usr/share/doc/wpasupplicant/examples, copy it to /etc/wpa_supplicant.conf and edit it according to your wireless configuration. I used wpa-psk-tkip.conf for WPA/TKIP encryption.
  • Add a new block to /etc/network/interfaces, e.g.
          allow-hotplug wlan0
          iface wlan0 inet dhcp
          wpa-conf /etc/wpa_supplicant.conf
          auto wlan0
  • Plug in dongle and check with iwconfig if interface wlan0 exists
  • Run /etc/init.d/networking restart

SlugOS

Status: Not Tested

The driver used with Debian should work with SlugOS 4, 3.10 uses kernel 2.6.16 which is too old. There are reports of success on other big endian targets.

Use the folowing script to load up the zd1211 on slugos 4.8:

#!/bin/sh

### Install modules and stuff to make zd1211 dongle work on SlugOS.

# The ugly stuff with /tmp/r in the /etc/network/interfaces file
# can be uncommented to prevent the dhcp of the wireless iface
# from overwriting the DNS resolver - useful if the wired and wireless
# networks are on different subnets or on different sides of a firewall,
# as they are in my case.
# Also, comment/uncomment the wpa and wireless-* lines to switch between
# WPA and WEP.  Note that you'll need a WPA key in /etc/wpa_supplicant.conf
# of course.

echo "adding eth1 wifi network interfaces..."
grep eth1 /etc/network/interfaces
if [ $? -ne 0 ] ; then
  echo '#'                                      >>/etc/network/interfaces
  echo '#auto eth1'                             >>/etc/network/interfaces
  echo 'iface eth1 inet dhcp'                   >>/etc/network/interfaces
  echo '    pre-up /sbin/ifconfig $IFACE up'    >>/etc/network/interfaces
  echo '#    pre-up cp /etc/resolv.conf /tmp/r' >>/etc/network/interfaces
  echo '    wpa-conf /etc/wpa_supplicant.conf'  >>/etc/network/interfaces
  echo '    wpa-driver wext'                    >>/etc/network/interfaces
  echo '#    wireless-key 1234567890'           >>/etc/network/interfaces
  echo '#    wireless-essid limbo-link'         >>/etc/network/interfaces
  echo '#    up cp /tmp/r /etc/resolv.conf'     >>/etc/network/interfaces
  echo ''                                       >>/etc/network/interfaces
fi

echo "updating ipkg feeds..."
ipkg update

echo "installing required drivers and software..."
echo "(some drivers may not install if they are already built into the kernel;"
echo "this is not a problem.)"
# Wireless packages
ipkg install wireless-tools kernel-module-zd1211rw

# WEP
ipkg install kernel-module-ieee80211-crypt-wep kernel-module-blkcipher \
 kernel-module-arc4 kernel-module-ecb kernel-module-aes

# WPA
ipkg install wpa-supplicant \
 kernel-module-ieee80211-crypt-tkip kernel-module-michael-mic

echo "Please reboot, then you can type \"ifup eth1\" to bring up the new network..."

Note: You may need to run `depmod -a' after executing the script.

Page last modified on December 20, 2009, at 05:52 PM