Reset usb devices

This commit is contained in:
Bob Mottram 2016-10-21 14:00:29 +01:00
parent f24c1f6f2d
commit bb4e27fd67
2 changed files with 18 additions and 1 deletions

View File

@ -89,6 +89,23 @@ function running_as_root {
fi
}
function reset_usb_devices {
for xhci in /sys/bus/pci/drivers/?hci_hcd ; do
if ! cd $xhci ; then
return
fi
echo Resetting devices from $xhci...
for i in ????:??:??.? ; do
echo -n "$i" > unbind
echo -n "$i" > bind
done
done
udevadm control --reload-rules
}
function initial_setup {
if [[ $(is_completed $FUNCNAME) == "1" ]]; then
return

View File

@ -67,7 +67,7 @@ function setup_wifi_atheros {
cd /lib/firmware
tar -xzvf $atheros_drivers_file
cd $curr_dir
udevadm control --reload-rules
reset_usb_devices
}
function setup_wifi {