From owner-freebsd-arch@FreeBSD.ORG Mon Dec 19 18:48:58 2011 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 765EB106564A for ; Mon, 19 Dec 2011 18:48:58 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 3B37D8FC08 for ; Mon, 19 Dec 2011 18:48:57 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 67A107300A; Mon, 19 Dec 2011 20:05:24 +0100 (CET) Date: Mon, 19 Dec 2011 20:05:24 +0100 From: Luigi Rizzo To: Warner Losh Message-ID: <20111219190524.GA14261@onelab2.iet.unipi.it> References: <20111219181410.GA13742@onelab2.iet.unipi.it> <19FB5614-B70A-4FDB-A7ED-73A7B5C5970C@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19FB5614-B70A-4FDB-A7ED-73A7B5C5970C@bsdimp.com> User-Agent: Mutt/1.4.2.3i Cc: arch@FreeBSD.org Subject: Re: generic pci device_probe routine ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2011 18:48:58 -0000 On Mon, Dec 19, 2011 at 11:35:47AM -0700, Warner Losh wrote: > > On Dec 19, 2011, at 11:14 AM, Luigi Rizzo wrote: > > haven't done device drivers for a while, but i just noticed that > > pretty much all PCI drivers have their own replica of the *_probe code > > which does the same exact thing -- define an array of vendor,product > > entries, and lookup the entry in the array. > > Would it make sense (or, do we have already) to have common struct > > and routine, similar to what we have in usb_lookup.c ? > > It would make sense. Model it after the PC Card one, however, since that one also include the size of the elements to allow for piggybacking data for the driver in the table. yes, i was thinking of that too. cheers luigi > It is the biggest stumbling block to allowing automated driver loading today. > > Warner >