From owner-freebsd-arch@FreeBSD.ORG Mon Dec 19 18:43:56 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 BF8C2106568D for ; Mon, 19 Dec 2011 18:43:56 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1F78FC0C for ; Mon, 19 Dec 2011 18:43:56 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pBJIZr2S050349 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 19 Dec 2011 11:35:54 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20111219181410.GA13742@onelab2.iet.unipi.it> Date: Mon, 19 Dec 2011 11:35:47 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <19FB5614-B70A-4FDB-A7ED-73A7B5C5970C@bsdimp.com> References: <20111219181410.GA13742@onelab2.iet.unipi.it> To: Luigi Rizzo X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Mon, 19 Dec 2011 11:35:55 -0700 (MST) 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:43:56 -0000 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. It is the biggest stumbling block to allowing automated driver loading = today. Warner