From owner-freebsd-current@FreeBSD.ORG Tue Apr 5 11:32:57 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 0504E1065670; Tue, 5 Apr 2011 11:32:57 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 244C78FC0C; Tue, 5 Apr 2011 11:32:55 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=6QwXiDozn7Gnsf2tGidwH+ndAwLlGixx7JAIKZICKmI= c=1 sm=1 a=IU0TiZmyZPMA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=Vf0mB7oONcDt1KCSLr0A:9 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 109799094; Tue, 05 Apr 2011 13:22:52 +0200 Received-SPF: softfail receiver=mailfe08.swip.net; client-ip=188.126.198.129; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Tue, 5 Apr 2011 13:21:56 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <4D985007.4080308@freebsd.org> <4D9AF7AE.9090004@FreeBSD.org> In-Reply-To: <4D9AF7AE.9090004@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104051321.56319.hselasky@freebsd.org> Cc: freebsd-usb@freebsd.org, Andriy Gapon 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: Tue, 05 Apr 2011 11:32:57 -0000 On Tuesday 05 April 2011 13:06:22 Andriy Gapon wrote: > on 03/04/2011 13:46 Andriy Gapon said the following: > > Mostly out of curiosity (but not only because of that) I wonder why the > > use_generic flag and two probing passes are needed in USB driver probing > > code. That is, why the standard approach of using different probing > > return values (e.g. BUS_PROBE_DEFAULT, BUS_PROBE_GENERIC, etc) wouldn't > > work here. > > I couldn't find any historic reason for this, so I am assuming that this is > a kludge to work-around inconsistent return values in various USB "newbus" > probe routines. > > Please see here my attempt at cleaning up the basics: > http://people.freebsd.org/~avg/usb-use_generic.diff > > Reviews and testing are welcome. > > P.S. > A side-effect of this patch is removal of a minor annoyance in a form of > the following message: > Unknown USB device: vendor <> product <> bus <> > The message is produced by devd almost any time anything is connected via > USB thanks to (1) a nomatch USB entry in the default devd.conf; (2) > use_generic=0 probing pass in USB. Hi, In the initial USB stack design drivers are supposed to either report match or non-match. The reason for this is that sometimes parameters are passed on from the probe to the attach via the USB attach args. See usbd_lookup_id_by_uaa(). When multiple drivers are probed and match, the information presented by the usb_attach_arg's can get messed up with regard to the attaching driver. It would be better if the newbus could support a probing priority argument! --HPS