]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
umbim: add support for wwan device class
authorAntti Seppälä <a.seppala@gmail.com>
Tue, 27 May 2025 08:20:09 +0000 (11:20 +0300)
committerRobert Marko <robimarko@gmail.com>
Tue, 27 May 2025 09:31:07 +0000 (11:31 +0200)
Some MBIM devices can exist on an MHI bus (over PCIe) instead of being presented as USB devices.

In such cases the interface name lookup needs to be done from /sys/class/wwan/ instead of /sys/class/usbmisc/

Add another readlink call in case the first lookup fails.

This allows the MBIM protocol to find the interface name and then work with both type of devices provided that /etc/config/network has the right device for MBIM interface (such as /dev/wwan0mbim0 in case of MHI)

Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
package/network/utils/umbim/files/lib/netifd/proto/mbim.sh

index 01e8628d7460cdc7e2e0717963eeb28815f625e6..dc3a715522919765da8b0e7c40c18cf529eb934f 100755 (executable)
@@ -73,7 +73,7 @@ _proto_mbim_setup() {
        }
 
        devname="$(basename "$device")"
-       devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)"
+       devpath="$(readlink -f /sys/class/usbmisc/$devname/device/ || readlink -f /sys/class/wwan/$devname/device/)"
        ifname="$( ls "$devpath"/net )"
 
        [ -n "$ifname" ] || {