Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jul 2008 23:44:08 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org
Subject:   Re: Quirks
Message-ID:  <200807092344.09985.hselasky@c2i.net>
In-Reply-To: <20080709223926.142cbe5b@gmx.net>
References:  <20080709223926.142cbe5b@gmx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807092344.09985.hselasky>