#!/bin/sh -e # # ST-Ericsson Snowball board peripherial setup script # # # (Limited) OTG HOST support USB_BTD=/sys/devices/platform/ab8500-i2c.0/ab8500-usb.0/boot_time_device start_musb() { if [ -f $USB_BTD ]; then echo 1 > $USB_BTD fi modprobe g_multi } stop_musb() { modprobe -r g_multi } # Bluetooth start_bluetooth() { hciattach -a 23 -s 115200 /dev/ttyAMA0 cg2900 115200 flow sleep 4 hciconfig hci0 up } stop_bluetooth() { killall hciattach } # WLAN (requires Bluetooth to be running currently!) start_wlan() { if [ "$WLAN_MAC" ] then modprobe cw1200_core macaddr=$WLAN_MAC fi modprobe cw1200_wlan } stop_wlan() { modprobe -r cw1200_wlan } # Configuration options: # - a line with 'WLAN_MAC=0x00,0x80,0xe1,0xb6,0xaf,0xed' sets WLAN MAC if [ -e /etc/snowballrc ] then . /etc/snowballrc fi case "$1" in start) start_musb start_bluetooth start_wlan ;; stop) stop_musb stop_bluetooth stop_wlan ;; force-reload|restart) stop_musb stop_bluetooth stop_wlan sleep 5 start_musb start_bluetooth start_wlan ;; *) echo "Usage: $0 {start|stop|restart}" ;; esac exit 0