From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 8 08:06:39 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DDD7537B401 for ; Sun, 8 Jun 2003 08:06:39 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91F2243F75 for ; Sun, 8 Jun 2003 08:06:38 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h58F6SrN008712 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sun, 8 Jun 2003 17:06:35 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.9/8.12.9) with ESMTP id h58F6ROs002094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Jun 2003 17:06:27 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.9/8.12.9) with ESMTP id h58F6Q9F010436; Sun, 8 Jun 2003 17:06:26 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h58F6QXP010435; Sun, 8 Jun 2003 17:06:26 +0200 (CEST) Date: Sun, 8 Jun 2003 17:06:26 +0200 From: Bernd Walter To: Andrew Message-ID: <20030608150625.GO509@cicely12.cicely.de> References: <20030608235915.P49788-100000@starbug.ugh.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030608235915.P49788-100000@starbug.ugh.net.au> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-RELEASE alpha User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org Subject: Re: ugen example X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2003 15:06:40 -0000 On Mon, Jun 09, 2003 at 12:19:01AM +1000, Andrew wrote: > Hi, > > I'm just having a look at ugen, trying to see if I can get any action out > of a USB-serial converter that has no existing driver. This is my first > foray into the USB world so I apologise for any stupid questions...is > there a good tutorial somewhere? Not that I know. But there is lot of sample code available. usbdevs source is one of them. usbctl from ftp://ftp.augustsson.net/pub/netbsd/sysutils-0.5.tgz is another. And also ports/misc/ftdi-eeprom is simple code, which can use ugen as well as /dev/usb? to access the device. > To find my device I open /dev/ugen? and call ioctl(USB_GET_DEVICE_DESC). I > look at the returned idVendor and idProduct and check them against my hard > coded figures. From what I can see from usbdevs only the last 2 bytes are > significant? usbdevs produces 0x0743 for the vendor but I get 0x20743. You must be doing something wrong - the values are 16bit only. No chance to have anything larger. See usb_device_descriptor_t in usb.h. > When I work out what end point I need to talk to I thought opened > /dev/ugen?.? but I only have a /dev/ugen? device (I'm using -CURRENT and > devfs). I'm guessing I'm on the track here so I wouldn't mind a pointer to > an example or some documentation. If you have no /dev/ugen?.? then the device has no other endpoints in its current configuration. The usbctl tool mentioned above is good to check devices about their capabilities. http://www.cosmo-project.de/~bernd/usbutil.tgz is a port framework for it - it is not in great shape (naddy@ send me a big list of things to correct), but it works in vanilla configurations. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de