Date: Fri, 7 May 1999 16:15:07 -0700 (PDT) From: Julian Elischer <julian@whistle.com> To: Doug Rabson <dfr@nlsystems.com> Cc: hackers@FreeBSD.ORG Subject: Re: Slight suggested change to PCI config stuff. Message-ID: <Pine.BSF.3.95.990507160746.14285H-100000@current1.whistle.com> In-Reply-To: <Pine.BSF.4.05.9905070938490.411-100000@herring.nlsystems.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.990507160746.14285H-100000>
