From owner-freebsd-usb@FreeBSD.ORG Wed Jul 9 21:42:37 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 60DAE106564A for ; Wed, 9 Jul 2008 21:42:37 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe16.swipnet.se [212.247.155.225]) by mx1.freebsd.org (Postfix) with ESMTP id E00F38FC12 for ; Wed, 9 Jul 2008 21:42:36 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=NMGBx6iLSXY/3qZKdJo9Bw==:17 a=ndaoGXS1AAAA:8 a=oKKEJyU0tOJWhkRzpRMA:9 a=ZpP04anheX9BmudRt1IA:7 a=X8AXrcYCX0aKbrPRhJfghKSkIMIA:4 a=50e4U0PicR4A:10 Received: from [62.113.135.207] (account mc467741@c2i.net [62.113.135.207] verified) by mailfe16.swip.net (CommuniGate Pro SMTP 5.2.4b) with ESMTPA id 261984398; Wed, 09 Jul 2008 23:42:34 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Wed, 9 Jul 2008 23:44:08 +0200 User-Agent: KMail/1.9.7 References: <20080709223926.142cbe5b@gmx.net> In-Reply-To: <20080709223926.142cbe5b@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807092344.09985.hselasky@c2i.net> Cc: Subject: Re: Quirks 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: Wed, 09 Jul 2008 21:42:37 -0000 Hi Tino, On Wednesday 09 July 2008, Tino Engel wrote: > Dear all, > > I had the chance to write my first Quirk-PR and therefore took some > time looking at the FreeBSD usb system. > I am thinking that the solution there is is not the ideal > one. Through mailing list discussions I read, I also have the > impression, that the usb part of the cam subsystem is kind of a problem > child. > I read through parts of the usb code and am kind of understanding it. > So I am trying to make an attempt to help improving it. That means, > that I would like to discuss some ideas and in case this is wanted, > volunteer to do some coding. > > What I was thinking so far is: > > Since Windows and Linux can handle most of the the devices FreeBSD needs > a quirk for out of the box, and at least in the case of linux, I believe > they do not hold all quirks in a db, there must be a way of doing it. > > My idea so far is to do something like this: > - When a usb device is connected, try to use it without quirks. > - If it stalls, cache device id data > - Then emulate a disconnect/connect Yes, this is possible. But unfortunately some devices are very crappy and even if you do a USB BUS reset, they will malfunction after the invalid command, simply because the USB software on the dongle has crashed :-) Or the endpoint state is not correct. > - Then try all permutations of possible quirks (most common to less > common?) for the device > - As soon as one permutation causes device not to stall -> done I assume that you are thinking about Mass Storage devices. You might be interested in looking at: http://www.selasky.org/hans_petter/isdn4bsd/sources/src/sys/dev/usb2/core/usb2_msctest.c > > Anyhow my knowledge concerning the topic is not too in-deep, but I would > be happy to gather some feedback concerning my idea and maybe about > other approaches in this area. How much time are you willing to spend on this ? --HPS