Being sick of wireless disconnecting every time it rained, I got my hands upon a cheap Edimax EW-7728In PCI 802.11n card. This uses a RaLink rt2860 (PDF) chip, which has vendor-supplied open source drivers available. Getting it to work with Linux 2.6.26 is slightly non-trivial, however.
First, we need the drivers. At the time of writing, that means 2008_0522_RT2860_Linux_STA_v1.6.1.0.tar.bz2.
Next, we need to fix a couple of things. First, the Makefile is dumb, and tries to install into /tftpboot:
From 82dc3a8737e4f97311f4f4fccd79ea55a319f1ea Mon Sep 17 00:00:00 2001
From: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
Date: Mon, 14 Jul 2008 16:47:00 +0100
Subject: [PATCH] Get your filthy paws off my /tftpboot
---
Makefile | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 72bc933..aed3b00 100644
--- a/Makefile
+++ b/Makefile
@@ -80,11 +80,9 @@ LINUX:
ifneq (,$(findstring 2.4,$(LINUX_SRC)))
cp -f os/linux/Makefile.4 $(RT28xx_DIR)/os/linux/Makefile
make -C $(RT28xx_DIR)/os/linux/
- cp -f $(RT28xx_DIR)/os/linux/rt$(CHIPSET)sta.o /tftpboot
else
cp -f os/linux/Makefile.6 $(RT28xx_DIR)/os/linux/Makefile
make -C $(LINUX_SRC) SUBDIRS=$(RT28xx_DIR)/os/linux modules
- cp -f $(RT28xx_DIR)/os/linux/rt$(CHIPSET)sta.ko /tftpboot
endif
clean:
--
1.5.6.2
Next, dev->nd_net should now be dev_net(dev):
From 0878b37a40e2a7f466a74938920ff3751917eec3 Mon Sep 17 00:00:00 2001
From: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
Date: Mon, 14 Jul 2008 16:48:50 +0100
Subject: [PATCH] dev->nd_net is now dev_net(dev)
---
os/linux/rt_main_dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/os/linux/rt_main_dev.c b/os/linux/rt_main_dev.c
index 24604da..6a3471d 100644
--- a/os/linux/rt_main_dev.c
+++ b/os/linux/rt_main_dev.c
@@ -669,7 +669,7 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
- device = dev_get_by_name(dev->nd_net, slot_name);
+ device = dev_get_by_name(dev_net(dev), slot_name);
#else
device = dev_get_by_name(slot_name);
#endif
--
1.5.6.2
Finally, the driver is unusably noisy. Unless you want fifty-odd lines of kernel debug informatione every five seconds:
From 19c7a6895333624566775541fbc836e0c9208225 Mon Sep 17 00:00:00 2001
From: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
Date: Mon, 14 Jul 2008 16:47:43 +0100
Subject: [PATCH] You shut your dirty whore mouth
---
include/rt_linux.h | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/include/rt_linux.h b/include/rt_linux.h
index dfe4ab5..079d256 100644
--- a/include/rt_linux.h
+++ b/include/rt_linux.h
@@ -325,10 +325,6 @@ extern ULONG RTDebugLevel;
#define DBGPRINT_RAW(Level, Fmt) \
{ \
- if (Level <= RTDebugLevel) \
- { \
- printk Fmt; \
- } \
}
#define DBGPRINT(Level, Fmt) DBGPRINT_RAW(Level, Fmt)
--
1.5.6.2
There’s no Makefile install target, so you’ll need to sudo cp os/linux/*.ko /lib/modules/`uname -r`/kernel/ then sudo depmod -a before you can sudo modprobe rt2860sta. You’ll also need to sudo mkdir -p /etc/Wireless/RT2860STA/ then cp RT2860STA.dat /etc/Wireless/RT2860STA/, even though we’re not using that file for any configuration.
Gentoo’s init scripts, if you’re using them, try to be overly clever, and won’t be able to bring up the interface. So use something like this as your /etc/init.d/net.ra0:
#!/sbin/runscript
depend() {
need localmount
after bootmisc hostname net.lo net.lo0
use isapnp isdn pcmcia usb wlan
}
start() {
bash -x -c 'ifconfig ra0 up'
bash -x -c 'iwconfig ra0 essid giant-space-monkey key "aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66" freq 2.417G'
bash -x -c 'dhcpcd ra0'
}
stop() {
:
}
restart() {
:
}
And that appears to be sufficient.