From 235eff02ac4c6bac53650697a54094390ea7f444 Mon Sep 17 00:00:00 2001 From: Dylan Van Assche Date: Fri, 12 Feb 2021 19:32:18 +0100 Subject: [PATCH] udev: add udev rule to configure modem USB Quectel advises to configure the USB autosuspend feature as: - power/control: auto - power/autosuspend_delay_ms: 3000 Futhermore, the following settings are also needed: - power/wakeup: enabled - power/persist: 0 - avoid_reset_quirk: 1 --- udev/80-modem-eg25.rules | 1 + udev/configure-usb-modem | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 udev/80-modem-eg25.rules create mode 100644 udev/configure-usb-modem diff --git a/udev/80-modem-eg25.rules b/udev/80-modem-eg25.rules new file mode 100644 index 0000000..163ec57 --- /dev/null +++ b/udev/80-modem-eg25.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{.LOCAL_ifNum}=="02", RUN+="/usr/bin/configure-modem-usb" diff --git a/udev/configure-usb-modem b/udev/configure-usb-modem new file mode 100644 index 0000000..97468fc --- /dev/null +++ b/udev/configure-usb-modem @@ -0,0 +1,8 @@ +#!/bin/sh + +# 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