From owner-freebsd-hackers Fri May 7 16:20:16 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (Postfix) with ESMTP id 5A29515273 for ; Fri, 7 May 1999 16:20:10 -0700 (PDT) (envelope-from julian@whistle.com) Received: from current1.whistle.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.9.1a/8.9.1) with SMTP id QAA76520; Fri, 7 May 1999 16:15:10 -0700 (PDT) Date: Fri, 7 May 1999 16:15:07 -0700 (PDT) From: Julian Elischer Reply-To: Julian Elischer To: Doug Rabson Cc: hackers@FreeBSD.ORG Subject: Re: Slight suggested change to PCI config stuff. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 7 May 1999, Mike Smith wrote: > Sounds good. You'd do it totally differently in 4.x (use a "generic > match" priority driver for the catchall bridge code and a "device > match" priority for the chipset-aware drivers). and On Fri, 7 May 1999, Doug Rabson wrote: > > This makes sense for 3.x. Everything is different for 4.x though post > new-bus. The right thing in 4.x is to use priority ordered probes (which I > have working but haven't committed). If a driver matches the generic class > it would return a lower priority than a driver which matches the device > exactly. ok here is a patch for 3.x it's excedingly simple, and allows a specific driver to have precedence over the builtin generic entries.. I'd like to sneak this in asap if possible.. I think it can be proven to be benign. any seconders? julian Index: pci_compat.c =================================================================== RCS file: /home/ncvs/src/sys/pci/pci_compat.c,v retrieving revision 1.20 diff -c -r1.20 pci_compat.c *** pci_compat.c 1999/01/19 23:29:19 1.20 --- pci_compat.c 1999/05/07 23:07:18 *************** *** 384,392 **** --- 384,403 ---- lkm = lkm->next; } + /* + * it wasn't a loaded driver, look in the linked in ones + */ dvpp = (struct pci_device **)pcidevice_set.ls_items; while (drvname == NULL && (dvp = *dvpp++) != NULL) drvname = pci_probedrv(cfg, dvp); + + /* + * It wasn't one of the linked in drivers either, so try the defaults. + */ + if (drvname == NULL) { + dvp = &chipset_device; + drvname = pci_probedrv(cfg, dvp); + } return (dvp); } Index: pcisupport.c =================================================================== RCS file: /home/ncvs/src/sys/pci/pcisupport.c,v retrieving revision 1.86.2.4 diff -c -r1.86.2.4 pcisupport.c *** pcisupport.c 1999/05/07 04:06:38 1.86.2.4 --- pcisupport.c 1999/05/07 23:07:18 *************** *** 67,73 **** static void chipset_attach(pcici_t tag, int unit); static u_long chipset_count; ! static struct pci_device chipset_device = { "chip", chipset_probe, chipset_attach, --- 67,73 ---- static void chipset_attach(pcici_t tag, int unit); static u_long chipset_count; ! struct pci_device chipset_device = { "chip", chipset_probe, chipset_attach, *************** *** 75,81 **** NULL }; ! DATA_SET (pcidevice_set, chipset_device); struct condmsg { unsigned char port; --- 75,81 ---- NULL }; ! /*DATA_SET (pcidevice_set, chipset_device);*/ struct condmsg { unsigned char port; Index: pcivar.h =================================================================== RCS file: /home/ncvs/src/sys/pci/pcivar.h,v retrieving revision 1.25 diff -c -r1.25 pcivar.h *** pcivar.h 1999/01/19 23:29:20 1.25 --- pcivar.h 1999/05/07 23:07:18 *************** *** 165,170 **** --- 165,171 ---- struct pci_conf conf; }; + extern struct pci_device chipset_device; /* the default bridge handler */ extern u_int32_t pci_numdevs; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message