summaryrefslogtreecommitdiffstats
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
downloadpoky-4b46c1f6e891b1ddd5968536440b888661fade3e.tar.gz
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 0000000000..6613b4810a
--- /dev/null
+++ b/openembedded/packages/linux-hotplug/files/usbd.agent
@@ -0,0 +1,63 @@
1#!/bin/ash
2
3# DEBUG=yes export DEBUG
4#set -x
5
6. /etc/hotplug/hotplug.functions
7. /etc/default/usbd
8cd $HOTPLUG_DIR
9
10[ -z "$INTERFACE" ] && exit 1
11[ -z "$ACTION" ] && exit 1
12[ -z "$usbdmodule" ] && exit 0
13
14debug_mesg "USBD $ACTION Action Recived"
15
16case $INTERFACE in
17
18monitor)
19 case $ACTION in
20 # called to load all usb device modules
21 load)
22 modprobe usbdcore
23 modprobe net_fd
24 modprobe $usbdmodule
25 ;;
26
27 # called to handle suspend power management event
28 suspend)
29 rmmod $usbdmodule
30 ;;
31
32 # called to reload after resume power management event
33 restore-loaded)
34 modprobe $usbdmodule
35 sleep 2
36 ;;
37
38 # called to unload after resume power management event
39 restore-unloaded)
40 modprobe -r net_fd
41 ;;
42
43 # called to unload all usb device modules
44 unload)
45 modprobe -r $usbdmodule
46 ;;
47
48 *)
49 debug_mesg USBD $ACTION event not handled
50 exit 1
51 ;;
52 esac
53 ;;
54*)
55 debug_mesg USBD $INTERFACE-$ACTION event not handled
56 exit 1
57 ;;
58esac
59
60[ -e /proc/usb-monitor ] && echo "Done" > /proc/usb-monitor
61
62exit 0
63