Maemo N8x0: kernel 2.6.29 and open source wlan driver

From Alecrim

Jump to: navigation, search

Contents

Install Toolchain

I consider you already know how to install it. If not, I'll write this part ASAP.

Install Maemo depends

Update and install missing tools in your device.

sudo gainroot 
echo "deb http://repository.maemo.org diablo/tools free non-free" >> /etc/apt/sources.list.d/hildon-application-manager.list
apt-get update
apt-get install wireless-tools dropbear-server libicd-network-dummy dropbear-scp
gconftool -s -t string /system/osso/connectivity/IAP/DEFAULT/type DUMMY


Download and compile kernel

I'm using linux-omap.git branch master and commit 30aa6458dfb749f4387bb808cb3f8ab7b78341e5 that is available today.

git clone git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
make n800_defconfig

I did some changes using:

make menuconfig

The most important changes are related to MAC 80211 and USB gadget ethernet.

You can download my config file.

Open Source WLAN driver

Download and compile open source wlan driver.

git clone git://gitorious.org/stlc45xx/mainline.git wlan.git
make KERNEL_SRC_DIR=../linux-omap-2.6

Flash new kernel

Flashing your device:

sudo flasher --enable-rd-mode
sudo flasher --set-rd-flags=no-omap-wd,no-lifeguard-reset
sudo flasher -k [http://franciscoalecrim.com/down/maemo/stlc45xx/zImage-2.6.29 ../linux-omap-2.6/arch/arm/boot/zImage] -f -R 

Maemo start up USB0 with ip 192.168.2.15, it is already configured. It should start up usb0 in desktop when you plug it.

Create file usb0 configuration in your desktop. Add to /etc/network/interfaces .

allow-hotplug usb0

mapping hotplug
        script grep
        map usb0

iface usb0 inet static
       address 192.168.2.14
       netmask 255.255.255.0
       broadcast 192.168.2.255
       up iptables -I INPUT 1 -s 192.168.2.15 -j ACCEPT

Startup USB

sudo ifdown usb0 
sudo ifup usb0

Load module and configure

Load kernel module:

scp [http://franciscoalecrim.com/down/maemo/stlc45xx/stlc45xx.ko stlc45xx.ko] root@192.168.2.15:
mkdir  -p  /lib/modules/2.6.29-rc7-omap1
mv stlc45xx.ko /lib/modules/2.6.29-rc7-omap1
insmod /lib/modules/2.6.29-rc7-omap1/stlc45xx.ko

This step is optional regarding the documentation:

scp [http://franciscoalecrim.com/down/maemo/stlc45xx/stlc45xx-cal stlc45xx-cal] root@192.168.2.15:
mv stlc45xx-cal /mnt/initfs/tmp/
chmod +x /tmp/stlc45xx-cal
chroot /mnt/initfs /tmp/stlc45xx-cal

Using wlannet script to automate module load :

#!/bin/sh
# Startup USB and WLAN stlc45xx
# Author: Francisco Alecrim <alecrim@gmail.com>

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=wlannet
DESC="WLAN stlc45xx Networking"
INITFILE=/etc/init.d/$NAME

case "$1" in
start)
		KERNEL_VERSION="`uname -r`"
		echo -n "Loading module stlc45xx.ko ..."
		insmod /lib/modules/$KERNEL_VERSION/stlc45xx.ko
		if [ "$?" != "0" ]; then
			insmod /lib/modules/$KERNEL_VERSION/stlc45xx.ko
		fi
		sleep 2
		ifconfig wlan0 up
		echo "DONE"
		;;
stop)
		echo -n "Unload stlc45xx ..."
		rmmod stlc45xx
		echo "DONE"
		;;
*)
		printf "Usage: $INITFILE {start|stop}\n" >&2
		exit 1
		;;
esac

exit 0

Automatic start up

cd /etc/rc2.d/
ln -s ../init.d/wlannet S99wlan


Configure wlan network

iwconfig
iwlist scan
iwconfig wlan0 essid MY_ESSID key off 
udhcpc -iwlan0 

Revert changes

sudo rm /etc/init.d/wlannet
sudo flasher -F <FIASCO_IMAGE> --flash-only kernel -f -R


References

Personal tools