Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2008 00:47:14 -0400
From:      Mike Meyer <mwm@mired.org>
To:        freebsd-usb@FreeBSD.org
Subject:   Need a ugen instead of a umass....
Message-ID:  <20080528004714.09b6cb44@bhuda.mired.org>

next in thread | raw e-mail | index | archive | help
I have a problem with the way devices are assigned to interfaces in
FreeBSD (through -7, anyway). In usb_subr.c, usb_probe_and_attach
loops through the interfaces trying various drivers. When that's done,
if no drivers attached to any interfaces, it attaches a generic
interface to the device. This is probably fine for most devices, but
creates problems for modern multi-purpose printers (probably among
others).

In particular, the hplip port drives the hp multipurpose
printer/scanners, letting you print and scan from any of the. The
scanner has to have the ugen interface. Not a serious problem for some
of the printers, assuming you don't have any other ulpt devices - you
can just make sure you don't enable ulpt, and the hplip port will
drive the printer through ugen as well. But things could be better.

However, for some of the hp printers - the PhotoSmart line - come with
builtin card readers, and magic in the printer to print sheets of
thumbnails from the cards. Personally, I don't find it all that
useful - but it means the printer has a umass interface. So if I
disable ulpt, I *still* don't get a ugen device, because the printer
gets the umass device. Turning off USB disks is quite a bit more
inconvenient than turning off usb printers.

Ok, first question, but a long shot: is there some other way around
this? I.e. - can I get a da device out of a ugen that's actually a
umass without the umass driver?

Which leads to the real question: it looks like it shouldn't be hard
to change usb_probe_and_attach to either 1) allocate a ugen for every
interface, whether something else has it or not, or 2) allocate a ugen
for every interface that didn't have another driver attach to it. What
would break if I did #1 (multiple devices using the same interface
sounds like a recipe for trouble)? How about #2? That looks safe
enough - I'd have a ugen & umass where I now have a ulpt and a umass.
But maybe there's some deep reason that things behave the way they do,
and I really need to understand that before working on this?

    Thanks,
    <mike
-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



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