Index: if_umb.c =================================================================== RCS file: /cvs/src/sys/dev/usb/if_umb.c,v retrieving revision 1.49 diff -u -p -w -r1.49 if_umb.c --- if_umb.c 11 Jan 2022 10:34:13 -0000 1.49 +++ if_umb.c 31 Mar 2023 01:40:43 -0000 @@ -237,12 +237,13 @@ const struct umb_quirk umb_quirks[] = { 2, UMATCH_VENDOR_PRODUCT }, - +#if 0 { { USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_EC25 }, 0, 1, UMATCH_VENDOR_PRODUCT }, +#endif { { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_ME906S }, Index: umsm.c =================================================================== RCS file: /cvs/src/sys/dev/usb/umsm.c,v retrieving revision 1.122 diff -u -p -w -r1.122 umsm.c --- umsm.c 23 Aug 2022 08:12:30 -0000 1.122 +++ umsm.c 31 Mar 2023 01:40:43 -0000 @@ -293,19 +293,24 @@ int umsm_match(struct device *parent, void *match, void *aux) { struct usb_attach_arg *uaa = aux; + const struct umsm_type *umsmt; usb_interface_descriptor_t *id; uint16_t flag; if (uaa->iface == NULL) return UMATCH_NONE; + umsmt = umsm_lookup(uaa->vendor, uaa->product); + if (umsmt == NULL) + return UMATCH_NONE; + /* * Some devices (eg Huawei E220) have multiple interfaces and some * of them are of class umass. Don't claim ownership in such case. */ - if (umsm_lookup(uaa->vendor, uaa->product) != NULL) { + id = usbd_get_interface_descriptor(uaa->iface); - flag = umsm_lookup(uaa->vendor, uaa->product)->umsm_flag; + flag = umsmt->umsm_flag; if (id == NULL || id->bInterfaceClass == UICLASS_MASS) { /* @@ -335,11 +340,19 @@ umsm_match(struct device *parent, void * (id->bInterfaceSubClass == 0x00 && id->bInterfaceProtocol == 0x00)))) { return UMATCH_NONE; - } else - return UMATCH_VENDOR_IFACESUBCLASS; - } + /* See the Quectel LTE&5G Linux USB Driver User Guide */ + } else if (uaa->vendor == USB_VENDOR_QUECTEL) { + /* Some interfaces can be used as network devices */ + if (id->bInterfaceClass != UICLASS_VENDOR) return UMATCH_NONE; + + /* Interface 4 can be used as a network device */ + if (uaa->ifaceno >= 4) + return UMATCH_NONE; + } + + return UMATCH_VENDOR_IFACESUBCLASS; } void