Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci allow pci_bus_maxdevs() to be replaced with pci_...
details: https://anonhg.NetBSD.org/src/rev/efe8005d7888
branches: trunk
changeset: 504424:efe8005d7888
user: mrg <mrg%NetBSD.org@localhost>
date: Fri Mar 02 06:24:17 2001 +0000
description:
allow pci_bus_maxdevs() to be replaced with pci_bus_devorder() and
pci_dev_funcorder() that have the following signatures:
int pci_bus_devorder(pci_chipset_tag_t pc, int bus, char list[32]);
int pci_dev_funcorder(pci_chipset_tag_t pc, int bus, int device, char list[8]);
they control the order of PCI bus probe at the device and function level,
by filling in a value from 0 to 31 for pci_bus_devorder() or 0 to 7 for
pci_dev_funcorder, with a value of -1 to signify no more entries.
when device properties arrive, these will be replaced with some facility
based on properties (design/implementation unknown currently.)
diffstat:
sys/dev/pci/pci.c | 35 +++++++++++++++++++++++++++++------
1 files changed, 29 insertions(+), 6 deletions(-)
diffs (68 lines):
diff -r 775cdb814c86 -r efe8005d7888 sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c Fri Mar 02 06:06:08 2001 +0000
+++ b/sys/dev/pci/pci.c Fri Mar 02 06:24:17 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci.c,v 1.50 2001/02/12 09:14:53 mrg Exp $ */
+/* $NetBSD: pci.c,v 1.51 2001/03/02 06:24:17 mrg Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998
@@ -126,6 +126,10 @@
return 1;
}
+/* XXX
+ * The __PCI_BUS_DEVORDER/__PCI_DEV_FUNCORDER macros should go away
+ * and be implemented with device properties when they arrive.
+ */
void
pci_probe_bus(self)
struct device *self;
@@ -134,15 +138,27 @@
bus_space_tag_t iot, memt;
pci_chipset_tag_t pc;
const struct pci_quirkdata *qd;
- int bus, device, maxndevs, function, nfunctions;
+ int bus, device, function, nfunctions;
+#ifdef __PCI_BUS_DEVORDER
+ char devs[32];
+ int i;
+#endif
+#ifdef __PCI_DEV_FUNCORDER
+ char funcs[8];
+ int j;
+#endif
iot = sc->sc_iot;
memt = sc->sc_memt;
pc = sc->sc_pc;
bus = sc->sc_bus;
- maxndevs = sc->sc_maxndevs;
-
- for (device = 0; device < maxndevs; device++) {
+#ifdef __PCI_BUS_DEVORDER
+ pci_bus_devorder(sc->sc_pc, sc->sc_bus, devs);
+ for (i = 0; (device = devs[i]) < 32 && device >= 0; i++)
+#else
+ for (device = 0; device < sc->sc_maxndevs; device++)
+#endif
+ {
pcitag_t tag;
pcireg_t id, class, intr, bhlcr, csr;
struct pci_attach_args pa;
@@ -168,7 +184,14 @@
else
nfunctions = 1;
- for (function = 0; function < nfunctions; function++) {
+#ifdef __PCI_DEV_FUNCORDER
+ pci_dev_funcorder(sc->sc_pc, sc->sc_bus, device, funcs);
+ for (j = 0; (function = funcs[j]) < nfunctions &&
+ function >= 0; j++)
+#else
+ for (function = 0; function < nfunctions; function++)
+#endif
+ {
tag = pci_make_tag(pc, bus, device, function);
id = pci_conf_read(pc, tag, PCI_ID_REG);
csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
Home |
Main Index |
Thread Index |
Old Index