From durian@boogie.com  Sat May 29 13:50:52 2004
Return-Path: <durian@boogie.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 22A7E16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 29 May 2004 13:50:52 -0700 (PDT)
Received: from fever.boogie.com (cpe-66-87-52-132.co.sprintbbd.net [66.87.52.132])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5635443D41
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 29 May 2004 13:50:51 -0700 (PDT)
	(envelope-from durian@boogie.com)
Received: from man.boogie.com (man.boogie.com [192.168.1.3])
	by fever.boogie.com (8.12.11/8.12.11) with ESMTP id i4TKoZwT071935
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 29 May 2004 14:50:35 -0600 (MDT)
	(envelope-from durian@fever.boogie.com)
Received: from man.boogie.com (localhost [127.0.0.1])
	by man.boogie.com (8.12.11/8.12.11) with ESMTP id i4TKoYSD001323
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 29 May 2004 14:50:34 -0600 (MDT)
	(envelope-from durian@man.boogie.com)
Received: (from durian@localhost)
	by man.boogie.com (8.12.11/8.12.11/Submit) id i4TKoY8G001322;
	Sat, 29 May 2004 14:50:34 -0600 (MDT)
	(envelope-from durian)
Message-Id: <200405292050.i4TKoY8G001322@man.boogie.com>
Date: Sat, 29 May 2004 14:50:34 -0600 (MDT)
From: Mike Durian <durian@shadetreesoftware.com>
Reply-To: Mike Durian <durian@shadetreesoftware.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Patch for uftdi to support Intrepidcs.com's vehicle bus interfaces
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         67357
>Category:       kern
>Synopsis:       Patch for uftdi to support Intrepidcs.com's vehicle bus interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    brooks
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 29 14:00:47 PDT 2004
>Closed-Date:    Sun Aug 21 00:53:21 GMT 2005
>Last-Modified:  Sun Aug 21 00:53:21 GMT 2005
>Originator:     Mike Durian
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD man.boogie.com 5.2-CURRENT FreeBSD 5.2-CURRENT #6: Thu May 27 16:56:56 MDT 2004 root@man.boogie.com:/disk2/obj/disk2/src/sys/BOOGIE i386


	
>Description:
	This patch adds support to the uftdi driver for Intrepid Control
	Systems' vehicle bus interfaces.  These interfaces use the
	FTDI chipset with different Vendor and Product IDs.

	I also addd two additional baud rate enumerations.  The vehicle
	bus interfaces use a baud rate of 2000000.  I also added 3000000
	since it is the other FTDI baud divisor special case.

	A better fix would be to calculate the divisors on the fly
	for any arbitrary baud rate (+ the two 2M and 3M special cases).
>How-To-Repeat:
	
>Fix:


	--- usbdevs.orig	Thu May 20 19:36:48 2004
	+++ usbdevs	Sat May 29 14:42:55 2004
	@@ -316,6 +316,7 @@
	 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
	@@ -793,6 +794,10 @@
	 
	 /* 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
	--- uftdi.c.orig	Wed Mar 17 18:02:46 2004
	+++ uftdi.c	Sat May 29 14:44:21 2004
	@@ -164,6 +164,15 @@
		     uaa->product == USB_PRODUCT_FTDI_LK204))
			return (UMATCH_VENDOR_PRODUCT);
	 
	+	/*
	+	 * The Intrepid Control Systems' ValueCAN and NeoVI vehicle
	+	 * bus interfaces use the FTDI interface.
	+	 */
	+	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);
	 }
	 
	@@ -223,6 +232,8 @@
		case USB_PRODUCT_FTDI_MX4_5:
		case USB_PRODUCT_FTDI_LK202:
		case USB_PRODUCT_FTDI_LK204:
	+	case USB_PRODUCT_INTREPIDCS_VALUECAN:
	+	case USB_PRODUCT_INTREPIDCS_NEOVI:
			sc->sc_type = UFTDI_TYPE_8U232AM;
			sc->sc_hdrlen = 0;
			break;
	@@ -499,6 +510,8 @@
			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);
			}
	--- uftdireg.h.orig	Sat May 29 09:55:02 2004
	+++ uftdireg.h	Sat May 29 09:56:20 2004
	@@ -104,7 +104,9 @@
		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 */
	 };
	 
	 /*

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: brooks 
State-Changed-When: Thu Jul 1 17:17:52 GMT 2004 
State-Changed-Why:  
Committed to current. 


Responsible-Changed-From-To: freebsd-bugs->brooks 
Responsible-Changed-By: brooks 
Responsible-Changed-When: Thu Jul 1 17:17:52 GMT 2004 
Responsible-Changed-Why:  
Take this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=67357 
State-Changed-From-To: patched->closed 
State-Changed-By: brooks 
State-Changed-When: Sun Aug 21 00:51:18 GMT 2005 
State-Changed-Why:  
This code is in RELENG_5 and onward.  Changes to uftdi(4) don't seem to 
be being merged to RELENG_4 these days so I'm going to close this 
PR.  If a merge is desired, a full sync with HEAD would be approprate. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=67357 
>Unformatted:
