summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-07-11 12:16:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-07-11 12:16:47 +0000
commit3233e578eb00eb2542059a76daeff4f7fe0efa4a (patch)
treea61f025eb92ab380558b27be840dac7e500d3fef
parentcfd3a5c24d84a1c38fb4b4b88541b535bcd720de (diff)
special case of a non-CDC_AT device tha belongs here; from freebsd
-rw-r--r--sys/dev/usb/umodem.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c
index 6098dec3f62..2eb62dd78d1 100644
--- a/sys/dev/usb/umodem.c
+++ b/sys/dev/usb/umodem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umodem.c,v 1.16 2004/07/08 22:18:44 deraadt Exp $ */
+/* $OpenBSD: umodem.c,v 1.17 2004/07/11 12:16:46 deraadt Exp $ */
/* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */
/*
@@ -159,25 +159,39 @@ USB_MATCH(umodem)
{
USB_MATCH_START(umodem, uaa);
usb_interface_descriptor_t *id;
- int cm, acm;
+ usb_device_descriptor_t *dd;
+ int cm, acm, ret;
if (uaa->iface == NULL)
return (UMATCH_NONE);
id = usbd_get_interface_descriptor(uaa->iface);
- if (id == NULL ||
- id->bInterfaceClass != UICLASS_CDC ||
- id->bInterfaceSubClass != UISUBCLASS_ABSTRACT_CONTROL_MODEL ||
- id->bInterfaceProtocol != UIPROTO_CDC_AT)
+ dd = usbd_get_device_descriptor(uaa->device);
+ if (id == NULL || dd == NULL)
return (UMATCH_NONE);
+ ret = UMATCH_NONE;
+ if (UGETW(dd->idVendor) == USB_VENDOR_KYOCERA &&
+ UGETW(dd->idProduct) == USB_PRODUCT_KYOCERA_AHK3001V &&
+ id->bInterfaceNumber == 0)
+ ret = UMATCH_VENDOR_PRODUCT;
+
+ if (ret == UMATCH_NONE &&
+ id->bInterfaceClass == UICLASS_CDC &&
+ id->bInterfaceSubClass == UISUBCLASS_ABSTRACT_CONTROL_MODEL &&
+ id->bInterfaceProtocol == UIPROTO_CDC_AT)
+ ret = UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO;
+
+ if (ret == UMATCH_NONE)
+ return (ret);
+
umodem_get_caps(uaa->device, &cm, &acm);
if (!(cm & USB_CDC_CM_DOES_CM) ||
!(cm & USB_CDC_CM_OVER_DATA) ||
!(acm & USB_CDC_ACM_HAS_LINE))
return (UMATCH_NONE);
- return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
+ return (ret);
}
USB_ATTACH(umodem)