From owner-freebsd-current@FreeBSD.ORG Wed Apr 13 14:24:02 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E1331065673; Wed, 13 Apr 2011 14:24:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 445628FC12; Wed, 13 Apr 2011 14:24:00 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA18424; Wed, 13 Apr 2011 17:22:37 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DA5B1AD.5070703@FreeBSD.org> Date: Wed, 13 Apr 2011 17:22:37 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110309 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Nick Hibma References: <201104051321.56319.hselasky@freebsd.org> <4D9B1023.7020407@FreeBSD.org> <201104051455.33853.hselasky@freebsd.org> <4D9B473F.8020607@FreeBSD.org> <87909196-8EAB-4255-A1C7-6AAB22FA46E8@van-laarhoven.org> In-Reply-To: <87909196-8EAB-4255-A1C7-6AAB22FA46E8@van-laarhoven.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: =?windows-1252?Q?Current_Mailing_List=93?= , =?windows-1252?Q?=93FreeBSD_USB_Mailing_List=93?= , =?windows-1252?Q?=93FreeBSD_?=, Hans Petter Selasky Subject: Re: use_generic and usb probing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 14:24:02 -0000 on 13/04/2011 00:48 Nick Hibma said the following: >> 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. >> >> Practically speaking, you most likely don't have to worry about that for >> drivers that return BUS_PROBE_SPECIFIC (=0) 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. OK. Though I don't see how that is related to the question that I raised. > 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 am not sure that I understood this part. > I guess that documenting this kludge and updating the comment to state this > fact would be sufficient to solve the problem. I don't see how this follows from what you've written above. -- Andriy Gapon