diff options
Diffstat (limited to 'sys/dev/usb/uftdi.c')
-rw-r--r-- | sys/dev/usb/uftdi.c | 434 |
1 files changed, 275 insertions, 159 deletions
diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c index 6dedd4bf3ed..53ac8deefef 100644 --- a/sys/dev/usb/uftdi.c +++ b/sys/dev/usb/uftdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uftdi.c,v 1.45 2008/02/22 12:42:40 jsg Exp $ */ +/* $OpenBSD: uftdi.c,v 1.46 2008/03/18 12:24:19 jsg Exp $ */ /* $NetBSD: uftdi.c,v 1.14 2003/02/23 04:20:07 simonb Exp $ */ /* @@ -141,75 +141,284 @@ const struct cfattach uftdi_ca = { uftdi_activate, }; +static const struct usb_devno uftdi_devs[] = { + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_232USB9M }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_485USB9F2W }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_485USB9F4W }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_USO9ML2 }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_USO9ML2DR }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_USO9ML2DR2 }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_USOPTL4 }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_USOPTL4DR }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_USOPTL4DR2 }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_USOTL4 }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_USPTL4 }, + { USB_VENDOR_BBELECTR, USB_PRODUCT_BBELECTR_USTL4 }, + { USB_VENDOR_EVOLUTION, USB_PRODUCT_EVOLUTION_ER1 }, + { USB_VENDOR_EVOLUTION, USB_PRODUCT_EVOLUTION_RCM4_1 }, + { USB_VENDOR_EVOLUTION, USB_PRODUCT_EVOLUTION_RCM4_2 }, + { USB_VENDOR_FALCOM, USB_PRODUCT_FALCOM_SAMBA }, + { USB_VENDOR_FALCOM, USB_PRODUCT_FALCOM_TWIST }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ACCESSO }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ACG_HFDUAL }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ACTROBOTS }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ACTZWAVE }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_AMC232 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ARTEMIS }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ASK_RDR4X7_1 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ASK_RDR4X7_2 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ASK_RDR4X7_3 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ASK_RDR4X7_4 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ASK_RDR4X7_5 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ASK_RDR4X7_6 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ASK_RDR4X7_7 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ASK_RDR4X7_8 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ATK16 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ATK16C }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ATK16HR }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ATK16HRC }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_CANUSB }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_CCS_ICDU20 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_CCS_ICDU40 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_CCS_MACHX }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_CHAMELEON }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_COASTAL_TNCX }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_DMX4ALL }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ECLO_1WIRE }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ECO_PRO }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_EISCOU }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ELV_ALC8500 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ELV_FHZ1000PC }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ELV_UM100 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ELV_UO100 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_ELV_UR100 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_FT232_1 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_FT232_3 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_FT232_4 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_FT232_5 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_FT232_6 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GAMMASCOUT }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_1 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_2 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_3 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_4 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_5 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_6 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_7 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_8 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_9 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_A }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_GUDE_B }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_IBS_1 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_IBS_APP70 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_IBS_PCMCIA }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_IBS_PEDO }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_IBS_PICPRO }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_IBS_PK1 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_IBS_RS232MON }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_IBS_US485 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_IPLUS }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_CFA_547 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_CFA_631 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_CFA_632 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_CFA_633 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_CFA_634 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_CFA_635 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_CFA_640 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_CFA_642 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_LK202_24 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_LK204_24 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_MX200 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LINX_1 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LINX_2 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LINX_3 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LINX_MASTER2 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LOCOBUFFER }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MATRIX_2 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MATRIX_3 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MHAM_DB9 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MHAM_IC }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MHAM_KW }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MHAM_RS232 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MHAM_Y6 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MHAM_Y8 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MHAM_Y9 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MHAM_YS }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MJS_SIRIUS_PC }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_OPENPORT_13M }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_OPENPORT_13S }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_OPENPORT_13U }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_PCDJ_DAC2 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_PYRAMID }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SEMC_DSS20 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_232BM }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_8U100AX }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_8U232AM }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_TERATRONIK_D2XX }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_TERATRONIK_VCP }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_THORLABS }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_TIRA1 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_TNCX }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_UOPTBR }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_USBSERIAL }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_USBUIRT }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_VNHC }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_WESTREX_777 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_WESTREX_8900F }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_XSENS_1 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_XSENS_2 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_XSENS_3 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_XSENS_4 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_XSENS_5 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_XSENS_6 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_XSENS_7 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_XSENS_8 }, + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_YEI_SC31 }, + { USB_VENDOR_ICOM, USB_PRODUCT_ICOM_ID1 }, + { USB_VENDOR_ICOM, USB_PRODUCT_ICOM_RP2000VR }, + { USB_VENDOR_ICOM, USB_PRODUCT_ICOM_RP2000VT }, + { USB_VENDOR_ICOM, USB_PRODUCT_ICOM_RP2C1 }, + { USB_VENDOR_ICOM, USB_PRODUCT_ICOM_RP2C2 }, + { USB_VENDOR_ICOM, USB_PRODUCT_ICOM_RP2D }, + { USB_VENDOR_ICOM, USB_PRODUCT_ICOM_RP2VR }, + { USB_VENDOR_ICOM, USB_PRODUCT_ICOM_RP2VT }, + { USB_VENDOR_ICOM, USB_PRODUCT_ICOM_RP4000VR }, + { USB_VENDOR_ICOM, USB_PRODUCT_ICOM_RP4000VT }, + { USB_VENDOR_IDTECH, USB_PRODUCT_IDTECH_SERIAL }, + { USB_VENDOR_INTERBIO, USB_PRODUCT_INTERBIO_IOBOARD }, + { USB_VENDOR_INTERBIO, USB_PRODUCT_INTERBIO_MINIIOBOARD }, + { USB_VENDOR_INTREPIDCS, USB_PRODUCT_INTREPIDCS_VALUECAN }, + { USB_VENDOR_INTREPIDCS, USB_PRODUCT_INTREPIDCS_NEOVI }, + { USB_VENDOR_IODATA, USB_PRODUCT_IODATA_FT232R }, + { USB_VENDOR_KOBIL, USB_PRODUCT_KOBIL_B1 }, + { USB_VENDOR_KOBIL, USB_PRODUCT_KOBIL_KAAN }, + { USB_VENDOR_MELCO, USB_PRODUCT_MELCO_PCOPRS1 }, + { USB_VENDOR_MOBILITY, USB_PRODUCT_MOBILITY_ED200H }, + { USB_VENDOR_OCT, USB_PRODUCT_OCT_US2308 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_AD4USB }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_AP485_1 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_AP485_2 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_DRAK5 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_DRAK6 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_GOLIATH_MSR }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_GOLIATH_MUX }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_IRAMP }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_LEC }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_MUC }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_QUIDO101 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_QUIDO216 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_QUIDO22 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_QUIDO303 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_QUIDO332 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_QUIDO44 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_QUIDO603 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_QUIDO88 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_SB232 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_SB422_1 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_SB422_2 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_SB485C }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_SB485S }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_SB485_1 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_SB485_2 }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_SERIAL }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_SIMUKEY }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_STAVOVY }, + { USB_VENDOR_PAPOUCH, USB_PRODUCT_PAPOUCH_TMU }, + { USB_VENDOR_POSIFLEX, USB_PRODUCT_POSIFLEX_PP7000_1 }, + { USB_VENDOR_POSIFLEX, USB_PRODUCT_POSIFLEX_PP7000_2 }, + { USB_VENDOR_RATOC, USB_PRODUCT_RATOC_REXUSB60F }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2101 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2102 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2103 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2104 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2106 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2201_1 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2201_2 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2202_1 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2202_2 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2203_1 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2203_2 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2401_1 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2401_2 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2401_3 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2401_4 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2402_1 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2402_2 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2402_3 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2402_4 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2403_1 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2403_2 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2403_3 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2403_4 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2801_1 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2801_2 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2801_3 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2801_4 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2801_5 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2801_6 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2801_7 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2801_8 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2802_1 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2802_2 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2802_3 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2802_4 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2802_5 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2802_6 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2802_7 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2802_8 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2803_1 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2803_2 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2803_3 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2803_4 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2803_5 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2803_6 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2803_7 }, + { USB_VENDOR_SEALEVEL, USB_PRODUCT_SEALEVEL_2803_8 }, + { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_174 }, + { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_175 }, + { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_330 }, + { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_435 }, + { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_556 }, + { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_580 }, + { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_845 }, + { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_SERIAL_1 }, + { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_SERIAL_2 }, + { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_SERVICE }, + { USB_VENDOR_THURLBY, USB_PRODUCT_THURLBY_QL355P }, + { 0, 0 } +}; + int uftdi_match(struct device *parent, void *match, void *aux) { struct usb_attach_arg *uaa = aux; + usbd_status err; + u_int8_t nifaces; - if (uaa->iface != NULL) { - if (uaa->vendor == USB_VENDOR_FTDI && - (uaa->product == USB_PRODUCT_FTDI_SERIAL_2232C)) - return (UMATCH_VENDOR_IFACESUBCLASS); + if (usb_lookup(uftdi_devs, uaa->vendor, uaa->product) == NULL) return (UMATCH_NONE); + + /* Get the number of interfaces. */ + if (uaa->iface != NULL) { + nifaces = uaa->nifaces; + } else { + err = usbd_set_config_index(uaa->device, UFTDI_CONFIG_INDEX, 1); + if (err) + return (UMATCH_NONE); + err = usbd_interface_count(uaa->device, &nifaces); + if (err) + return (UMATCH_NONE); + usbd_set_config_index(uaa->device, USB_UNCONFIG_INDEX, 1); } - DPRINTFN(20,("uftdi: vendor=0x%x, product=0x%x\n", - uaa->vendor, uaa->product)); - - if (uaa->vendor == USB_VENDOR_FTDI && - (uaa->product == USB_PRODUCT_FTDI_EISCOU || - uaa->product == USB_PRODUCT_FTDI_SERIAL_8U100AX || - uaa->product == USB_PRODUCT_FTDI_SERIAL_8U232AM || - uaa->product == USB_PRODUCT_FTDI_SERIAL_232BM || - uaa->product == USB_PRODUCT_FTDI_SEMC_DSS20 || - uaa->product == USB_PRODUCT_FTDI_MHAM_KW || - uaa->product == USB_PRODUCT_FTDI_MHAM_YS || - uaa->product == USB_PRODUCT_FTDI_MHAM_Y6 || - uaa->product == USB_PRODUCT_FTDI_MHAM_Y8 || - uaa->product == USB_PRODUCT_FTDI_MHAM_IC || - uaa->product == USB_PRODUCT_FTDI_MHAM_DB9 || - uaa->product == USB_PRODUCT_FTDI_MHAM_RS232 || - uaa->product == USB_PRODUCT_FTDI_MHAM_Y9 || - uaa->product == USB_PRODUCT_FTDI_COASTAL_TNCX || - uaa->product == USB_PRODUCT_FTDI_LCD_LK202_24 || - uaa->product == USB_PRODUCT_FTDI_LCD_LK204_24 || - uaa->product == USB_PRODUCT_FTDI_LCD_MX200 || - uaa->product == USB_PRODUCT_FTDI_LCD_CFA_631 || - uaa->product == USB_PRODUCT_FTDI_LCD_CFA_632 || - uaa->product == USB_PRODUCT_FTDI_LCD_CFA_633 || - uaa->product == USB_PRODUCT_FTDI_LCD_CFA_634 || - uaa->product == USB_PRODUCT_FTDI_LCD_CFA_635 || - uaa->product == USB_PRODUCT_FTDI_MJS_SIRIUS_PC || - uaa->product == USB_PRODUCT_FTDI_OPENPORT_13M || - uaa->product == USB_PRODUCT_FTDI_OPENPORT_13S || - uaa->product == USB_PRODUCT_FTDI_OPENPORT_13U || - uaa->product == USB_PRODUCT_FTDI_UOPTBR)) - return (UMATCH_VENDOR_PRODUCT); - if (uaa->vendor == USB_VENDOR_IODATA && - uaa->product == USB_PRODUCT_IODATA_FT232R) - return (UMATCH_VENDOR_PRODUCT); - if (uaa->vendor == USB_VENDOR_SIIG2 && - (uaa->product == USB_PRODUCT_SIIG2_US2308)) - return (UMATCH_VENDOR_PRODUCT); - if (uaa->vendor == USB_VENDOR_INTREPIDCS && - (uaa->product == USB_PRODUCT_INTREPIDCS_VALUECAN || - uaa->product == USB_PRODUCT_INTREPIDCS_NEOVI)) - return (UMATCH_VENDOR_PRODUCT); - if (uaa->vendor == USB_VENDOR_BBELECTRONICS && - (uaa->product == USB_PRODUCT_BBELECTRONICS_USOTL4)) - return (UMATCH_VENDOR_PRODUCT); - if (uaa->vendor == USB_VENDOR_FALCOM && - (uaa->product == USB_PRODUCT_FALCOM_TWIST || - uaa->product == USB_PRODUCT_FALCOM_SAMBA)) - return (UMATCH_VENDOR_PRODUCT); - if (uaa->vendor == USB_VENDOR_RATOC && - (uaa->product == USB_PRODUCT_RATOC_REXUSB60F)) - return (UMATCH_VENDOR_PRODUCT); - if (uaa->vendor == USB_VENDOR_SEALEVEL && - uaa->product == USB_PRODUCT_SEALEVEL_USBSERIAL) + if (nifaces <= 1) return (UMATCH_VENDOR_PRODUCT); - return (UMATCH_NONE); + /* Dual UART chip */ + if (uaa->iface != NULL) + return (UMATCH_VENDOR_IFACESUBCLASS); + else + return (UMATCH_NONE); } void @@ -251,106 +460,13 @@ uftdi_attach(struct device *parent, struct device *self, void *aux) sc->sc_udev = dev; sc->sc_iface = iface; - switch (uaa->vendor) { - case USB_VENDOR_FTDI: - switch (uaa->product) { - case USB_PRODUCT_FTDI_SERIAL_8U100AX: - sc->sc_type = UFTDI_TYPE_SIO; - sc->sc_hdrlen = 1; - break; - - case USB_PRODUCT_FTDI_SEMC_DSS20: - case USB_PRODUCT_FTDI_SERIAL_8U232AM: - case USB_PRODUCT_FTDI_SERIAL_2232C: - case USB_PRODUCT_FTDI_SERIAL_232BM: - case USB_PRODUCT_FTDI_COASTAL_TNCX: - case USB_PRODUCT_FTDI_LCD_LK202_24: - case USB_PRODUCT_FTDI_LCD_LK204_24: - case USB_PRODUCT_FTDI_LCD_MX200: - case USB_PRODUCT_FTDI_LCD_CFA_631: - case USB_PRODUCT_FTDI_LCD_CFA_632: - case USB_PRODUCT_FTDI_LCD_CFA_633: - case USB_PRODUCT_FTDI_LCD_CFA_634: - case USB_PRODUCT_FTDI_LCD_CFA_635: - case USB_PRODUCT_FTDI_MHAM_KW: - case USB_PRODUCT_FTDI_MHAM_YS: - case USB_PRODUCT_FTDI_MHAM_Y6: - case USB_PRODUCT_FTDI_MHAM_Y8: - case USB_PRODUCT_FTDI_MHAM_IC: - case USB_PRODUCT_FTDI_MHAM_DB9: - case USB_PRODUCT_FTDI_MHAM_RS232: - case USB_PRODUCT_FTDI_MHAM_Y9: - case USB_PRODUCT_SEALEVEL_USBSERIAL: - case USB_PRODUCT_FTDI_MJS_SIRIUS_PC: - sc->sc_type = UFTDI_TYPE_8U232AM; - sc->sc_hdrlen = 0; - break; - - default: /* Can't happen */ - goto bad; - } - break; - - case USB_VENDOR_INTREPIDCS: - switch (uaa->product) { - case USB_PRODUCT_INTREPIDCS_VALUECAN: - case USB_PRODUCT_INTREPIDCS_NEOVI: + if (uaa->release < 0x0200) { + sc->sc_type = UFTDI_TYPE_SIO; + sc->sc_hdrlen = 1; + } else { sc->sc_type = UFTDI_TYPE_8U232AM; - sc->sc_hdrlen = 0; - break; - - default: /* Can't happen */ - goto bad; - } - break; - - case USB_VENDOR_IODATA: - switch (uaa->product) { - case USB_PRODUCT_IODATA_FT232R: - sc->sc_type = UFTDI_TYPE_8U232AM; - sc->sc_hdrlen = 0; - break; - default: - goto bad; - } - break; - - case USB_VENDOR_SIIG2: - switch (uaa->product) { - case USB_PRODUCT_SIIG2_US2308: - sc->sc_type = UFTDI_TYPE_8U232AM; - sc->sc_hdrlen = 0; - break; - - default: /* Can't happen */ - goto bad; - } - break; - - case USB_VENDOR_BBELECTRONICS: - switch( uaa->product ){ - case USB_PRODUCT_BBELECTRONICS_USOTL4: - sc->sc_type = UFTDI_TYPE_8U232AM; - sc->sc_hdrlen = 0; - break; - default: /* Can't happen */ - goto bad; - } - break; - - case USB_VENDOR_FALCOM: - switch( uaa->product ){ - case USB_PRODUCT_FALCOM_TWIST: - case USB_PRODUCT_FALCOM_SAMBA: - sc->sc_type = UFTDI_TYPE_8U232AM; - sc->sc_hdrlen = 0; - break; - default: /* Can't happen */ - goto bad; - } - break; - } - + sc->sc_hdrlen = 0; + } uca.bulkin = uca.bulkout = -1; for (i = 0; i < id->bNumEndpoints; i++) { |