From owner-freebsd-usb@FreeBSD.ORG Thu Aug 26 20:36:47 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B85361065674 for ; Thu, 26 Aug 2010 20:36:47 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.swip.net [212.247.154.193]) by mx1.freebsd.org (Postfix) with ESMTP id 443AB8FC08 for ; Thu, 26 Aug 2010 20:36:46 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=8nVFKzxAJNCZJh2yHDOpnep+nZeeqVU+af0AVP5CZ7Y= c=1 sm=1 a=bKZ37gBxqdwA:10 a=8nJEP1OIZ-IA:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=FP58Ms26AAAA:8 a=idV22jiUtjJveb3O9lUA:9 a=6XSKo1a1u0EYPNAsFGI2pu5Mk_0A:4 a=wPNLvfGTeEIA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:117 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 11353471; Thu, 26 Aug 2010 22:36:40 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Thu, 26 Aug 2010 22:32:44 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: <4C76AB76.4070806@gmail.com> In-Reply-To: <4C76AB76.4070806@gmail.com> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008262232.44775.hselasky@c2i.net> Cc: Subject: Re: writing usb drivers under 8.x X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 20:36:47 -0000 On Thursday 26 August 2010 19:59:18 Jim Bryant wrote: > i have some usb devices, in the hid class, that i am wanting to write > some drivers for. > > seeing that one of these previously had an older non-submitted driver > for 5.x-7.x online, i thought that might be a good starting point (the > imon vfd/lirc driver), but that does not work, due to the changes in the > usb subsystem. > > where can i find documentation on this subsystem? > > are there any decent skeletons to start with, or does this need to be > from scratch? > > i'd like to start with a driver for the pcsensor temper usb thermometer, > for which i already wrote a libusb util for, since these are widely > sold, and very popular (and usually around $5 USD), and since it only > has one transaction (read current temp), I figure it would be easier to > start with while I learn the usb driver framework. > > as for the imon vfd unit, i'd like to tackle that next. i have written > libusb utilities for all of the display functions supported, and have > documented the knob/button interrupt packets (only three packet types, > clockwise, counterclockwise, and button down). all of the remote > control functions are well-documented in lirc. > > i've been looking through the sources in the sys tree, but would like to > find some comprehensive documentation of the new usb subsystem, and > maybe someone who can give me pointers as i go. > > jim Hi, Feel free to post patches here. Some choices you have: Use libusb v1.0 or v0.1 if you need portability. Else use libusb v2.0. All three versions are contained in -lusb on FreeBSD 8+. Sylvestre Gallon had some libusb examples in his USB P4 repositorium. Else if you have questions regarding libusb you can ask either here or at: libusb-devel@lists.sourceforge.net --HPS