Date: Thu, 14 Jul 2011 18:49:23 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r224032 - stable/8/sys/dev/puc Message-ID: <201107141849.p6EInN7S041440@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Thu Jul 14 18:49:23 2011 New Revision: 224032 URL: http://svn.freebsd.org/changeset/base/224032 Log: MFC 223091: Add location and pnpinfo strings for puc device ports. The location is announced during boot and contains the port number. The pnpinfo string lists the port type (PUC_TYPE_* constants). Modified: stable/8/sys/dev/puc/puc.c stable/8/sys/dev/puc/puc_bfe.h stable/8/sys/dev/puc/puc_pccard.c stable/8/sys/dev/puc/puc_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/puc/puc.c ============================================================================== --- stable/8/sys/dev/puc/puc.c Thu Jul 14 18:38:10 2011 (r224031) +++ stable/8/sys/dev/puc/puc.c Thu Jul 14 18:49:23 2011 (r224032) @@ -726,3 +726,41 @@ puc_bus_read_ivar(device_t dev, device_t } 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); +} Modified: stable/8/sys/dev/puc/puc_bfe.h ============================================================================== --- stable/8/sys/dev/puc/puc_bfe.h Thu Jul 14 18:38:10 2011 (r224031) +++ stable/8/sys/dev/puc/puc_bfe.h Thu Jul 14 18:49:23 2011 (r224032) @@ -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, Modified: stable/8/sys/dev/puc/puc_pccard.c ============================================================================== --- stable/8/sys/dev/puc/puc_pccard.c Thu Jul 14 18:38:10 2011 (r224031) +++ stable/8/sys/dev/puc/puc_pccard.c Thu Jul 14 18:49:23 2011 (r224032) @@ -82,7 +82,9 @@ static device_method_t puc_pccard_method 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 } }; Modified: stable/8/sys/dev/puc/puc_pci.c ============================================================================== --- stable/8/sys/dev/puc/puc_pci.c Thu Jul 14 18:38:10 2011 (r224031) +++ stable/8/sys/dev/puc/puc_pci.c Thu Jul 14 18:49:23 2011 (r224032) @@ -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 } };
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107141849.p6EInN7S041440>