summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/puc/puc.c38
-rw-r--r--sys/dev/puc/puc_bfe.h3
-rw-r--r--sys/dev/puc/puc_pccard.c4
-rw-r--r--sys/dev/puc/puc_pci.c4
4 files changed, 47 insertions, 2 deletions
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c
index b6fa3c5..9bb3ceb 100644
--- a/sys/dev/puc/puc.c
+++ b/sys/dev/puc/puc.c
@@ -726,3 +726,41 @@ puc_bus_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
}
return (0);
}
+
+int
+puc_bus_print_child(device_t dev, device_t child)
+{
+ struct puc_port *port;
+ int retval;
+
+ port = device_get_ivars(child);
+ retval = 0;
+
+ retval += bus_print_child_header(dev, child);
+ retval += printf(" at port %d", port->p_nr);
+ retval += bus_print_child_footer(dev, child);
+
+ return (retval);
+}
+
+int
+puc_bus_child_location_str(device_t dev, device_t child, char *buf,
+ size_t buflen)
+{
+ struct puc_port *port;
+
+ port = device_get_ivars(child);
+ snprintf(buf, buflen, "port=%d", port->p_nr);
+ return (0);
+}
+
+int
+puc_bus_child_pnpinfo_str(device_t dev, device_t child, char *buf,
+ size_t buflen)
+{
+ struct puc_port *port;
+
+ port = device_get_ivars(child);
+ snprintf(buf, buflen, "type=%d", port->p_type);
+ return (0);
+}
diff --git a/sys/dev/puc/puc_bfe.h b/sys/dev/puc/puc_bfe.h
index f6d69c4..c67fab5 100644
--- a/sys/dev/puc/puc_bfe.h
+++ b/sys/dev/puc/puc_bfe.h
@@ -82,9 +82,12 @@ int puc_bfe_attach(device_t);
int puc_bfe_detach(device_t);
int puc_bfe_probe(device_t, const struct puc_cfg *);
+int puc_bus_child_location_str(device_t, device_t, char *, size_t);
+int puc_bus_child_pnpinfo_str(device_t, device_t, char *, size_t);
struct resource *puc_bus_alloc_resource(device_t, device_t, int, int *, u_long,
u_long, u_long, u_int);
int puc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
+int puc_bus_print_child(device_t, device_t);
int puc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
int puc_bus_release_resource(device_t, device_t, int, int, struct resource *);
int puc_bus_setup_intr(device_t, device_t, struct resource *, int,
diff --git a/sys/dev/puc/puc_pccard.c b/sys/dev/puc/puc_pccard.c
index 2cb9513..63d5787 100644
--- a/sys/dev/puc/puc_pccard.c
+++ b/sys/dev/puc/puc_pccard.c
@@ -82,7 +82,9 @@ static device_method_t puc_pccard_methods[] = {
DEVMETHOD(bus_read_ivar, puc_bus_read_ivar),
DEVMETHOD(bus_setup_intr, puc_bus_setup_intr),
DEVMETHOD(bus_teardown_intr, puc_bus_teardown_intr),
- DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_print_child, puc_bus_print_child),
+ DEVMETHOD(bus_child_pnpinfo_str, puc_bus_child_pnpinfo_str),
+ DEVMETHOD(bus_child_location_str, puc_bus_child_location_str),
DEVMETHOD(bus_driver_added, bus_generic_driver_added),
{ 0, 0 }
};
diff --git a/sys/dev/puc/puc_pci.c b/sys/dev/puc/puc_pci.c
index 9a05b66..8c14717 100644
--- a/sys/dev/puc/puc_pci.c
+++ b/sys/dev/puc/puc_pci.c
@@ -132,7 +132,9 @@ static device_method_t puc_pci_methods[] = {
DEVMETHOD(bus_read_ivar, puc_bus_read_ivar),
DEVMETHOD(bus_setup_intr, puc_bus_setup_intr),
DEVMETHOD(bus_teardown_intr, puc_bus_teardown_intr),
- DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_print_child, puc_bus_print_child),
+ DEVMETHOD(bus_child_pnpinfo_str, puc_bus_child_pnpinfo_str),
+ DEVMETHOD(bus_child_location_str, puc_bus_child_location_str),
DEVMETHOD(bus_driver_added, bus_generic_driver_added),
{ 0, 0 }
};
OpenPOWER on IntegriCloud