Date: Sun, 8 Jun 2003 17:06:26 +0200 From: Bernd Walter <ticso@cicely12.cicely.de> To: Andrew <andrew@ugh.net.au> Cc: freebsd-hackers@freebsd.org Subject: Re: ugen example Message-ID: <20030608150625.GO509@cicely12.cicely.de> In-Reply-To: <20030608235915.P49788-100000@starbug.ugh.net.au> References: <20030608235915.P49788-100000@starbug.ugh.net.au>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030608150625.GO509>