Date: Tue, 12 Apr 2011 23:48:17 +0200 From: Nick Hibma <nick@van-laarhoven.org> To: Hans Petter Selasky <hselasky@c2i.net>, Andriy Gapon <avg@freebsd.org> Cc: =?windows-1252?Q?=93FreeBSD_Current_Mailing_List=93?= <freebsd-current@freebsd.org>, =?windows-1252?Q?=93FreeBSD_USB_Mailing_List=93?= <freebsd-usb@freebsd.org> Subject: Re: use_generic and usb probing Message-ID: <87909196-8EAB-4255-A1C7-6AAB22FA46E8@van-laarhoven.org> In-Reply-To: <4D9B473F.8020607@FreeBSD.org> References: <201104051321.56319.hselasky@freebsd.org> <4D9B1023.7020407@FreeBSD.org> <201104051455.33853.hselasky@freebsd.org> <4D9B473F.8020607@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> Well, I think that that's what probe priorities actually for. > I also think that typically ivars should be set by a bus driver. So = maybe it's > not such a good idea to pass data from probe to attach via ivars in = child drivers. > But I could be mistaken about that. >=20 > Practically speaking, you most likely don't have to worry about that = for drivers > that return BUS_PROBE_SPECIFIC (=3D0) from their probe methods. And = there is only a > few "generic" drivers that can be handled on a case by case basis. Newbus priorities where specifically implemented on my request by Doug = Rabson to cater for fallback attachments: usb.h (the old code) contained = a list of priorities. ugen had the lowest priority and attached if no = one else did. An example was a keyboard with a built-in mouse on one = interface. It would be attached by either mouse or keyboard but not = both. An additional driver could probide both devices. We ended up = implementing that differently though: attachment to interfaces instead = of devices. A probe should not pass any information to the attach phase if it can at = all avoid it. Or at least that is the assumption. If a driver needs info = in both phases, it needs to regenerate it again. The fact that usb_probe = is called again is a kludge, specifically for the description. I guess that documenting this kludge and updating the comment to state = this fact would be sufficient to solve the problem. Nick=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87909196-8EAB-4255-A1C7-6AAB22FA46E8>