Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 05 Aug 2004 11:04:43 -0400
From:      Chris <chris@tellme3times.com>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: USB drivers
Message-ID:  <41124C8B.2060902@tellme3times.com>
In-Reply-To: <20040804.212242.112819552.imp@bsdimp.com>
References:  <4110F5AE.6030403@tellme3times.com> <20040804.212242.112819552.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
M. Warner Losh wrote:

>
>You misunerstand what's actually happening.  There's no case in the
>tree where two drivers are attached, at the same time, to the same
>device node.  There's only one set of pointers.  However, with USB,
>there can be reasons why multiple things can attach to the same
>driver.  The usb code tries to do smart things for devices that have
>multiple configurations.
>
>With USB and multi-function devices, here's the code that we use:
>
>	/* First try with device specific drivers. */
>	probe and attach driver with a config # of -1 (usegeneric = 0)
>		return if successful
>	/* Next try with interface drivers. */
>	foreach valid configuration
>		foreach interface
>			probe and attach driver
>	/* Finally try the generic driver. */
>	probe and attach driver with a config # of -1 (usegeneric = 1)
>		return if successful
>
>I'm not familiar with the specific instance of ulpt and unlpt.
>  
>


You are right I do not understand. All I know is that when the system 
boots, at some point a test is done to see if their are USB devices. If 
devices exist then attach drivers.

What I am trying to determine is why my multifunction printer/scanner 
receives only one of the two  drivers. Is it because the printer does 
not respond properly? Is it because the printer is not defined? I have 
many questions here.

I looked in the following and just see the code for that specific 
device. It does not test for multifunction devices. I do not see any 
code that follows the logic above.

src/sys/dev/usb/ulpt.c
src/sys/dev/usb/uscanner.c
src/sys/dev/usb/usbdevs

If you can point me in the right direction, or to some documents on USB 
driver writing I will try to figure this out. Any help would be 
appreciated. I will get this to work because I need both and the effort 
required to switch is just not convenient.

Chris




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