NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/58396: u3g(4): add support for Sierra Wireless MC7304 devices



>Number:         58396
>Category:       kern
>Synopsis:       u3g(4): add support for Sierra Wireless MC7304 devices
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 03 21:20:00 +0000 2024
>Originator:     Reinhard Speyerer
>Release:        10.0
>Organization:
>Environment:
NetBSD nena 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC 2024  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/i386/compile/GENERIC i386
>Description:
u3g(4) does not handle the serial ports of Sierra Wireless MC7304 devices.
>How-To-Repeat:
Connect a Sierra Wireless MC7304 to a USB port and check dmesg(8) output:
[   290.934905] ugen0 at uhub4 port 1
[   290.934905] ugen0: Sierra Wireless, Incorporated (0x1199) MC7304 (0x68c0), rev 2.00/0.06, addr 6

>Fix:
Apply the patch below, rebuild the kernel and reboot:
[   225.410048] u3g0 at uhub5 port 1 configuration 1 interface 0
[   225.410048] ucom4 at u3g0 portno 0: 3G Modem
[   225.410048] u3g1 at uhub5 port 1 configuration 1 interface 2
[   225.410048] ucom5 at u3g1 portno 0: 3G Modem
[   225.410048] u3g1 at uhub5 port 1 configuration 1 interface 3
[   225.410048] ucom6 at u3g2 portno 0: 3G Modem

Sierra Wireless later reused the USB id of the MC7304 for their WP76xx devices
which provide an ADB interface which should not be handled by u3g(4).

# diff -U1 dev/usb/u3g.c.orig dev/usb/u3g.c 
--- dev/usb/u3g.c.orig  2023-02-14 17:33:43.000000000 +0100
+++ dev/usb/u3g.c       2024-07-01 23:00:20.000000000 +0200
@@ -246,2 +246,3 @@
        { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_250U },
+       { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC7304 },
        /* Toshiba */
@@ -303,4 +304,14 @@
            id->bInterfaceClass == UICLASS_VENDOR &&
-           uiaa->uiaa_product == USB_PRODUCT_SIERRA_USB305 &&
-            uiaa->uiaa_ifaceno >= 7)
+           (uiaa->uiaa_product == USB_PRODUCT_SIERRA_USB305 ||
+            uiaa->uiaa_product == USB_PRODUCT_SIERRA_MC7304) &&
+           uiaa->uiaa_ifaceno >= 7)
+               return UMATCH_NONE;
+       /*
+        * Some modems use the vendor-specific class also for
+        * ADB/Fastboot interfaces, which we should avoid attaching to.
+        */
+       if (uiaa->uiaa_vendor == USB_VENDOR_SIERRA &&
+           uiaa->uiaa_product == USB_PRODUCT_SIERRA_MC7304 &&
+           id->bInterfaceClass == UICLASS_VENDOR &&
+           id->bInterfaceSubClass == 0x42)
                return UMATCH_NONE;



Home | Main Index | Thread Index | Old Index