mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 15:22:20 +02:00
configure-usb-modem: make more generic
This commit is contained in:
23
udev/configure-usb-modem
Normal file → Executable file
23
udev/configure-usb-modem
Normal file → Executable file
@@ -1,8 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
DEVPATH=/sys/$1
|
||||
USB_ID=
|
||||
|
||||
[ -d ${DEVPATH} ] || exit 1
|
||||
|
||||
while [ ! "${USB_ID}" ]; do
|
||||
if [ -f ${DEVPATH}/avoid_reset_quirk ]; then
|
||||
USB_ID=$(basename ${DEVPATH})
|
||||
break
|
||||
fi
|
||||
DEVPATH=$(dirname ${DEVPATH})
|
||||
done
|
||||
|
||||
# Avoid USB resets
|
||||
echo "auto" > /sys/bus/usb/devices/3-1/power/control
|
||||
echo "3000" > /sys/bus/usb/devices/3-1/power/autosuspend_delay_ms
|
||||
echo "enabled" > /sys/bus/usb/devices/3-1/power/wakeup
|
||||
echo "1" > /sys/bus/usb/devices/3-1/avoid_reset_quirk
|
||||
echo "0" > /sys/bus/usb/devices/3-1/power/persist
|
||||
echo "auto" > /sys/bus/usb/devices/${USB_ID}/power/control
|
||||
echo "3000" > /sys/bus/usb/devices/${USB_ID}/power/autosuspend_delay_ms
|
||||
echo "enabled" > /sys/bus/usb/devices/${USB_ID}/power/wakeup
|
||||
echo "1" > /sys/bus/usb/devices/${USB_ID}/avoid_reset_quirk
|
||||
echo "0" > /sys/bus/usb/devices/${USB_ID}/power/persist
|
||||
|
Reference in New Issue
Block a user