|
@@ -89,6 +89,23 @@ function running_as_root {
|
89
|
89
|
fi
|
90
|
90
|
}
|
91
|
91
|
|
|
92
|
+function reset_usb_devices {
|
|
93
|
+ for xhci in /sys/bus/pci/drivers/?hci_hcd ; do
|
|
94
|
+
|
|
95
|
+ if ! cd $xhci ; then
|
|
96
|
+ return
|
|
97
|
+ fi
|
|
98
|
+
|
|
99
|
+ echo Resetting devices from $xhci...
|
|
100
|
+
|
|
101
|
+ for i in ????:??:??.? ; do
|
|
102
|
+ echo -n "$i" > unbind
|
|
103
|
+ echo -n "$i" > bind
|
|
104
|
+ done
|
|
105
|
+ done
|
|
106
|
+ udevadm control --reload-rules
|
|
107
|
+}
|
|
108
|
+
|
92
|
109
|
function initial_setup {
|
93
|
110
|
if [[ $(is_completed $FUNCNAME) == "1" ]]; then
|
94
|
111
|
return
|