diff options
author | sanpei <sanpei@FreeBSD.org> | 2004-05-21 01:36:48 +0000 |
---|---|---|
committer | sanpei <sanpei@FreeBSD.org> | 2004-05-21 01:36:48 +0000 |
commit | fdc6b1b92186d300238a473a8d8d2df0f3f26800 (patch) | |
tree | 6714bcd848c191496876cede8044235c798547ae /sys/dev/usb | |
parent | ec00ca1e5821c4f0c2bc8156c2a5fb864abdca94 (diff) | |
download | FreeBSD-src-fdc6b1b92186d300238a473a8d8d2df0f3f26800.zip FreeBSD-src-fdc6b1b92186d300238a473a8d8d2df0f3f26800.tar.gz |
add support Kyocera AH-K3001V (cellular phone in Japan)
PR: kern/66779
Submitted by: Togawa Satoshi <toga@puyo.org>
MFC after: 1 week
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/umodem.c | 38 | ||||
-rw-r--r-- | sys/dev/usb/usbdevs | 4 |
2 files changed, 36 insertions, 6 deletions
diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c index 7497380..e552d16 100644 --- a/sys/dev/usb/umodem.c +++ b/sys/dev/usb/umodem.c @@ -115,6 +115,15 @@ SYSCTL_INT(_hw_usb_umodem, OID_AUTO, debug, CTLFLAG_RW, #endif #define DPRINTF(x) DPRINTFN(0, x) +static const struct umodem_product { + u_int16_t vendor; + u_int16_t product; +} umodem_products[] = { + /* Kyocera AH-K3001V*/ + { USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_AHK3001V }, + { 0, 0 }, +}; + /* * These are the maximum number of bytes transferred per frame. * If some really high speed devices should use this driver they @@ -213,25 +222,42 @@ USB_MATCH(umodem) { USB_MATCH_START(umodem, uaa); usb_interface_descriptor_t *id; - int cm, acm; + usb_device_descriptor_t *dd; + int cm, acm, i, 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; + for (i = 0; umodem_products[i].vendor != 0; i++) { + if (umodem_products[i].vendor == UGETW(dd->idVendor) && + umodem_products[i].product == UGETW(dd->idProduct)) { + ret = UMATCH_VENDOR_PRODUCT; + break; + } + } + + 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) diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index ee47889..d238694 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -112,6 +112,7 @@ vendor SANYO 0x0474 Sanyo Electric vendor CONNECTIX 0x0478 Connectix vendor KENSINGTON 0x047d Kensington vendor LUCENT 0x047e Lucent +vendor KYOCERA 0x0482 Kyocera Corp. vendor STMICRO 0x0483 STMicroelectronics vendor YAMAHA 0x0499 YAMAHA vendor COMPAQ 0x049f Compaq Computers @@ -857,6 +858,9 @@ product KYE NETSCROLL 0x0003 Genius NetScroll mouse product KYE FLIGHT2000 0x1004 Flight 2000 joystick product KYE VIVIDPRO 0x2001 ColorPage Vivid-Pro scanner +/* Kyocera products */ +product KYOCERA AHK3001V 0x0203 AH-K3001V + /* LaCie products */ product LACIE HD 0xa601 Hard Disk product LACIE CDRW 0xa602 CD R/W |