stlc45xx README Kalle Valo ---------------------------------------------------------------------- This is stlc45xx, a mac80211 driver for stlc4550 and stlc4560 WLAN chips used, for example, in Nokia N800 and N810. This is very much work in progress and contains a lot of bugs. ---------------------------------------------------------------------- 1. Getting linux-omap tree * Clone latest linux-omap tree: $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git 2. Kernel configuration $ make n800_defconfig Also enable mac80211 with 'make menuconfig'. 3. Compiling * Compile kernel: $ make * Compile stlc45xx: $ make KERNEL_SRC_DIR=../linux-omap-2.6 * Before flashing kernel to device, you should disable three daemons Nokia-N810$> update-rc.d -f dsp-init remove Nokia-N810$> update-rc.d -f multimediad remove Nokia-N810$> update-rc.d -f esd remove * Enable necessary R&D flags: $ flasher --set-rd-flags=no-omap-wd,no-retu-wd,no-lifeguard-reset * Flash kernel: $ flasher -k arch/arm/boot/zImage -f 4. Setting up usb-network * Reboot device. * Enable usb networking: $ insmod g_ether.ko (you might need to do this twice) $ ifconfig usb0 10.1.1.11 up $ ifconfig usb0 10.1.1.10 up * Setting usb0 to start automatically: - copy usbnet script to device's /etc/init.d/ directory (see appendix A) - add execution bit for usbnet (chmod +x /etc/init.d/usbnet) - set usbnet start at runlevel 2 (update-rc.d usbnet start 99 2) - device: add following lines to /etc/network/interface allow-hotplug usb0 iface usb0 inet static address 10.1.1.11 netmask 255.255.255.0 broadcast 10.1.1.255 - desktop: add following lines to /etc/network/interface allow-hotplug usb0 iface usb0 inet static address 10.1.1.10 netmask 255.255.255.0 broadcast 10.1.1.255 - Add following line to your desktop's /etc/hosts file 10.1.1.11 n8x0 * Restart device. After restarting you should be able to log in via ssh (ssh root@n8x0). Unplug-plug usb cable might needed. 5. Setting up stlc45xx module * Copy stlc45xx.ko and stlc45xx-cal from your desktop to the device. * Disable automatic WLAN connections from Control Panel or shutdown wlancond (/etc/init.d/wlancond stop) * Unload cx3110x driver from memory (rmmod cx3110x). * Load mac80211.ko and stlc45xx.ko modules and run stlc45xx-cal: $ cp stlc45xx-cal /mnt/initfs/tmp/ & chroot /mnt/initfs /tmp/stlc45xx-cal) Now wlan0 interface is ready to run. Use iwconfig, wpa_supplicant or whatever you intent to use. 6.1. How roll back to default settings, option 1: * Just flash the full release you want to use: $ flasher -F latest_release.bin -f -R 6.2. How roll back to default settings, option 2: * Enable disabled daemons: $ update-rc.d dsp-init start 24 2 $ update-rc.d multimediad start 24 2 $ update-rc.d esd start 26 2 * Disable usbnet if you find it necessary (if you want use device's memory via USB): $ update-rc.d -f usbnet remove * Disable some RD flags $ flasher --clear-rd-flags=no-omap-wd,no-retu-wd,no-lifeguard-reset * Flash latest released kernel and initfs: $ flasher -F latest_release.bin --flash-only kernel,initfs -f -R 7. NOTES: * MMC do not work * DSP do not work * SPI have some bugs, packet loss in SPI bus Appendix A filename usbnet #! /bin/sh # # Startup script for USBnet (networking, instead of USB Mass Storage behaviour) # Author: Michael Mlivoncic PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=usbnet DESC="USB Networking for Nokia 770" INITFILE=/etc/init.d/$NAME case "$1" in start) umount /media/mmc1 umount /media/mmc2 sleep 2 USBNET="`lsmod | grep g_ether`" KERNEL_VERSION="`uname -r`" if [ "$USBNET" = "" ] then echo "entering Ethernet via USB mode (g_ether)..." insmod /mnt/initfs/lib/modules/$KERNEL_VERSION/g_ether.ko if [ "$?" != "0" ]; then insmod /mnt/initfs/lib/modules/$KERNEL_VERSION/g_ether.ko fi echo "waiting, then starting up the usb0.." sleep 1 /sbin/ifup usb0 else echo "already in Ethernet-via-USB mode..." echo "try ping 192.168.2.15" fi ;; stop) echo "switching back to USB Mass Storage mode..." echo "removing module g_ether" /sbin/ifdown usb0 sleep 2 rmmod g_ether ;; *) printf "Usage: $INITFILE {start|stop}\n" >&2 exit 1 ;; esac exit 0 Appendix B Wpa_supplican usage: wpa_supplicant -D wext -i wlan0 -c config_file optional flags: -d show debug messages, -dd even more -B daemonize wpa_supplicant Example wpa_supplicant configurations: #OPEN network={ ssid="open_ssid" key_mgmt=NONE } #WEP network={ ssid="test1" key_mgmt=NONE wep_key0=acdc123456 wep_tx_keyidx=0 } #WPA(1&2) Personal network={ ssid="test2" proto=WPA RSN key_mgmt=WPA-PSK group=CCMP TKIP WEP104 WEP40 pairwise=CCMP TKIP #psk="acdc123456" psk=bf91ce371ac1eb3617b1f59be5339658c7ea44bf23071bcdd59bbd16d03f2c9f } #WPA Enterprise network={ ssid="test3" proto=WPA key_mgmt=WPA-EAP pairwise=TKIP identity="test" password="test123" }