From owner-freebsd-usb@FreeBSD.ORG Tue Apr 12 22:00:24 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCE8D1065672; Tue, 12 Apr 2011 22:00:24 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from cpsmtpb-ews10.kpnxchange.com (cpsmtpb-ews10.kpnxchange.com [213.75.39.15]) by mx1.freebsd.org (Postfix) with ESMTP id 6674A8FC1B; Tue, 12 Apr 2011 22:00:24 +0000 (UTC) Received: from cpbrm-ews21.kpnxchange.com ([10.94.84.152]) by cpsmtpb-ews10.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 12 Apr 2011 23:48:19 +0200 Received: from CPSMTPM-CMT101.kpnxchange.com ([195.121.3.17]) by cpbrm-ews21.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 12 Apr 2011 23:48:19 +0200 Received: from uitsmijter.van-laarhoven.org ([81.207.207.222]) by CPSMTPM-CMT101.kpnxchange.com with Microsoft SMTPSVC(7.0.6002.18264); Tue, 12 Apr 2011 23:48:18 +0200 Received: from hillary.lan (unknown [81.207.207.222]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by uitsmijter.van-laarhoven.org (Postfix) with ESMTPSA id 8723E40E2; Tue, 12 Apr 2011 23:48:18 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Nick Hibma In-Reply-To: <4D9B473F.8020607@FreeBSD.org> Date: Tue, 12 Apr 2011 23:48:17 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <87909196-8EAB-4255-A1C7-6AAB22FA46E8@van-laarhoven.org> References: <201104051321.56319.hselasky@freebsd.org> <4D9B1023.7020407@FreeBSD.org> <201104051455.33853.hselasky@freebsd.org> <4D9B473F.8020607@FreeBSD.org> To: Hans Petter Selasky , Andriy Gapon X-Mailer: Apple Mail (2.1084) X-OriginalArrivalTime: 12 Apr 2011 21:48:18.0852 (UTC) FILETIME=[55E3BE40:01CBF95B] X-RcptDomain: freebsd.org Cc: =?windows-1252?Q?=93FreeBSD_Current_Mailing_List=93?= , =?windows-1252?Q?=93FreeBSD_USB_Mailing_List=93?= Subject: Re: use_generic and usb probing X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2011 22:00:25 -0000 > 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=