Setting GuruPlug to be a stable WiFi Client
Contents |
Synopsis
A quick and dirty tutorial for getting client mode working reliably in just a few minutes can be found here. Continue on for details or if you'd rather compile the kernel yourself.
The guruplug stock firmware and libertas drivers for the sd8688 chipset are causing frequent kernel oops and crashes when there is some network load under wifi client mode. (http://lists.infradead.org/pipermail/libertas-dev/2010-November/003335.html).
This alternate how-to uses a new set of drivers, tested on linux kernel 2.6.33.7, which are reportedly stable. Important: the provided driver set does not compile against kernels starting from 2.6.35 and above. An update might be coming soon.
Note that, disregarding the presence of new Bluetooth drivers in the new drivers/firmware package, this tutorial is solely concerned with the wifi client mode.
Pre-compiled binaries
If you do not mind a pre-compiled 2.6.33.7 kernel with the default guruplug configuration along with the standard modules, you can download and install the following set of files:
File:UImage linux kernel 2 6 33 7.tar.bz2
Refer to the steps below for the drivers installation. For flashing the kernel, refer to: Re-building the kernel and U-Boot
Compiling the Drivers
Configuring and compiling a new kernel
You will need to compile and install a new kernel with CONFIG_WEXT_PRIV option enabled. Do to so, refer to the instructions at: Re-building the kernel and U-Boot and make sure to apply at least the third patch from the proposed patchset.
Unfortunately, the WEXT_PRIV option needed to compile the drivers is not directly available in the kernel configuration UI. It is enabled automatically if you select a driver that needs it. Obviously, this can't work for out-of-tree drivers.
So the simplest way is, from your kernel directory:
- Launch the menu configuration:
make CROSS_COMPILE=<cross_compiler_prefix> ARCH=arm menuconfig
- Go to "load an alternate configuration file", and load:
./arch/arm/configs/guruplug_defconfig
as your alternate config file.
- From "Device Drivers/Network device support/Wireless LAN/" you can select "Atmel at76c50x chipset 802.11b support" to be build-in (*); as this is one of the drivers that requires WEXT_PRIV.
- Save your configuration exit, compile the kernel and compile the modules (your configuration should have been saved as .config and at this point, you can proceed with make uImage)
As a workaround you could make the option visible by editing net/wireless/Kconfig in the kernel tree. The fragment:
config WEXT_PRIV
bool
should become:
config WEXT_PRIV
bool "just put some text here to describe the option"
That will make the option visible in the UI.
Once you enabled the option, you should be able to compile and install your new kernel along with it's modules. (Still refer to Re-building the kernel and U-Boot for instructions).
Compiling the Drivers
- Download and extract the following package: File:SD WLAN.tar.gz
- Go to
./SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/
- You can build the driver against your kernel sources with:
./make CROSS_COMPILE=<cross_compiler_prefix> ARCH=arm KERNELDIR=<kernel sources dir>
You should now have in your working directory two files named: mcypt.ko and sd8xxx.ko.
- Copy those files along with the ones in ./SD_WLAN/FwImage/ to your /root/ directory on the guruplug.
Drivers installation
At this point, your guruplug should be running your new kernel with the WEXT_PRIV option enabled.
It is suggested you try the next operations connected with jtag instead of ssh since you will rapidly get some feedback if your driver installation worked or not.
To test the driver you will need to:
- copy the firmwares to the right location:
cp /root/helper_sd.bin /lib/firmware/mrvl/ cp /root/sd8688.bin /lib/firmware/mrvl/
- If the libertas modules are already loaded, remove them with:
rmmod libertas_sdio rmmod libertas
- Next, you can install the new drivers in the following order:
insmod /root/mcypt.ko insmod /root/sd8xxx.ko
You should get the following output:
mcypt: module license 'Marvell Proprietary' taints kernel. Disabling lock debugging due to kernel taint wlan_sdio mmc0:0001:1: firmware: requesting mrvl/helper_sd.bin wlan_sdio mmc0:0001:1: firmware: requesting mrvl/sd8688.bin WLAN FW is active
Your new wifi device will most likely be called: mlan0
You can check /proc/mwlan to verify.
Initialization scripts
To initialize the plug in client mode upon each boot:
- If it does not already exists, create a /firmware directory in /root/
mkdir /root/firmware
- Copy in /root/firmware directory your new firmware files (helper_sd.bin and sd8688.bin)
- Create a directory in /root/ to store your new drivers (mcypt.ko andsd8xxx.ko) and move those drivers in it.
mkdir /root/wifi mv /root/sd8xxx.ko /root/wifi/ mv /root/mcypt.ko /root/wifi/
- Ensure that /root/init_setup.sh has the proper steps to initialize your wifi connection:
# The script where we actually invoke the drivers /usr/bin/wlan.sh # Initialize the connection with wpa_supplicant (refer to # wpa_supplicant documentation for how to configure /etc/wifi.conf) /sbin/wpa_supplicant -i mlan0 -c /etc/wifi.conf -B # Bring up the interface ifconfig mlan0 up # We give the plug a static ip ifconfig mlan0 192.168.0.150 netmask 255.255.255.0 up route add -net 192.168.0.0 netmask 255.255.255.0 mlan0 route add default gw 192.168.0.1 mlan0
- Modify /usr/bin/wlan.sh according to our new configuration:
#!/bin/sh # We stop the access point mode wheter or not it's been enabled rmmod uap8xxx /etc/init.d/udhcpd stop /etc/init.d/dnsmasq stop cp /root/firmware/* /lib/firmware/mrvl/ insmod /root/wifi/mcypt.ko insmod /root/wifi/sd8xxx.ko rm -f /lib/firmware/mrvl/* #Set leds for client mode echo 0 > `eval ls /sys/class/leds/*plug*\:green\:wmode/brightness` echo 1 > `eval ls /sys/class/leds/*plug*\:red\:wmode/brightness`
Note: In the above script, the behavior of copying the firmware files into /lib/firmware/mrvl, loading the modules then immediately deleting the firmware files looks weird, but is actually important -- if you reboot your plug and the firmware files are still in /lib/firmware/mrvl, wifi will get all screwed up. See this thread for details.
Reboot the Plug and still connected with jtag, ensure that everything loads properly.