I am using openwrt version 19.07.5 r11257-5090152ae3
on an AVM FRITZ! Box 4040,
I have already activated (which works) a connection via usb tethering through a script that is run from /etc/hotplug.d/usb/99-my-device
the script of my choice executes some commands:
adb start-server; # starts the adb server to control the smartphone
adb shell svc data enable; #activate mobile data on your smartphone
adb shell svc usb setFunctions rndis; #activate usb tethering on your smartphone
ifup usb; #activate the usb interface
if I program a hardware button that does:
ifdown usb; #disable the usb interface
adb kill-server; #kills the adb server
I don't get any errors and if I disconnect the USB cable and then reconnect the cable, the whole process is correctly re-executed
if I don't press the hardware button and I unplug the usb cable directly
i get an error:
usb 1-1: USB disconnect, device number 5
xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command.
xhci-hcd xhci-hcd.0.auto: Host halt failed, -110
xhci-hcd xhci-hcd.0.auto: xHCI host controller not responding, assumes dead
xhci-hcd xhci-hcd.0.auto: HC died; cleaning up
and at the following connection of the usb cable I no longer detect new additions via lsusb even by inserting a usbkey it is as if the usb port is dead (just a reboot, it brings me back to an acceptable condition)
i tried to run via /etc/hotplug.d/usb/99-my-device
of the actions in phase of "unbind" of the interface but these actions
rightly they are also performed when inserting the new usb device as the process of modification through the commands
adb changes the "ID" of the usb device.
some additional information:
kmod-usb-core - 4.14.209-1
kmod-usb-net - 4.14.209-1
kmod-usb-net-cdc-ether - 4.14.209-1
kmod-usb-net-cdc-mbim - 4.14.209-1
kmod-usb-net-cdc-ncm - 4.14.209-1
kmod-usb-net-rndis - 4.14.209-1
kmod-usb-storage - 4.14.209-1
kmod-usb-wdm - 4.14.209-1
kmod-usb3 - 4.14.209-1
libusb-1.0-0 - 1.0.22-2
usbutils - 007-10
dmesg when activating the script:
usb 1-1: new high-speed USB device number 3 using xhci-hcd
rndis_host 1-1: 1.0 usb0: register 'rndis_host' at usb-xhci-hcd.0.auto-1, RNDIS device
dmesg on activation via script programmed with hardware button:
usb 1-1: USB disconnect, device number 3
rndis_host 1-1: 1.0 usb0: unregister 'rndis_host' usb-xhci-hcd.0.auto-1, RNDIS device
if you want more information just ask, thanks to anyone who wants to give me a hand or just read the post