From owner-freebsd-current@FreeBSD.ORG Sat Sep 22 09:50:03 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2241416A417 for ; Sat, 22 Sep 2007 09:50:03 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 91B7F13C474 for ; Sat, 22 Sep 2007 09:50:02 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id l8M9a8qp042886; Sat, 22 Sep 2007 11:36:08 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id l8M9ZxxJ089143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 22 Sep 2007 11:35:59 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id l8M9ZwXN035505; Sat, 22 Sep 2007 11:35:58 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id l8M9ZwJx035504; Sat, 22 Sep 2007 11:35:58 +0200 (CEST) (envelope-from ticso) Date: Sat, 22 Sep 2007 11:35:58 +0200 From: Bernd Walter To: Luigi Rizzo Message-ID: <20070922093557.GC32918@cicely12.cicely.de> References: <20070921103829.A43801@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070921103829.A43801@xorpc.icir.org> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, BAYES_00=-2.599 autolearn=ham version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on cicely12.cicely.de Cc: current@freebsd.org Subject: Re: Why USB must be so hard to use ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2007 09:50:03 -0000 On Fri, Sep 21, 2007 at 10:38:29AM -0700, Luigi Rizzo wrote: > i recently tried to attach one of the Openbeacon USB devices > > http://wiki.openbeacon.org/wiki/OpenBeacon_USB > > to a -stable box, and "of course" attach failed, even though the > same thing is claimed to work right away on Linux and XP without > any special driver. > > It wasn't too hard to convince umodem.c to attach to the device, > but i had to put the ids in the list of devices > explicitly recognised, and further disable the extra check for > capabilities at the end of umodem.c::USB_MATCH (or umodem_match in > -current). The device itself returns a class UICLASS_CDC, but > subclass and protocol are 0, i.e. this is a very basic serial device > as probably many gadget we are going to see in the future. Since it's using an Atmel ARM. I had to create the following umodem patch to get a pseudo serial port for accessing the sam-ba CDC for flashing the controller: Index: umodem.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/umodem.c,v retrieving revision 1.57 diff -u -r1.57 umodem.c --- umodem.c 31 Jan 2005 13:58:10 -0000 1.57 +++ umodem.c 20 Aug 2006 17:05:34 -0000 @@ -256,6 +260,15 @@ id->bInterfaceProtocol == UIPROTO_CDC_AT) ret = UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO; +#if 1 + if (ret == UMATCH_NONE && + id->bInterfaceClass == UICLASS_CDC_DATA && + id->bInterfaceSubClass == UISUBCLASS_DATA && + id->bInterfaceProtocol == 0x00) + ret = UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO; + return ret; +#endif + if (ret == UMATCH_NONE) return (ret); I was told that it just works under Linux and Windows has such a generic driver as well. But the sam-ba firmware in the AT91SAM7X256 wasn't able to build a tty under Mac OS X as well. We should really have a generic CDC tty driver, since it is used very often for simple USB projects. -- B.Walter http://www.bwct.de http://www.fizon.de bernd@bwct.de info@bwct.de support@fizon.de