From owner-freebsd-usb@FreeBSD.ORG Tue Feb 12 00:25:11 2008 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 9C65F16A417 for ; Tue, 12 Feb 2008 00:25:11 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from cp65.agava.net (cp65.agava.net [89.108.66.215]) by mx1.freebsd.org (Postfix) with ESMTP id 51F1913C467 for ; Tue, 12 Feb 2008 00:25:11 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from [213.148.20.85] (helo=hive.panopticon) by cp65.agava.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1JOiaA-000Gfr-Iv for freebsd-usb@freebsd.org; Tue, 12 Feb 2008 03:01:06 +0300 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 1E5208412 for ; Tue, 12 Feb 2008 02:59:04 +0300 (MSK) Received: by hades.panopticon (Postfix, from userid 1000) id CD91617023; Tue, 12 Feb 2008 02:58:32 +0300 (MSK) Date: Tue, 12 Feb 2008 02:58:32 +0300 From: Dmitry Marakasov To: freebsd-usb@freebsd.org Message-ID: <20080211235832.GA1054@hades.panopticon> Mail-Followup-To: freebsd-usb@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cp65.agava.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [26 6] X-AntiAbuse: Sender Address Domain - amdmi3.ru X-Source: X-Source-Args: X-Source-Dir: Subject: Need docs on USB driver development 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: Tue, 12 Feb 2008 00:25:11 -0000 Hi! I want to write driver for "AVerMedia Technologies" "AVerMedia USB Radio" FM tuner. Though it's HID device, I was not able to make it work through neither uhid nor ugen drivers (though I'm gonna do some more digging here). So I've decided to go level lower and write kernel driver for the device (for fun & new knowledge as well). I've taken ufm driver as a basis and now I have a driver that successfully attaches to a device, creates device node and reports some info, but I'm a but stuch with actually communicating with device. Neither arch handbook, nor developers handbook, usbd_* manpage and usb headers have any verbose information. Thus, I would be grateful for documentation on FreeBSD USB driver development. If you're curious, my current work is based on http://av-usbradio.sourceforge.net/index.php?show=reverse. Currently I try to send that 16 initialize bytes into the device. I set up pipe via usbd_open_pipe, then xfer via usbd_alloc_xfer and try to do usbd_bulk_transfer, but it fails with USBD_IOERROR and sometimes I end with my system unresponsible to keystrokes (though I can switch between consoles). Also advices regarding driver testing environemnt would be useful (fsck takes too much time). I can think of qemu which AFAIR supports USB devices and booting from NFS partition. -- Dmitry A. Marakasov | jabber: amdmi3@jabber.ru amdmi3@amdmi3.ru | http://www.amdmi3.ru