| 1 |
stlc45xx README |
| 2 |
Kalle Valo <kalle.valo@nokia.com> |
| 3 |
|
| 4 |
---------------------------------------------------------------------- |
| 5 |
This is stlc45xx, a mac80211 driver for stlc4550 and stlc4560 WLAN |
| 6 |
chips used, for example, in Nokia N800 and N810. This is very much |
| 7 |
work in progress and contains a lot of bugs. |
| 8 |
|
| 9 |
---------------------------------------------------------------------- |
| 10 |
|
| 11 |
1. Getting linux-omap tree |
| 12 |
|
| 13 |
* Clone latest linux-omap tree: |
| 14 |
|
| 15 |
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git |
| 16 |
|
| 17 |
2. Kernel configuration |
| 18 |
|
| 19 |
$ make n800_defconfig |
| 20 |
|
| 21 |
Also enable mac80211 with 'make menuconfig'. |
| 22 |
|
| 23 |
3. Compiling |
| 24 |
|
| 25 |
* Compile kernel: |
| 26 |
|
| 27 |
$ make |
| 28 |
|
| 29 |
* Compile stlc45xx: |
| 30 |
$ make KERNEL_SRC_DIR=../linux-omap-2.6 |
| 31 |
|
| 32 |
* Before flashing kernel to device, you should disable three daemons |
| 33 |
Nokia-N810$> update-rc.d -f dsp-init remove |
| 34 |
Nokia-N810$> update-rc.d -f multimediad remove |
| 35 |
Nokia-N810$> update-rc.d -f esd remove |
| 36 |
|
| 37 |
* Enable necessary R&D flags: |
| 38 |
|
| 39 |
$ flasher --set-rd-flags=no-omap-wd,no-retu-wd,no-lifeguard-reset |
| 40 |
|
| 41 |
* Flash kernel: |
| 42 |
|
| 43 |
$ flasher -k arch/arm/boot/zImage -f |
| 44 |
|
| 45 |
4. Setting up usb-network |
| 46 |
|
| 47 |
* Reboot device. |
| 48 |
|
| 49 |
* Enable usb networking: |
| 50 |
|
| 51 |
$ insmod g_ether.ko (you might need to do this twice) |
| 52 |
$ ifconfig usb0 10.1.1.11 up |
| 53 |
$ ifconfig usb0 10.1.1.10 up |
| 54 |
|
| 55 |
* Setting usb0 to start automatically: |
| 56 |
|
| 57 |
- copy usbnet script to device's /etc/init.d/ directory (see appendix A) |
| 58 |
- add execution bit for usbnet (chmod +x /etc/init.d/usbnet) |
| 59 |
- set usbnet start at runlevel 2 (update-rc.d usbnet start 99 2) |
| 60 |
- device: add following lines to /etc/network/interface |
| 61 |
allow-hotplug usb0 |
| 62 |
iface usb0 inet static |
| 63 |
address 10.1.1.11 |
| 64 |
netmask 255.255.255.0 |
| 65 |
broadcast 10.1.1.255 |
| 66 |
- desktop: add following lines to /etc/network/interface |
| 67 |
allow-hotplug usb0 |
| 68 |
iface usb0 inet static |
| 69 |
address 10.1.1.10 |
| 70 |
netmask 255.255.255.0 |
| 71 |
broadcast 10.1.1.255 |
| 72 |
- Add following line to your desktop's /etc/hosts file |
| 73 |
10.1.1.11 n8x0 |
| 74 |
|
| 75 |
* Restart device. After restarting you should be able to log in via |
| 76 |
ssh (ssh root@n8x0). Unplug-plug usb cable might needed. |
| 77 |
|
| 78 |
5. Setting up stlc45xx module |
| 79 |
|
| 80 |
* Copy stlc45xx.ko and stlc45xx-cal from your desktop to the device. |
| 81 |
|
| 82 |
* Disable automatic WLAN connections from Control Panel or shutdown |
| 83 |
wlancond (/etc/init.d/wlancond stop) |
| 84 |
|
| 85 |
* Unload cx3110x driver from memory (rmmod cx3110x). |
| 86 |
|
| 87 |
* Load mac80211.ko and stlc45xx.ko modules and run stlc45xx-cal: |
| 88 |
|
| 89 |
$ cp stlc45xx-cal /mnt/initfs/tmp/ & chroot /mnt/initfs /tmp/stlc45xx-cal) |
| 90 |
|
| 91 |
Now wlan0 interface is ready to run. Use iwconfig, wpa_supplicant or |
| 92 |
whatever you intent to use. |
| 93 |
|
| 94 |
6.1. How roll back to default settings, option 1: |
| 95 |
|
| 96 |
* Just flash the full release you want to use: |
| 97 |
$ flasher -F latest_release.bin -f -R |
| 98 |
|
| 99 |
6.2. How roll back to default settings, option 2: |
| 100 |
|
| 101 |
* Enable disabled daemons: |
| 102 |
|
| 103 |
$ update-rc.d dsp-init start 24 2 |
| 104 |
$ update-rc.d multimediad start 24 2 |
| 105 |
$ update-rc.d esd start 26 2 |
| 106 |
|
| 107 |
* Disable usbnet if you find it necessary (if you want use device's |
| 108 |
memory via USB): |
| 109 |
|
| 110 |
$ update-rc.d -f usbnet remove |
| 111 |
|
| 112 |
* Disable some RD flags |
| 113 |
|
| 114 |
$ flasher --clear-rd-flags=no-omap-wd,no-retu-wd,no-lifeguard-reset |
| 115 |
|
| 116 |
* Flash latest released kernel and initfs: |
| 117 |
|
| 118 |
$ flasher -F latest_release.bin --flash-only kernel,initfs -f -R |
| 119 |
|
| 120 |
7. NOTES: |
| 121 |
|
| 122 |
* MMC do not work |
| 123 |
* DSP do not work |
| 124 |
* SPI have some bugs, packet loss in SPI bus |
| 125 |
|
| 126 |
|
| 127 |
Appendix A |
| 128 |
|
| 129 |
filename usbnet |
| 130 |
#! /bin/sh |
| 131 |
# |
| 132 |
# Startup script for USBnet (networking, instead of USB Mass Storage behaviour) |
| 133 |
# Author: Michael Mlivoncic |
| 134 |
|
| 135 |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
| 136 |
NAME=usbnet |
| 137 |
DESC="USB Networking for Nokia 770" |
| 138 |
INITFILE=/etc/init.d/$NAME |
| 139 |
|
| 140 |
case "$1" in |
| 141 |
start) |
| 142 |
umount /media/mmc1 |
| 143 |
umount /media/mmc2 |
| 144 |
sleep 2 |
| 145 |
USBNET="`lsmod | grep g_ether`" |
| 146 |
KERNEL_VERSION="`uname -r`" |
| 147 |
if [ "$USBNET" = "" ] |
| 148 |
then |
| 149 |
echo "entering Ethernet via USB mode (g_ether)..." |
| 150 |
insmod /mnt/initfs/lib/modules/$KERNEL_VERSION/g_ether.ko |
| 151 |
if [ "$?" != "0" ]; then |
| 152 |
insmod /mnt/initfs/lib/modules/$KERNEL_VERSION/g_ether.ko |
| 153 |
fi |
| 154 |
echo "waiting, then starting up the usb0.." |
| 155 |
sleep 1 |
| 156 |
/sbin/ifup usb0 |
| 157 |
else |
| 158 |
echo "already in Ethernet-via-USB mode..." |
| 159 |
echo "try ping 192.168.2.15" |
| 160 |
fi |
| 161 |
;; |
| 162 |
stop) |
| 163 |
echo "switching back to USB Mass Storage mode..." |
| 164 |
echo "removing module g_ether" |
| 165 |
/sbin/ifdown usb0 |
| 166 |
sleep 2 |
| 167 |
rmmod g_ether |
| 168 |
;; |
| 169 |
*) |
| 170 |
printf "Usage: $INITFILE {start|stop}\n" >&2 |
| 171 |
exit 1 |
| 172 |
;; |
| 173 |
esac |
| 174 |
|
| 175 |
exit 0 |
| 176 |
|
| 177 |
Appendix B |
| 178 |
|
| 179 |
Wpa_supplican usage: wpa_supplicant -D wext -i wlan0 -c config_file |
| 180 |
optional flags: |
| 181 |
-d show debug messages, -dd even more |
| 182 |
-B daemonize wpa_supplicant |
| 183 |
|
| 184 |
Example wpa_supplicant configurations: |
| 185 |
|
| 186 |
#OPEN |
| 187 |
network={ |
| 188 |
ssid="open_ssid" |
| 189 |
key_mgmt=NONE |
| 190 |
} |
| 191 |
|
| 192 |
#WEP |
| 193 |
network={ |
| 194 |
ssid="test1" |
| 195 |
key_mgmt=NONE |
| 196 |
wep_key0=acdc123456 |
| 197 |
wep_tx_keyidx=0 |
| 198 |
} |
| 199 |
|
| 200 |
#WPA(1&2) Personal |
| 201 |
network={ |
| 202 |
ssid="test2" |
| 203 |
proto=WPA RSN |
| 204 |
key_mgmt=WPA-PSK |
| 205 |
group=CCMP TKIP WEP104 WEP40 |
| 206 |
pairwise=CCMP TKIP |
| 207 |
#psk="acdc123456" |
| 208 |
psk=bf91ce371ac1eb3617b1f59be5339658c7ea44bf23071bcdd59bbd16d03f2c9f |
| 209 |
} |
| 210 |
|
| 211 |
#WPA Enterprise |
| 212 |
network={ |
| 213 |
ssid="test3" |
| 214 |
proto=WPA |
| 215 |
key_mgmt=WPA-EAP |
| 216 |
pairwise=TKIP |
| 217 |
identity="test" |
| 218 |
password="test123" |
| 219 |
} |