Skip to content
Snippets Groups Projects
Commit bb4e27fd authored by Bob Mottram's avatar Bob Mottram
Browse files

Reset usb devices

parent f24c1f6f
No related branches found
No related tags found
No related merge requests found
...@@ -89,6 +89,23 @@ function running_as_root { ...@@ -89,6 +89,23 @@ function running_as_root {
fi 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 { function initial_setup {
if [[ $(is_completed $FUNCNAME) == "1" ]]; then if [[ $(is_completed $FUNCNAME) == "1" ]]; then
return return
......
...@@ -67,7 +67,7 @@ function setup_wifi_atheros { ...@@ -67,7 +67,7 @@ function setup_wifi_atheros {
cd /lib/firmware cd /lib/firmware
tar -xzvf $atheros_drivers_file tar -xzvf $atheros_drivers_file
cd $curr_dir cd $curr_dir
udevadm control --reload-rules reset_usb_devices
} }
function setup_wifi { function setup_wifi {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment