summaryrefslogtreecommitdiff
path: root/sys/arch/sgi/xbow
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-10-10 19:42:38 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-10-10 19:42:38 +0000
commit3cc4d3c11a835610eaf5ce6c13389352149848c1 (patch)
treeb6ff787b8bae84fe3b0c21b7f0378c2d7459fad8 /sys/arch/sgi/xbow
parentf01ca6aed7de84c5098370e7359ed9043e29b16c (diff)
Introduce pci_probe_device_hook(pci_chipset_tag_t, struct pci_attach_args *).
This mandatory function will get invoked in pci_probe_device(), and allows a pci host driver to alter the pci_attach_args passed to a device when attaching. This function will also, if returning non-zero, cause the device to be skipped completely during all the phases of the PCI device discovery (i.e. ressource enumeration, ressource assignment, and actual attachment). This particular feature is experimental and might be reverted in the future (or the scope narrowed to device attachment only). A dummy #define pci_probe_device_hook() 0 is added to all platforms except sgi, where real functions (currently only returning 0) are added; real meat will be added shortly. Discussed at s2k11, no objection from the usual suspects.
Diffstat (limited to 'sys/arch/sgi/xbow')
-rw-r--r--sys/arch/sgi/xbow/xbridge.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/arch/sgi/xbow/xbridge.c b/sys/arch/sgi/xbow/xbridge.c
index c7192ef6df6..e072c40e29e 100644
--- a/sys/arch/sgi/xbow/xbridge.c
+++ b/sys/arch/sgi/xbow/xbridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xbridge.c,v 1.82 2011/04/17 17:44:24 miod Exp $ */
+/* $OpenBSD: xbridge.c,v 1.83 2011/10/10 19:42:36 miod Exp $ */
/*
* Copyright (c) 2008, 2009, 2011 Miodrag Vallat.
@@ -205,6 +205,7 @@ void xbridge_intr_disestablish(void *, void *);
int xbridge_intr_line(void *, pci_intr_handle_t);
int xbridge_ppb_setup(void *, pcitag_t, bus_addr_t *, bus_addr_t *,
bus_addr_t *, bus_addr_t *);
+int xbridge_probe_device_hook(void *, struct pci_attach_args *);
void *xbridge_rbus_parent_io(struct pci_attach_args *);
void *xbridge_rbus_parent_mem(struct pci_attach_args *);
int xbridge_get_widget(void *);
@@ -569,6 +570,7 @@ xbpci_attach(struct device *parent, struct device *self, void *aux)
xb->xb_pc.pc_conf_size = xbridge_conf_size;
xb->xb_pc.pc_conf_read = xbridge_conf_read;
xb->xb_pc.pc_conf_write = xbridge_conf_write;
+ xb->xb_pc.pc_probe_device_hook = xbridge_probe_device_hook;
xb->xb_pc.pc_get_widget = xbridge_get_widget;
xb->xb_pc.pc_get_dl = xbridge_get_dl;
xb->xb_pc.pc_intr_v = xb;
@@ -868,6 +870,16 @@ xbridge_conf_write(void *cookie, pcitag_t tag, int offset, pcireg_t data)
}
int
+xbridge_probe_device_hook(void *cookie, struct pci_attach_args *pa)
+{
+#if 0
+ struct xbpci_softc *xb = cookie;
+#endif
+
+ return 0;
+}
+
+int
xbridge_get_widget(void *cookie)
{
struct xbpci_softc *xb = cookie;