From owner-freebsd-current@FreeBSD.ORG Sun Jun 26 05:40:04 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 95A47106564A for ; Sun, 26 Jun 2011 05:40:04 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.c2i.net [212.247.154.34]) by mx1.freebsd.org (Postfix) with ESMTP id 173E98FC16 for ; Sun, 26 Jun 2011 05:40:03 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=vrJF5kjXe35rRze0mxLgGFcjILUNrTxl1QHeo1urnh8= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=JCE9WutFZhIA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=8eF6gJYlM6NEsIY2xsQA:9 a=811Xaz8LuLWyf-R5y_kA:7 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe02.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 145312086; Sun, 26 Jun 2011 07:40:02 +0200 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Sun, 26 Jun 2011 07:38:21 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201106242342.47194.hselasky@c2i.net> <201106251907.02052.hselasky@c2i.net> In-Reply-To: <201106251907.02052.hselasky@c2i.net> 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: <201106260738.21847.hselasky@c2i.net> Cc: Jeremy Messenger , Robert Millan , Warner Losh Subject: Re: Automatic load of PCI kernel modules [WAS: [RFT] Automatic load of USB kernel modules] 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: Sun, 26 Jun 2011 05:40:04 -0000 On Saturday 25 June 2011 19:07:01 Hans Petter Selasky wrote: > On Saturday 25 June 2011 18:45:14 Warner Losh wrote: > > On Jun 25, 2011, at 9:42 AM, Hans Petter Selasky wrote: > > > On Saturday 25 June 2011 01:05:26 Jeremy Messenger wrote: > > >> Jeremy Messenger > > > > > > Done. > > > > > > http://svn.freebsd.org/changeset/base/223536 > > > > Please move it back. It doesn't belong in /etc/defaults. It belongs in > > /etc/devd if we're going to have it at all. If you have a full GENERIC > > kernel, there will never be a NOMATCH line generated, so these entries > > will just be ignored. > > > > Warner > > Done. > > http://svn.freebsd.org/changeset/base/223543 > Hi, I see that a lot of PCI device drivers use code to check their ID's. One simple way to dump all the PCI device ID's is to compile or load all modules and then make a dummy PCI device, which only calls device_probe on the full 32-bit space of the pci_get_devid(). This should take in matter of some minutes to produce a complete list of PCI ID's. Then add these ID's to all the respective drivers like a generic device ID table: struct pci_device_id { uint32_t device_id; uint32_t card_id; const char *description; unsigned long driver_info; } __aligned(32); Then export those automatically generated structures into the "pci_device_id" section and have tools/bus_autoconf generate the matching rules. PCI format structure for bus_autoconf: "pci_device_id{256,:}" "device_id[0]{" U32_XOR ",8}" "device_id[1]{" U32_XOR ",8}" "device_id[2]{" U32_XOR ",8}" "device_id[3]{" U32_XOR ",8}" "card_id[0]{" U32_XOR ",8}" "card_id[1]{" U32_XOR ",8}" "card_id[2]{" U32_XOR ",8}" "card_id[3]{" U32_XOR ",8}" --HPS