summaryrefslogtreecommitdiff
path: root/openembedded/packages/linux-hotplug/files/usbd.agent
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2005-08-31 10:45:47 +0000
committerRichard Purdie <richard@openedhand.com>2005-08-31 10:45:47 +0000
commit4b46c1f6e891b1ddd5968536440b888661fade3e (patch)
treee0ba2c1f56f61b868bf746da5c4feabb25b800b2 /openembedded/packages/linux-hotplug/files/usbd.agent
downloadopenembedded-core-4b46c1f6e891b1ddd5968536440b888661fade3e.tar.gz
openembedded-core-4b46c1f6e891b1ddd5968536440b888661fade3e.tar.bz2
openembedded-core-4b46c1f6e891b1ddd5968536440b888661fade3e.tar.xz
openembedded-core-4b46c1f6e891b1ddd5968536440b888661fade3e.zip
Initial population
git-svn-id: https://svn.o-hand.com/repos/poky@1 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/packages/linux-hotplug/files/usbd.agent')
-rwxr-xr-xopenembedded/packages/linux-hotplug/files/usbd.agent63
1 files changed, 63 insertions, 0 deletions
diff --git a/openembedded/packages/linux-hotplug/files/usbd.agent b/openembedded/packages/linux-hotplug/files/usbd.agent
new file mode 100755
index 000000000..6613b4810
--- /dev/null
+++ b/openembedded/packages/linux-hotplug/files/usbd.agent
@@ -0,0 +1,63 @@
+#!/bin/ash
+
+# DEBUG=yes export DEBUG
+#set -x
+
+. /etc/hotplug/hotplug.functions
+. /etc/default/usbd
+cd $HOTPLUG_DIR
+
+[ -z "$INTERFACE" ] && exit 1
+[ -z "$ACTION" ] && exit 1
+[ -z "$usbdmodule" ] && exit 0
+
+debug_mesg "USBD $ACTION Action Recived"
+
+case $INTERFACE in
+
+monitor)
+ case $ACTION in
+ # called to load all usb device modules
+ load)
+ modprobe usbdcore
+ modprobe net_fd
+ modprobe $usbdmodule
+ ;;
+
+ # called to handle suspend power management event
+ suspend)
+ rmmod $usbdmodule
+ ;;
+
+ # called to reload after resume power management event
+ restore-loaded)
+ modprobe $usbdmodule
+ sleep 2
+ ;;
+
+ # called to unload after resume power management event
+ restore-unloaded)
+ modprobe -r net_fd
+ ;;
+
+ # called to unload all usb device modules
+ unload)
+ modprobe -r $usbdmodule
+ ;;
+
+ *)
+ debug_mesg USBD $ACTION event not handled
+ exit 1
+ ;;
+ esac
+ ;;
+*)
+ debug_mesg USBD $INTERFACE-$ACTION event not handled
+ exit 1
+ ;;
+esac
+
+[ -e /proc/usb-monitor ] && echo "Done" > /proc/usb-monitor
+
+exit 0
+