summaryrefslogtreecommitdiffstats
path: root/meta/packages/linux-hotplug/files/usbd.agent
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/linux-hotplug/files/usbd.agent')
-rwxr-xr-xmeta/packages/linux-hotplug/files/usbd.agent63
1 files changed, 63 insertions, 0 deletions
diff --git a/meta/packages/linux-hotplug/files/usbd.agent b/meta/packages/linux-hotplug/files/usbd.agent
new file mode 100755
index 0000000000..6613b4810a
--- /dev/null
+++ b/meta/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