From c9e7c6f4fb06ac079ba9e5b450b5d93c7f2304e5 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Thu, 1 Jul 2004 17:16:20 +0000 Subject: [PATCH] Add support to the uftdi driver for Intrepid Control Systems' vehicle bus interfaces. These interfaces use the FTDI chipset with different Vendor and Product IDs. Add two additional baud rate enumerations. The vehicle bus interfaces use a baud rate of 2000000. Also add 3000000 as it is the other FTDI baud divisor special case. I've commited a slightly different patch from that provided in the PR as I changed the matching code a bit yesterday. Submitted by: Mike Durian PR: kern/67357 --- sys/dev/usb/uftdi.c | 19 +++++++++++++++++++ sys/dev/usb/uftdireg.h | 4 +++- sys/dev/usb/usbdevs | 5 +++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c index 8a511a6a53c..e015f844ef9 100644 --- a/sys/dev/usb/uftdi.c +++ b/sys/dev/usb/uftdi.c @@ -168,6 +168,10 @@ USB_MATCH(uftdi) 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); return (UMATCH_NONE); } @@ -240,6 +244,19 @@ USB_ATTACH(uftdi) } break; + case USB_VENDOR_INTREPIDCS: + switch( uaa->product ){ + case USB_PRODUCT_INTREPIDCS_VALUECAN: + case USB_PRODUCT_INTREPIDCS_NEOVI: + sc->sc_type = UFTDI_TYPE_8U232AM; + sc->sc_hdrlen = 0; + break; + + default: /* Can't happen */ + goto bad; + } + break; + case USB_VENDOR_SIIG2: switch( uaa->product ){ case USB_PRODUCT_SIIG2_US2308: @@ -524,6 +541,8 @@ uftdi_param(void *vsc, int portno, struct termios *t) case 230400: rate = ftdi_8u232am_b230400; break; case 460800: rate = ftdi_8u232am_b460800; break; case 921600: rate = ftdi_8u232am_b921600; break; + case 2000000: rate = ftdi_8u232am_b2000000; break; + case 3000000: rate = ftdi_8u232am_b3000000; break; default: return (EINVAL); } diff --git a/sys/dev/usb/uftdireg.h b/sys/dev/usb/uftdireg.h index 15d47f9ef63..a7c6edcb600 100644 --- a/sys/dev/usb/uftdireg.h +++ b/sys/dev/usb/uftdireg.h @@ -104,7 +104,9 @@ enum { ftdi_8u232am_b115200 = 0x001a, ftdi_8u232am_b230400 = 0x000d, ftdi_8u232am_b460800 = 0x4006, - ftdi_8u232am_b921600 = 0x8003 + ftdi_8u232am_b921600 = 0x8003, + ftdi_8u232am_b2000000 = 0x0001, /* special case for 2M baud */ + ftdi_8u232am_b3000000 = 0x0000, /* special case for 3M baud */ }; /* diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 9b5ee2b0212..f1415cd32ab 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -316,6 +316,7 @@ vendor GOHUBS 0x0921 GoHubs vendor BIOMETRIC 0x0929 American Biometric Company vendor TOSHIBA 0x0930 Toshiba Corporation vendor PLEXTOR 0x093b Plextor Corp. +vendor INTREPIDCS 0x093c Intrepid Control Systems vendor YANO 0x094f Yano vendor KINGSTON 0x0951 Kingston Technology vendor BLUEWATER 0x0956 BlueWater Systems @@ -803,6 +804,10 @@ product INTEL TESTBOARD 0x9890 82930 test board /* Intersil products */ product INTERSIL PRISM_2X 0x3642 Prism2.x or Atmel WLAN +/* Interpid Control Systems products */ +product INTREPIDCS VALUECAN 0x0601 ValueCAN CAN bus interface +product INTREPIDCS NEOVI 0x0701 NeoVI Blue vehicle bus interface + /* I/O DATA products */ product IODATA USBETT 0x0901 USB ETT product IODATA USBETTX 0x0904 USB ETTX