add support Kyocera AH-K3001V (cellular phone in Japan)

PR:		kern/66779
Submitted by:	Togawa Satoshi <toga@puyo.org>
MFC after:	1 week
This commit is contained in:
sanpei 2004-05-21 01:36:48 +00:00
parent ec00ca1e58
commit fdc6b1b921
2 changed files with 36 additions and 6 deletions

View File

@ -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)

View File

@ -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