First, you need a cross compiler/toolchain.  The easiest way is to check and compile out the OpenWRT build that you flashed your router with (mismatched versions can cause modules to fail loading).

For Kamikaze 7.09, you would do the following:

svn co https://svn.openwrt.org/openwrt/tags/kamikaze_7.09
cd trunk
make

Try to do this on a box with a decent amount of memory.  I tried on a VM with 128mb, and it didn't finish in 12 hours, so I had to add some memory.

MadWifi already has support for cross compiling build in.

For mipsel, madwifi-0.9.3.3/hal/public/mips1-le-elf.inc needs to be modified.

This line:

COPTS+=        -G 0 -EL -mno-abicalls -fno-pic -mips1 -Wa,--trap \

need to replaced with this line:

COPTS+=        -G 0 -mno-abicalls -fno-pic -Wa,--trap \

The cross compiler doesn't support the -EL option (which I think is for little endian), and the -mips1 option causes a conflict.  Since this is the openwrt compiler, I *think* it generates the code needed by default.

You need to do is specify a few paths when you run make.  In the MadWifi directory, if ~/openwrt is the OpenWRT path, run the following:

make \
    KERNELPATH=~/openwrt/build_mipsel/linux-2.6-brcm47xx/linux-2.6.22 \
    TARGET=mips1-le-elf \
    CROSS_COMPILE=mipsel-linux- \
    PATH=$PATH:~/openwrt/staging_dir_mipsel/bin/

Now you have the binaries.  You need to replace them on the OpenWRT box.  You could put them together into a package (and hopefully someone does), but this was a quick hack.

Using cp and find in the MadWifi directory, reproduce this tree:

./lib
./lib/modules
./lib/modules/2.6.22
./lib/modules/2.6.22/ath_hal.ko
./lib/modules/2.6.22/ath_pci.ko
./lib/modules/2.6.22/ath_rate_amrr.ko
./lib/modules/2.6.22/ath_rate_onoe.ko
./lib/modules/2.6.22/ath_rate_sample.ko
./lib/modules/2.6.22/wlan_acl.ko
./lib/modules/2.6.22/wlan_ccmp.ko
./lib/modules/2.6.22/wlan.ko
./lib/modules/2.6.22/wlan_scan_ap.ko
./lib/modules/2.6.22/wlan_scan_sta.ko
./lib/modules/2.6.22/wlan_tkip.ko
./lib/modules/2.6.22/wlan_wep.ko
./lib/modules/2.6.22/wlan_xauth.ko
./usr
./usr/sbin
./usr/sbin/80211stats
./usr/sbin/athchans
./usr/sbin/athctrl
./usr/sbin/athkey
./usr/sbin/athstats
./usr/sbin/wlanconfig

These files will replace the ones on your router.  It would be smart to either back the originals up, or have the stock MadWifi package handy.  Also, run "file" on the new files to make sure they are indeed the right architecture.

I think you need to unload the modules before you replace them. "rm mod wlan" should do this.

Copy the files over.  Make sure the permissions and ownership match those of the original files.

Replace /etc/modules.d/50-madwifi with this:

wlan
wlan_scan_ap
wlan_scan_sta
ath_hal
ath_rate_amrr
ath_rate_onoe
ath_rate_sample
wlan_acl
wlan_ccmp
wlan_tkip
wlan_wep
wlan_xauth
ath_pci

I couldn't just load a module; I had to reboot, but upon rebooting, my wireless connection came up.