Date: Wed, 04 Aug 2004 21:22:42 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: chris@tellme3times.com Cc: freebsd-current@freebsd.org Subject: Re: USB drivers Message-ID: <20040804.212242.112819552.imp@bsdimp.com> In-Reply-To: <4110F5AE.6030403@tellme3times.com> References: <4110F5AE.6030403@tellme3times.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <4110F5AE.6030403@tellme3times.com> Chris <chris@tellme3times.com> writes: : First I would like to know if there is a technical reason why two : different divers cannot attach to the same device. If each driver works : well independently, what is the reason to prevent the second one from : attaching? I would assume that if you attempted to use both drivers at : the same time you would get a device busy error. Because there's only one pointer. : Am I misunderstanding something here? I see ulpt: and unlpt: attaching : to the same device and the choice of which one to use is up to the user : and the hardware they have. If we have two drivers attach in one case : why, and where, do we prevent other drivers from attaching if they meet : the minimum requirements? 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. > What I am looking to accomplish is to attach uscanner and ulpt to an > EPSON CX5400. While each driver works great by itself I am unable to > attach both at the same time. I was told on this list that we may not > attach two drivers to the same device. If this is not correct then I > would appreciate a little help in attaching existing drivers or writing > a new one. You might want to look at the above probing order to see if there might be multiple configurations that the EPSON implements. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040804.212242.112819552.imp>