summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/bluez/bluez-dtl1-workaround/02dtl1_cs.sh
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-connectivity/bluez/bluez-dtl1-workaround/02dtl1_cs.sh
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadopenembedded-core-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-connectivity/bluez/bluez-dtl1-workaround/02dtl1_cs.sh')
-rw-r--r--meta/recipes-connectivity/bluez/bluez-dtl1-workaround/02dtl1_cs.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/bluez/bluez-dtl1-workaround/02dtl1_cs.sh b/meta/recipes-connectivity/bluez/bluez-dtl1-workaround/02dtl1_cs.sh
new file mode 100644
index 0000000000..fefc72e07a
--- /dev/null
+++ b/meta/recipes-connectivity/bluez/bluez-dtl1-workaround/02dtl1_cs.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+case "$1" in
+ suspend)
+ if [ "`/sbin/hciconfig`" != "" ]; then
+ #If hciconfig outputs anything then there's probably a Bluetooth
+ # CF card in the slot so shut it down.
+ hcitool dc `hcitool con | grep ACL | sed 's/^.*\([0-9A-F]\{2\}\(:[0-9A-F]\{2\}\)\{5\}\).*$/\1/'`
+ hciconfig hci0 down
+ killall hciattach > /dev/null 2>&1
+ fi
+ ;;
+
+ resume)
+ #check for kernel version
+ if [ "`uname -r | grep 2.4.`" != "" ]; then
+ k="o"
+ elif [ "`uname -r | grep 2.6.`" != "" ]; then
+ k="ko"
+ else
+ exit 0
+ fi
+
+ if test -e /sbin/cardctl; then
+ CARDCTL=/sbin/cardctl
+ elif test -e /sbin/pccardctl; then
+ CARDCTL=/sbin/pccardctl
+ else
+ exit 0
+ fi
+
+ if [ "`lsmod | grep hci_uart`" != "" ]; then
+ #If the hci_usb module is still loaded then there's a serial based
+ # Bluetooth CF card in the slot, which only needs a resume to get it going
+ # again.
+ rfcomm bind all
+ $CARDCTL resume
+ hciconfig hci0 up
+ else
+ # only works for nokia dtl1 cards
+ for f in /lib/modules/`uname -r`/kernel/drivers/bluetooth/dtl1_cs.$k
+ do
+ #Enumerate all the self-contained Bluetooth CF card drivers
+ f=`echo $f | sed 's/\.'$k'$//'`
+ f=`basename $f`
+ if [ "`lsmod | grep $f`" != "" ]; then
+ #If one of these drivers is still loaded, then there is probably
+ #a non-serial based Bluetooth CF card in the slot that needs
+ #ejecting and reinserting to get it going again
+ rfcomm bind all
+ $CARDCTL eject
+ $CARDCTL insert
+ hciconfig hci0 up
+ fi
+ done
+ fi
+esac