Alter the behavior of sys/kern/subr_bus.c:device_print_child()

- device_print_child() either lets the BUS_PRINT_CHILD
	  method produce the entire device announcement message or
	  it prints "foo0: not found\n"

Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on
the previous behavior of device_print_child() (printing the
"foo0: <FooDevice 1.1>" bit of the announce message.)

Provide bus_print_child_header() and bus_print_child_footer()
to actually print the output for bus_generic_print_child().
These functions should be used whenever possible (unless you can
just use bus_generic_print_child())

The BUS_PRINT_CHILD method now returns int instead of void.

Modify everything else that defines or uses a BUS_PRINT_CHILD
method to comply with the above changes.

	- Devices are 'on' a bus, not 'at' it.
	- If a custom BUS_PRINT_CHILD method does the same thing
	  as bus_generic_print_child(), use bus_generic_print_child()
	- Use device_get_nameunit() instead of both
	  device_get_name() and device_get_unit()
	- All BUS_PRINT_CHILD methods return the number of
	  characters output.

Reviewed by: dfr, peter
This commit is contained in:
mdodd 1999-07-29 01:03:04 +00:00
parent cb6b1f3a78
commit 7eab73ecf5
43 changed files with 347 additions and 297 deletions

View File

@ -26,7 +26,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $Id: BUS_PRINT_CHILD.9,v 1.1 1998/09/03 21:52:04 dfr Exp $
.\" $Id: BUS_PRINT_CHILD.9,v 1.2 1999/03/06 17:25:49 bde Exp $
.\"
.Dd June 16, 1998
.Os
@ -38,7 +38,7 @@
.Sh SYNOPSIS
.Fd #include <sys/param.h>
.Fd #include <sys/bus.h>
.Ft void
.Ft int
.Fn BUS_PRINT_CHILD "device_t dev" "device_t child"
.Sh DESCRIPTION
.Pp
@ -46,9 +46,14 @@ This is called from system code which prints out a description of a
device. It should describe the attachment that the child has with
the parent. For instance the TurboLaser bus prints which node the
device is attached to.
Please see bus_generic_print_child.9 for more information regarding
the proper formatting of the messages printed by BUS_PRINT_CHILD.
.Sh SEE ALSO
.Xr device 9 ,
.Xr driver 9
.Xr driver 9 ,
.Xr BUS_PRINT_CHILD 9
.Sh RETURN VALUES
The number of characters output.
.Sh AUTHORS
This man page was written by
.An Doug Rabson .

View File

@ -26,7 +26,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $Id: bus_generic_print_child.9,v 1.1 1998/09/03 21:52:05 dfr Exp $
.\" $Id: bus_generic_print_child.9,v 1.2 1999/03/06 17:25:49 bde Exp $
.\"
.Dd June 16, 1998
.Os
@ -40,15 +40,28 @@ for busses
.Sh SYNOPSIS
.Fd #include <sys/param.h>
.Fd #include <sys/bus.h>
.Ft void
.Ft int
.Fn bus_generic_print_child "device_t dev" "device_t child"
.Sh DESCRIPTION
.Pp
This implementation prints nothing at all.
This implementation prints out the default device announcement message.
Given device 'foo0' on bus 'bar0' where foo0 has the name "FooCard 1234" the
following would be printed:
.Pp
foo0: <FooCard 1234> on bar0
.Pp
bus_generic_print_child itself calls two functions
.Fn bus_print_child_header
and
.Fn bus_print_child_footer
The former prints "foo0: <FooCard 1234>" and the latter "on bar0".
These routines should be used if possible in your own code if
.Fn bus_generic_print_child
does not completely suit your needs.
.Sh SEE ALSO
.Xr device 9
.Sh BUGS
Not terribly useful.
.Sh RETURN VALUES
The number of characters output.
.Sh AUTHORS
This man page was written by
.An Doug Rabson .

View File

@ -1,4 +1,4 @@
/* $Id: ioasic.c,v 1.3 1999/05/10 15:51:23 peter Exp $ */
/* $Id: ioasic.c,v 1.4 1999/05/10 16:36:42 peter Exp $ */
/* from $NetBSD: ioasic.c,v 1.19 1998/05/27 00:18:13 thorpej Exp $ */
/*-
@ -99,7 +99,7 @@ struct ioasic_softc {
static int ioasic_probe(device_t dev);
static int ioasic_attach(device_t dev);
static driver_intr_t ioasic_intrnull;
static void ioasic_print_child(device_t bus, device_t dev);
static int ioasic_print_child(device_t bus, device_t dev);
static void ioasic_lance_dma_setup(void *v);
int ioasic_intr __P((void *));
@ -239,13 +239,17 @@ ioasic_intrnull(void *val)
(u_long)val);
}
static void
static int
ioasic_print_child(device_t bus, device_t dev)
{
struct ioasic_dev *ioasic = device_get_ivars(dev);
printf(" at %s%d, offset 0x%x",
device_get_name(bus), device_get_unit(bus),
ioasic->iad_offset);
int retval = 0;
retval += bus_print_child_header(bus, dev);
retval += printf(" on %s offset 0x%x\n", device_get_nameunit(bus),
ioasic->iad_offset);
return (retval);
}
char *

View File

@ -1,4 +1,4 @@
/* $Id: tc.c,v 1.4 1999/05/10 15:53:33 peter Exp $ */
/* $Id: tc.c,v 1.5 1999/07/01 22:49:03 peter Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
* All rights reserved.
@ -72,7 +72,6 @@ static tc_offset_t tc_slot_romoffs[NTC_ROMOFFS] = {
static int tc_probe(device_t dev);
static int tc_attach(device_t dev);
static void tc_print_child(device_t bus, device_t dev);
int tc_checkslot( tc_addr_t slotbase, char *namep);
static device_method_t tc_methods[] = {
@ -80,7 +79,7 @@ static device_method_t tc_methods[] = {
DEVMETHOD(device_probe, tc_probe),
DEVMETHOD(device_attach, tc_attach),
/* Bus interface */
DEVMETHOD(bus_print_child, tc_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
{ 0, 0 },
};
@ -684,14 +683,5 @@ tc_intr_disestablish(dev, cookie)
(*sc->sc_intr_disestablish)(device_get_parent(dev), cookie);
}
static void
tc_print_child(device_t bus, device_t dev)
{
printf(" at %s%d",
device_get_name(bus), device_get_unit(bus));
}
DRIVER_MODULE(tc, tcasic, tc_driver, tc_devclass, 0, 0);

View File

@ -1,4 +1,4 @@
/* $Id: tcasic.c,v 1.3 1999/05/08 21:58:49 dfr Exp $ */
/* $Id: tcasic.c,v 1.4 1999/05/10 15:54:58 peter Exp $ */
/* from $NetBSD: tcasic.c,v 1.23 1998/05/14 00:01:31 thorpej Exp $ */
/*
@ -56,13 +56,12 @@ struct tcasic_softc {
static int tcasic_probe(device_t dev);
static int tcasic_attach(device_t dev);
static void tcasic_print_child(device_t bus, device_t dev);
static device_method_t tcasic_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, tcasic_probe),
DEVMETHOD(device_attach, tcasic_attach),
DEVMETHOD(bus_print_child, tcasic_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
{ 0, 0 }
};
@ -97,14 +96,5 @@ tcasic_attach(device_t dev)
return 0;
}
static void
tcasic_print_child(device_t bus, device_t dev)
{
printf(" at %s%d",
device_get_name(bus), device_get_unit(bus));
}
DRIVER_MODULE(tcasic, root, tcasic_driver, tcasic_devclass, 0, 0);

View File

@ -1,4 +1,4 @@
/* $Id: tcds.c,v 1.1 1998/08/20 08:27:11 dfr Exp $ */
/* $Id: tcds.c,v 1.2 1999/05/08 21:58:50 dfr Exp $ */
/* from $NetBSD: tcds.c,v 1.25 1998/05/26 23:43:05 thorpej Exp $ */
/*-
@ -105,7 +105,6 @@ struct tcds_softc {
static int tcds_probe(device_t dev);
static int tcds_attach(device_t dev);
static void tcds_intrnull __P((void *));
static void tcds_print_child(device_t bus, device_t dev);
static void tcds_lance_dma_setup(void *v);
static int tcds_intr __P((void *));
@ -115,7 +114,7 @@ static device_method_t tcds_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, tcds_probe),
DEVMETHOD(device_attach, tcds_attach),
DEVMETHOD(bus_print_child, tcds_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
{ 0, 0 }
};
@ -446,13 +445,5 @@ tcds_intr(val)
return 1;
}
static void
tcds_print_child(device_t bus, device_t dev)
{
struct tcds_dev *ioasic = device_get_ivars(dev);
printf(" at %s%d", device_get_name(bus), device_get_unit(bus));
}
DRIVER_MODULE(tcds, tc, tcds_driver, tcds_devclass, 0, 0);

View File

@ -78,7 +78,7 @@ static devclass_t gbus_devclass;
* Device methods
*/
static int gbus_probe(device_t dev);
static void gbus_print_child(device_t dev, device_t child);
static int gbus_print_child(device_t dev, device_t child);
static int gbus_read_ivar(device_t dev, device_t child, int which, u_long *result);;
static device_method_t gbus_methods[] = {
@ -128,14 +128,17 @@ gbus_probe(device_t dev)
return 0;
}
static void
static int
gbus_print_child(device_t bus, device_t dev)
{
struct gbus_device* gdev = DEVTOGBUS(dev);
int retval = 0;
printf(" at %s%d offset 0x%x",
device_get_name(bus), device_get_unit(bus),
gdev->gd_offset);
retval += bus_print_child_header(bus, dev);
retval += printf(" on %s offset 0x%x\n", device_get_nameunit(bus),
gdev->gd_offset);
return (retval);
}
static int

View File

@ -1,4 +1,4 @@
/* $Id: kftxx.c,v 1.4 1998/11/15 18:25:16 dfr Exp $ */
/* $Id: kftxx.c,v 1.5 1999/05/08 21:58:53 dfr Exp $ */
/* $NetBSD: kftxx.c,v 1.9 1998/05/14 00:01:32 thorpej Exp $ */
/*
@ -75,7 +75,7 @@ static devclass_t kft_devclass;
* Device methods
*/
static int kft_probe(device_t dev);
static void kft_print_child(device_t dev, device_t child);
static int kft_print_child(device_t dev, device_t child);
static int kft_read_ivar(device_t dev, device_t child, int which, u_long *result);;
static device_method_t kft_methods[] = {
@ -151,14 +151,17 @@ kft_probe(device_t dev)
return 0;
}
static void
static int
kft_print_child(device_t bus, device_t dev)
{
struct kft_device *kd = (struct kft_device*) device_get_ivars(dev);
int retval = 0;
printf(" at %s%d hose %d",
device_get_name(bus), device_get_unit(bus),
kd->kd_hosenum);
retval += bus_print_child_header(bus, dev);
retval += printf(" on %s hose %d\n", device_get_nameunit(bus),
kd->kd_hosenum);
return (retval);
}
static int

View File

@ -93,7 +93,7 @@ static devclass_t tlsb_devclass;
* Device methods
*/
static int tlsb_probe(device_t dev);
static void tlsb_print_child(device_t dev, device_t child);
static int tlsb_print_child(device_t dev, device_t child);
static int tlsb_read_ivar(device_t dev, device_t child, int which, u_long* result);
static int tlsb_setup_intr(device_t dev, device_t child,
struct resource *irq, int flags,
@ -230,15 +230,17 @@ tlsb_probe(device_t dev)
return 0;
}
static void
static int
tlsb_print_child(device_t dev, device_t child)
{
struct tlsb_device* tdev = DEVTOTLSB(child);
int retval = 0;
printf(" at %s%d node %d",
device_get_name(dev),
device_get_unit(dev),
tdev->td_node);
retval += bus_print_child_header(dev, child);
retval += printf(" at %s node %d\n", device_get_nameunit(dev),
tdev->td_node);
return (retval);
}
static int

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: zs_tlsb.c,v 1.13 1999/05/30 16:50:54 phk Exp $
* $Id: zs_tlsb.c,v 1.14 1999/07/04 14:58:04 phk Exp $
*/
/*
* This driver is a hopeless hack to get the SimOS console working. A real
@ -405,7 +405,7 @@ struct zsc_softc {
static int zsc_tlsb_probe(device_t dev);
static int zsc_tlsb_attach(device_t dev);
static void zsc_tlsb_print_child(device_t dev, device_t child);
static int zsc_tlsb_print_child(device_t dev, device_t child);
static driver_intr_t zsc_tlsb_intr;
@ -485,12 +485,16 @@ zsc_tlsb_attach(device_t dev)
return 0;
}
static void
static int
zsc_tlsb_print_child(device_t bus, device_t dev)
{
printf(" at %s%d channel %c",
device_get_name(bus), device_get_unit(bus),
'A' + (device_get_unit(dev) & 1));
int retval = 0;
retval += bus_print_child_header(bus, dev);
retval += printf(" on %s channel %c\n", device_get_nameunit(bus),
'A' + (device_get_unit(dev) & 1));
return (retval);
}
static void

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.11 1999/05/30 10:50:57 dfr Exp $
* $Id: nexus.c,v 1.12 1999/07/16 01:00:24 msmith Exp $
*/
/*
@ -74,7 +74,7 @@
static struct rman irq_rman, drq_rman, port_rman, mem_rman;
static int nexus_probe(device_t);
static void nexus_print_child(device_t, device_t);
static int nexus_print_child(device_t, device_t);
static device_t nexus_add_child(device_t bus, int order, const char *name,
int unit);
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
@ -213,10 +213,15 @@ nexus_probe(device_t dev)
return 0;
}
static void
static int
nexus_print_child(device_t bus, device_t child)
{
printf(" on motherboard");
int retval = 0;
retval += bus_print_child_header(bus, child);
retval += printf(" on motherboard\n");
return (retval);
}
static device_t

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.11 1999/05/30 10:50:57 dfr Exp $
* $Id: nexus.c,v 1.12 1999/07/16 01:00:24 msmith Exp $
*/
/*
@ -74,7 +74,7 @@
static struct rman irq_rman, drq_rman, port_rman, mem_rman;
static int nexus_probe(device_t);
static void nexus_print_child(device_t, device_t);
static int nexus_print_child(device_t, device_t);
static device_t nexus_add_child(device_t bus, int order, const char *name,
int unit);
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
@ -213,10 +213,15 @@ nexus_probe(device_t dev)
return 0;
}
static void
static int
nexus_print_child(device_t bus, device_t child)
{
printf(" on motherboard");
int retval = 0;
retval += bus_print_child_header(bus, child);
retval += printf(" on motherboard\n");
return (retval);
}
static device_t

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: atkbdc_isa.c,v 1.8 1999/05/30 11:12:27 dfr Exp $
* $Id: atkbdc_isa.c,v 1.9 1999/06/29 17:35:09 yokota Exp $
*/
#include "atkbdc.h"
@ -59,7 +59,7 @@ devclass_t atkbdc_devclass;
static int atkbdc_probe(device_t dev);
static int atkbdc_attach(device_t dev);
static void atkbdc_print_child(device_t bus, device_t dev);
static int atkbdc_print_child(device_t bus, device_t dev);
static int atkbdc_read_ivar(device_t bus, device_t dev, int index,
u_long *val);
static int atkbdc_write_ivar(device_t bus, device_t dev, int index,
@ -201,19 +201,22 @@ atkbdc_attach(device_t dev)
return 0;
}
static void
static int
atkbdc_print_child(device_t bus, device_t dev)
{
atkbdc_device_t *kbdcdev;
int retval = 0;
kbdcdev = (atkbdc_device_t *)device_get_ivars(dev);
retval += bus_print_child_header(bus, dev);
if (kbdcdev->flags != 0)
printf(" flags 0x%x", kbdcdev->flags);
retval += printf(" flags 0x%x", kbdcdev->flags);
if (kbdcdev->irq != -1)
printf(" irq %d", kbdcdev->irq);
retval += printf(" irq %d", kbdcdev->irq);
retval += bus_print_child_footer(bus, dev);
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
return (retval);
}
static int

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: atkbdc_isa.c,v 1.8 1999/05/30 11:12:27 dfr Exp $
* $Id: atkbdc_isa.c,v 1.9 1999/06/29 17:35:09 yokota Exp $
*/
#include "atkbdc.h"
@ -59,7 +59,7 @@ devclass_t atkbdc_devclass;
static int atkbdc_probe(device_t dev);
static int atkbdc_attach(device_t dev);
static void atkbdc_print_child(device_t bus, device_t dev);
static int atkbdc_print_child(device_t bus, device_t dev);
static int atkbdc_read_ivar(device_t bus, device_t dev, int index,
u_long *val);
static int atkbdc_write_ivar(device_t bus, device_t dev, int index,
@ -201,19 +201,22 @@ atkbdc_attach(device_t dev)
return 0;
}
static void
static int
atkbdc_print_child(device_t bus, device_t dev)
{
atkbdc_device_t *kbdcdev;
int retval = 0;
kbdcdev = (atkbdc_device_t *)device_get_ivars(dev);
retval += bus_print_child_header(bus, dev);
if (kbdcdev->flags != 0)
printf(" flags 0x%x", kbdcdev->flags);
retval += printf(" flags 0x%x", kbdcdev->flags);
if (kbdcdev->irq != -1)
printf(" irq %d", kbdcdev->irq);
retval += printf(" irq %d", kbdcdev->irq);
retval += bus_print_child_footer(bus, dev);
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
return (retval);
}
static int

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bt848_i2c.c,v 1.4 1999/05/10 10:08:05 roger Exp $
* $Id: bt848_i2c.c,v 1.5 1999/07/03 20:17:01 peter Exp $
*
*/
@ -91,7 +91,6 @@ struct bt_data btdata[NBKTR];
static int bti2c_probe(device_t);
static int bti2c_attach(device_t);
static void bti2c_print_child(device_t, device_t);
static int bti2c_iic_callback(device_t, int, caddr_t *);
static void bti2c_iic_setlines(device_t, int, int);
@ -111,7 +110,7 @@ static device_method_t bti2c_methods[] = {
DEVMETHOD(device_attach, bti2c_attach),
/* bus interface */
DEVMETHOD(bus_print_child, bti2c_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
/* iicbb interface */
DEVMETHOD(iicbb_callback, bti2c_iic_callback),
@ -193,14 +192,6 @@ bti2c_attach(device_t dev)
return (0);
}
static void
bti2c_print_child(device_t bus, device_t dev)
{
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
return;
}
static int
bti2c_smb_callback(device_t dev, int index, caddr_t *data)
{

View File

@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: eisaconf.c,v 1.46 1999/06/22 09:44:00 peter Exp $
* $Id: eisaconf.c,v 1.47 1999/07/11 13:42:35 dfr Exp $
*/
#include "opt_eisa.h"
@ -212,12 +212,17 @@ eisa_probe_nomatch(device_t dev, device_t child)
return;
}
static void
static int
eisa_print_child(device_t dev, device_t child)
{
/* XXX print resource descriptions? */
printf(" at slot %d", eisa_get_slot(child));
printf(" on %s", device_get_nameunit(dev));
int retval = 0;
bus_print_child_header(dev, child);
retval += printf(" on %s slot %d", device_get_nameunit(dev),
eisa_get_slot(child));
return (retval);
}
static int

View File

@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.148 1999/07/04 14:58:32 phk Exp $
* $Id: fd.c,v 1.149 1999/07/21 12:19:44 joerg Exp $
*
*/
@ -757,11 +757,16 @@ fdc_attach(device_t dev)
return (bus_generic_attach(dev));
}
static void
static int
fdc_print_child(device_t me, device_t child)
{
printf(" at %s%d drive %d", device_get_name(me), device_get_unit(me),
int retval = 0;
retval += bus_print_child_header(me, child);
retval += printf(" on %s drive %d\n", device_get_nameunit(me),
*(int *)device_get_ivars(child));
return (retval);
}
static int

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ida_pci.c,v 1.1 1999/06/24 03:32:07 jlemon Exp $
* $Id: ida_pci.c,v 1.2 1999/07/03 20:17:02 peter Exp $
*/
#include <sys/param.h>
@ -69,13 +69,12 @@ static struct {
static int ida_pci_probe(device_t dev);
static int ida_pci_attach(device_t dev);
static void ida_pci_print_child(device_t bus, device_t dev);
static device_method_t ida_pci_methods[] = {
DEVMETHOD(device_probe, ida_pci_probe),
DEVMETHOD(device_attach, ida_pci_attach),
DEVMETHOD(bus_print_child, ida_pci_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
{ 0, 0 }
};
@ -185,10 +184,4 @@ ida_pci_attach(device_t dev)
return (0);
}
static void
ida_pci_print_child(device_t bus, device_t dev)
{
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
}
DRIVER_MODULE(ida, pci, ida_pci_driver, ida_devclass, 0, 0);

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: iicbb.c,v 1.3 1999/01/28 15:50:24 roger Exp $
* $Id: iicbb.c,v 1.4 1999/05/08 21:59:04 dfr Exp $
*
*/
@ -70,7 +70,7 @@ struct iicbb_softc {
static int iicbb_probe(device_t);
static int iicbb_attach(device_t);
static void iicbb_print_child(device_t, device_t);
static int iicbb_print_child(device_t, device_t);
static int iicbb_callback(device_t, int, caddr_t);
static int iicbb_start(device_t, u_char, int);
@ -119,27 +119,28 @@ static int iicbb_attach(device_t dev)
return (0);
}
static void
static int
iicbb_print_child(device_t bus, device_t dev)
{
int error;
int retval = 0;
u_char oldaddr;
retval += bus_print_child_header(bus, dev);
/* retrieve the interface I2C address */
error = IICBB_RESET(device_get_parent(bus), IIC_FASTEST, 0, &oldaddr);
if (error == IIC_ENOADDR) {
printf(" on %s%d master-only", device_get_name(bus),
device_get_unit(bus));
retval += printf(" on %s master-only\n",
device_get_nameunit(bus));
} else {
/* restore the address */
IICBB_RESET(device_get_parent(bus), IIC_FASTEST, oldaddr, NULL);
printf(" on %s%d addr 0x%x", device_get_name(bus),
device_get_unit(bus), oldaddr & 0xff);
retval += printf(" on %s addr 0x%x\n",
device_get_nameunit(bus), oldaddr & 0xff);
}
return;
return (retval);
}
#define I2C_SET(dev,ctrl,data) \

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: iicbus.c,v 1.8 1999/04/11 02:55:52 eivind Exp $
* $Id: iicbus.c,v 1.9 1999/05/08 21:59:04 dfr Exp $
*
*/
@ -92,7 +92,7 @@ static devclass_t iicbus_devclass;
*/
static int iicbus_probe(device_t);
static int iicbus_attach(device_t);
static void iicbus_print_child(device_t, device_t);
static int iicbus_print_child(device_t, device_t);
static int iicbus_read_ivar(device_t , device_t, int, u_long *);
static int iicbus_write_ivar(device_t , device_t, int, u_long);
@ -231,27 +231,29 @@ iicbus_null_repeated_start(device_t dev, u_char addr)
return (IIC_ENOTSUPP);
}
static void
static int
iicbus_print_child(device_t bus, device_t dev)
{
struct iicbus_device* iicdev = DEVTOIICBUS(dev);
int retval = 0;
retval += bus_print_child_header(bus, dev);
switch (iicdev->iicd_class) {
case IICBUS_DEVICE_CLASS:
printf(" on %s%d addr 0x%x", device_get_name(bus),
device_get_unit(bus), iicdev->iicd_addr);
retval += printf(" on %s addr 0x%x\n",
device_get_nameunit(bus), iicdev->iicd_addr);
break;
case IICBUS_DRIVER_CLASS:
printf(" on %s%d", device_get_name(bus),
device_get_unit(bus));
retval += bus_print_child_footer(bus, dev);
break;
default:
panic("%s: unknown class!", __FUNCTION__);
panic("%s: unknown class!\n", __FUNCTION__);
}
return;
return (retval);
}
static int

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: iicsmb.c,v 1.2 1998/10/31 11:31:07 nsouch Exp $
* $Id: iicsmb.c,v 1.3 1999/05/08 21:59:05 dfr Exp $
*
*/
@ -83,7 +83,6 @@ struct iicsmb_softc {
static int iicsmb_probe(device_t);
static int iicsmb_attach(device_t);
static void iicsmb_print_child(device_t, device_t);
static void iicsmb_intr(device_t dev, int event, char *buf);
static int iicsmb_callback(device_t dev, int index, caddr_t data);
@ -106,7 +105,7 @@ static device_method_t iicsmb_methods[] = {
DEVMETHOD(device_attach, iicsmb_attach),
/* bus interface */
DEVMETHOD(bus_print_child, iicsmb_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
/* iicbus interface */
DEVMETHOD(iicbus_intr, iicsmb_intr),
@ -157,14 +156,6 @@ iicsmb_attach(device_t dev)
return (0);
}
static void
iicsmb_print_child(device_t bus, device_t dev)
{
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
return;
}
/*
* iicsmb_intr()
*

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: pcf.c,v 1.8 1999/05/06 18:54:18 peter Exp $
* $Id: pcf.c,v 1.9 1999/05/08 21:59:27 dfr Exp $
*
*/
#include <sys/param.h>
@ -103,7 +103,7 @@ struct isa_driver pcfdriver = {
static int pcf_probe(device_t);
static int pcf_attach(device_t);
static void pcf_print_child(device_t, device_t);
static int pcf_print_child(device_t, device_t);
static int pcf_repeated_start(device_t, u_char, int);
static int pcf_start(device_t, u_char, int);
@ -219,15 +219,17 @@ pcf_attach(device_t pcfdev)
return (0);
}
static void
static int
pcf_print_child(device_t bus, device_t dev)
{
struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(bus);
int retval = 0;
printf(" on %s%d addr 0x%x", device_get_name(bus),
device_get_unit(bus), (int)pcf->pcf_addr);
retval += bus_print_child_header(bus, dev);
retval += printf(" on %s addr 0x%x\n", device_get_nameunit(bus),
(int)pcf->pcf_addr);
return;
return (retval);
}
/*

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: pci.c,v 1.112 1999/07/27 05:08:36 mdodd Exp $
* $Id: pci.c,v 1.113 1999/07/28 07:57:47 dfr Exp $
*
*/
@ -1116,18 +1116,26 @@ pci_new_probe(device_t dev)
return 0;
}
static void
static int
pci_print_child(device_t dev, device_t child)
{
struct pci_devinfo *dinfo;
pcicfgregs *cfg;
int retval = 0;
dinfo = device_get_ivars(child);
cfg = &dinfo->cfg;
retval += bus_print_child_header(dev, child);
if (cfg->intpin > 0 && cfg->intline != 255)
printf(" irq %d", cfg->intline);
printf(" at device %d.%d", pci_get_slot(child), pci_get_function(child));
printf(" on %s%d", device_get_name(dev), device_get_unit(dev));
retval += printf(" irq %d", cfg->intline);
retval += printf(" at device %d.%d", pci_get_slot(child),
pci_get_function(child));
retval += bus_print_child_footer(dev, child);
return (retval);
}
static void

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: lpbb.c,v 1.4 1999/01/10 12:04:54 nsouch Exp $
* $Id: lpbb.c,v 1.5 1999/05/08 21:59:06 dfr Exp $
*
*/
@ -62,7 +62,6 @@ static int lpbb_detect(struct lpbb_softc *);
static int lpbb_probe(device_t);
static int lpbb_attach(device_t);
static void lpbb_print_child(device_t, device_t);
static int lpbb_callback(device_t, int, caddr_t *);
static void lpbb_setlines(device_t, int, int);
@ -77,7 +76,7 @@ static device_method_t lpbb_methods[] = {
DEVMETHOD(device_attach, lpbb_attach),
/* bus interface */
DEVMETHOD(bus_print_child, lpbb_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
/* iicbb interface */
DEVMETHOD(iicbb_callback, lpbb_callback),
@ -307,12 +306,4 @@ lpbb_getdataline(device_t dev)
return (getSDA(sc));
}
static void
lpbb_print_child(device_t bus, device_t dev)
{
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
return;
}
DRIVER_MODULE(lpbb, root, lpbb_driver, lpbb_devclass, 0, 0);

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: smbus.c,v 1.8 1999/02/13 17:57:19 nsouch Exp $
* $Id: smbus.c,v 1.9 1999/05/08 21:59:08 dfr Exp $
*
*/
#include <sys/param.h>
@ -64,7 +64,6 @@ static devclass_t smbus_devclass;
*/
static int smbus_probe(device_t);
static int smbus_attach(device_t);
static void smbus_print_child(device_t, device_t);
#if 0
static int smbus_read_ivar(device_t , device_t, int, u_long *);
@ -78,7 +77,7 @@ static device_method_t smbus_methods[] = {
DEVMETHOD(device_shutdown, bus_generic_shutdown),
/* bus interface */
DEVMETHOD(bus_print_child, smbus_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
@ -132,15 +131,6 @@ smbus_generic_intr(device_t dev, u_char devaddr, char low, char high)
return;
}
static void
smbus_print_child(device_t bus, device_t dev)
{
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
return;
}
#if 0
static int
smbus_read_ivar(device_t bus, device_t dev, int index, u_long* result)

View File

@ -1224,30 +1224,34 @@ usbd_get_endpoint_descriptor(iface, address)
}
#if defined(__FreeBSD__)
void
int
usbd_print_child(device_t parent, device_t child)
{
/*
struct usb_softc *sc = device_get_softc(child);
*/
int retval = 0;
printf(" at %s%d", device_get_name(parent), device_get_unit(parent));
retval += bus_print_child_header(parent, child);
retval += bus_print_child_footer(parent, child);
/* XXX How do we get to the usbd_device_handle???
usbd_device_handle dev = invalidadosch;
printf(" addr %d", dev->addr);
retval += printf(" addr %d\n", dev->addr);
if (bootverbose) {
if (dev->lowspeed)
printf(", lowspeed");
retval += printf(", lowspeed");
if (dev->self_powered)
printf(", self powered");
retval += printf(", self powered");
else
printf(", %dmA", dev->power);
printf(", config %d", dev->config);
retval += printf(", %dmA", dev->power);
retval += printf(", config %d", dev->config);
}
*/
return (retval);
}
/* Reconfigure all the USB busses in the system. */

View File

@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: eisaconf.c,v 1.46 1999/06/22 09:44:00 peter Exp $
* $Id: eisaconf.c,v 1.47 1999/07/11 13:42:35 dfr Exp $
*/
#include "opt_eisa.h"
@ -212,12 +212,17 @@ eisa_probe_nomatch(device_t dev, device_t child)
return;
}
static void
static int
eisa_print_child(device_t dev, device_t child)
{
/* XXX print resource descriptions? */
printf(" at slot %d", eisa_get_slot(child));
printf(" on %s", device_get_nameunit(dev));
int retval = 0;
bus_print_child_header(dev, child);
retval += printf(" on %s slot %d", device_get_nameunit(dev),
eisa_get_slot(child));
return (retval);
}
static int

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.11 1999/05/30 10:50:57 dfr Exp $
* $Id: nexus.c,v 1.12 1999/07/16 01:00:24 msmith Exp $
*/
/*
@ -74,7 +74,7 @@
static struct rman irq_rman, drq_rman, port_rman, mem_rman;
static int nexus_probe(device_t);
static void nexus_print_child(device_t, device_t);
static int nexus_print_child(device_t, device_t);
static device_t nexus_add_child(device_t bus, int order, const char *name,
int unit);
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
@ -213,10 +213,15 @@ nexus_probe(device_t dev)
return 0;
}
static void
static int
nexus_print_child(device_t bus, device_t child)
{
printf(" on motherboard");
int retval = 0;
retval += bus_print_child_header(bus, child);
retval += printf(" on motherboard\n");
return (retval);
}
static device_t

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.11 1999/05/30 10:50:57 dfr Exp $
* $Id: nexus.c,v 1.12 1999/07/16 01:00:24 msmith Exp $
*/
/*
@ -74,7 +74,7 @@
static struct rman irq_rman, drq_rman, port_rman, mem_rman;
static int nexus_probe(device_t);
static void nexus_print_child(device_t, device_t);
static int nexus_print_child(device_t, device_t);
static device_t nexus_add_child(device_t bus, int order, const char *name,
int unit);
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
@ -213,10 +213,15 @@ nexus_probe(device_t dev)
return 0;
}
static void
static int
nexus_print_child(device_t bus, device_t child)
{
printf(" on motherboard");
int retval = 0;
retval += bus_print_child_header(bus, child);
retval += printf(" on motherboard\n");
return (retval);
}
static device_t

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: pcf.c,v 1.8 1999/05/06 18:54:18 peter Exp $
* $Id: pcf.c,v 1.9 1999/05/08 21:59:27 dfr Exp $
*
*/
#include <sys/param.h>
@ -103,7 +103,7 @@ struct isa_driver pcfdriver = {
static int pcf_probe(device_t);
static int pcf_attach(device_t);
static void pcf_print_child(device_t, device_t);
static int pcf_print_child(device_t, device_t);
static int pcf_repeated_start(device_t, u_char, int);
static int pcf_start(device_t, u_char, int);
@ -219,15 +219,17 @@ pcf_attach(device_t pcfdev)
return (0);
}
static void
static int
pcf_print_child(device_t bus, device_t dev)
{
struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(bus);
int retval = 0;
printf(" on %s%d addr 0x%x", device_get_name(bus),
device_get_unit(bus), (int)pcf->pcf_addr);
retval += bus_print_child_header(bus, dev);
retval += printf(" on %s addr 0x%x\n", device_get_nameunit(bus),
(int)pcf->pcf_addr);
return;
return (retval);
}
/*

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: atkbdc_isa.c,v 1.8 1999/05/30 11:12:27 dfr Exp $
* $Id: atkbdc_isa.c,v 1.9 1999/06/29 17:35:09 yokota Exp $
*/
#include "atkbdc.h"
@ -59,7 +59,7 @@ devclass_t atkbdc_devclass;
static int atkbdc_probe(device_t dev);
static int atkbdc_attach(device_t dev);
static void atkbdc_print_child(device_t bus, device_t dev);
static int atkbdc_print_child(device_t bus, device_t dev);
static int atkbdc_read_ivar(device_t bus, device_t dev, int index,
u_long *val);
static int atkbdc_write_ivar(device_t bus, device_t dev, int index,
@ -201,19 +201,22 @@ atkbdc_attach(device_t dev)
return 0;
}
static void
static int
atkbdc_print_child(device_t bus, device_t dev)
{
atkbdc_device_t *kbdcdev;
int retval = 0;
kbdcdev = (atkbdc_device_t *)device_get_ivars(dev);
retval += bus_print_child_header(bus, dev);
if (kbdcdev->flags != 0)
printf(" flags 0x%x", kbdcdev->flags);
retval += printf(" flags 0x%x", kbdcdev->flags);
if (kbdcdev->irq != -1)
printf(" irq %d", kbdcdev->irq);
retval += printf(" irq %d", kbdcdev->irq);
retval += bus_print_child_footer(bus, dev);
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
return (retval);
}
static int

View File

@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.148 1999/07/04 14:58:32 phk Exp $
* $Id: fd.c,v 1.149 1999/07/21 12:19:44 joerg Exp $
*
*/
@ -757,11 +757,16 @@ fdc_attach(device_t dev)
return (bus_generic_attach(dev));
}
static void
static int
fdc_print_child(device_t me, device_t child)
{
printf(" at %s%d drive %d", device_get_name(me), device_get_unit(me),
int retval = 0;
retval += bus_print_child_header(me, child);
retval += printf(" on %s drive %d\n", device_get_nameunit(me),
*(int *)device_get_ivars(child));
return (retval);
}
static int

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: isa_common.c,v 1.2 1999/05/28 09:24:58 dfr Exp $
* $Id: isa_common.c,v 1.3 1999/05/30 11:02:09 dfr Exp $
*/
/*
* Modifications for Intel architecture by Garrett A. Wollman.
@ -152,24 +152,28 @@ isa_print_resources(struct resource_list *rl, const char *name, int type,
}
}
static void
static int
isa_print_child(device_t bus, device_t dev)
{
struct isa_device *idev = DEVTOISA(dev);
struct resource_list *rl = &idev->id_resources;
int retval = 0;
retval += bus_print_child_header(bus, dev);
if (SLIST_FIRST(rl) || idev->id_flags)
printf(" at");
retval += printf(" at");
isa_print_resources(rl, "port", SYS_RES_IOPORT, "%#lx");
isa_print_resources(rl, "iomem", SYS_RES_MEMORY, "%#lx");
isa_print_resources(rl, "irq", SYS_RES_IRQ, "%ld");
isa_print_resources(rl, "drq", SYS_RES_DRQ, "%ld");
retval += isa_print_resources(rl, "port", SYS_RES_IOPORT, "%#lx");
retval += isa_print_resources(rl, "iomem", SYS_RES_MEMORY, "%#lx");
retval += isa_print_resources(rl, "irq", SYS_RES_IRQ, "%ld");
retval += isa_print_resources(rl, "drq", SYS_RES_DRQ, "%ld");
if (idev->id_flags)
printf(" flags %#x", idev->id_flags);
retval += printf(" flags %#x", idev->id_flags);
printf(" on %s%d",
device_get_name(bus), device_get_unit(bus));
retval += bus_print_child_footer(bus, dev);
return (retval);
}
static int

View File

@ -23,7 +23,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Id: bus_if.m,v 1.11 1999/05/28 09:25:08 dfr Exp $
# $Id: bus_if.m,v 1.12 1999/07/11 13:42:36 dfr Exp $
#
INTERFACE bus;
@ -46,9 +46,11 @@ CODE {
# This is called from system code which prints out a description of a
# device. It should describe the attachment that the child has with
# the parent. For instance the TurboLaser bus prints which node the
# device is attached to.
# device is attached to. See bus_generic_print_child.9 for more
# information.
# This method returns the number of characters output.
#
METHOD void print_child {
METHOD int print_child {
device_t dev;
device_t child;
};

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: subr_bus.c,v 1.30 1999/07/11 13:42:37 dfr Exp $
* $Id: subr_bus.c,v 1.31 1999/07/24 09:34:12 dfr Exp $
*/
#include <sys/param.h>
@ -625,17 +625,17 @@ make_device(device_t parent, const char *name,
return dev;
}
static void
static int
device_print_child(device_t dev, device_t child)
{
printf("%s%d", device_get_name(child), device_get_unit(child));
int retval = 0;
if (device_is_alive(child)) {
if (device_get_desc(child))
printf(": <%s>", device_get_desc(child));
BUS_PRINT_CHILD(dev, child);
retval += BUS_PRINT_CHILD(dev, child);
} else
printf(" not found");
printf("\n");
retval += device_printf(child, " not found\n");
return (retval);
}
device_t
@ -1857,10 +1857,36 @@ bus_generic_resume(device_t dev)
return 0;
}
void
int
bus_print_child_header (device_t dev, device_t child)
{
int retval = 0;
if (device_get_desc(child)) {
retval += device_printf(child, "<%s>",
device_get_desc(child));
} else {
retval += printf("%s", device_get_nameunit(child))
}
return (retval);
}
int
bus_print_child_footer (device_t dev, device_t child)
{
return(printf(" on %s\n", device_get_nameunit(dev)));
}
int
bus_generic_print_child(device_t dev, device_t child)
{
printf(" on %s%d", device_get_name(dev), device_get_unit(dev));
int retval = 0;
retval += bus_print_child_header(dev, child);
retval += bus_print_child_footer(dev, child);
return (retval);
}
int
@ -2020,9 +2046,10 @@ bus_teardown_intr(device_t dev, struct resource *r, void *cookie)
return (BUS_TEARDOWN_INTR(dev->parent, dev, r, cookie));
}
static void
static int
root_print_child(device_t dev, device_t child)
{
return (0);
}
static int

View File

@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.65 1999/06/28 14:01:03 kato Exp $
* $Id: fd.c,v 1.66 1999/07/04 14:58:44 phk Exp $
*
*/
@ -937,11 +937,16 @@ fdc_attach(device_t dev)
return (bus_generic_attach(dev));
}
static void
static int
fdc_print_child(device_t me, device_t child)
{
printf(" at %s%d drive %d", device_get_name(me), device_get_unit(me),
*(int *)device_get_ivars(child));
int retval = 0;
retval += bus_print_child_header(me, child);
retval += printf(" on %s drive %d\n", device_get_nameunit(me),
*(int *)device_get_ivars(child));
return (retval);
}
static int

View File

@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.65 1999/06/28 14:01:03 kato Exp $
* $Id: fd.c,v 1.66 1999/07/04 14:58:44 phk Exp $
*
*/
@ -937,11 +937,16 @@ fdc_attach(device_t dev)
return (bus_generic_attach(dev));
}
static void
static int
fdc_print_child(device_t me, device_t child)
{
printf(" at %s%d drive %d", device_get_name(me), device_get_unit(me),
*(int *)device_get_ivars(child));
int retval = 0;
retval += bus_print_child_header(me, child);
retval += printf(" on %s drive %d\n", device_get_nameunit(me),
*(int *)device_get_ivars(child));
return (retval);
}
static int

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: alpm.c,v 1.4 1999/05/09 17:06:38 peter Exp $
* $Id: alpm.c,v 1.5 1999/07/03 20:17:00 peter Exp $
*
*/
@ -147,7 +147,6 @@ struct alsmb_softc {
static int alsmb_probe(device_t);
static int alsmb_attach(device_t);
static void alsmb_print_child(device_t, device_t);
static int alsmb_smb_callback(device_t, int, caddr_t *);
static int alsmb_smb_quick(device_t dev, u_char slave, int how);
static int alsmb_smb_sendb(device_t dev, u_char slave, char byte);
@ -167,7 +166,7 @@ static device_method_t alsmb_methods[] = {
DEVMETHOD(device_attach, alsmb_attach),
/* bus interface */
DEVMETHOD(bus_print_child, alsmb_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
/* smbus interface */
DEVMETHOD(smbus_callback, alsmb_smb_callback),
@ -317,14 +316,6 @@ alsmb_attach(device_t dev)
return (0);
}
static void
alsmb_print_child(device_t bus, device_t dev)
{
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
return;
}
static int
alsmb_smb_callback(device_t dev, int index, caddr_t *data)
{

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bt848_i2c.c,v 1.4 1999/05/10 10:08:05 roger Exp $
* $Id: bt848_i2c.c,v 1.5 1999/07/03 20:17:01 peter Exp $
*
*/
@ -91,7 +91,6 @@ struct bt_data btdata[NBKTR];
static int bti2c_probe(device_t);
static int bti2c_attach(device_t);
static void bti2c_print_child(device_t, device_t);
static int bti2c_iic_callback(device_t, int, caddr_t *);
static void bti2c_iic_setlines(device_t, int, int);
@ -111,7 +110,7 @@ static device_method_t bti2c_methods[] = {
DEVMETHOD(device_attach, bti2c_attach),
/* bus interface */
DEVMETHOD(bus_print_child, bti2c_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
/* iicbb interface */
DEVMETHOD(iicbb_callback, bti2c_iic_callback),
@ -193,14 +192,6 @@ bti2c_attach(device_t dev)
return (0);
}
static void
bti2c_print_child(device_t bus, device_t dev)
{
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
return;
}
static int
bti2c_smb_callback(device_t dev, int index, caddr_t *data)
{

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ida_pci.c,v 1.1 1999/06/24 03:32:07 jlemon Exp $
* $Id: ida_pci.c,v 1.2 1999/07/03 20:17:02 peter Exp $
*/
#include <sys/param.h>
@ -69,13 +69,12 @@ static struct {
static int ida_pci_probe(device_t dev);
static int ida_pci_attach(device_t dev);
static void ida_pci_print_child(device_t bus, device_t dev);
static device_method_t ida_pci_methods[] = {
DEVMETHOD(device_probe, ida_pci_probe),
DEVMETHOD(device_attach, ida_pci_attach),
DEVMETHOD(bus_print_child, ida_pci_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
{ 0, 0 }
};
@ -185,10 +184,4 @@ ida_pci_attach(device_t dev)
return (0);
}
static void
ida_pci_print_child(device_t bus, device_t dev)
{
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
}
DRIVER_MODULE(ida, pci, ida_pci_driver, ida_devclass, 0, 0);

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: intpm.c,v 1.11 1999/07/03 20:17:06 peter Exp $
* $Id: intpm.c,v 1.12 1999/07/24 19:13:54 nsouch Exp $
*/
#include <sys/param.h>
@ -67,7 +67,6 @@ static struct _pcsid
};
static int intsmb_probe(device_t);
static int intsmb_attach(device_t);
static void intsmb_print_child(device_t, device_t);
static int intsmb_intr(device_t dev);
static int intsmb_slvintr(device_t dev);
@ -95,7 +94,7 @@ static device_method_t intpm_methods[]={
DEVMETHOD(device_probe,intsmb_probe),
DEVMETHOD(device_attach,intsmb_attach),
DEVMETHOD(bus_print_child, intsmb_print_child),
DEVMETHOD(bus_print_child, bus_generic_print_child),
DEVMETHOD(smbus_callback,intsmb_callback),
DEVMETHOD(smbus_quick,intsmb_quick),
@ -176,12 +175,6 @@ intsmb_attach(device_t dev)
return (0);
}
static void
intsmb_print_child(device_t bus, device_t dev)
{
printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
return;
}
static int
intsmb_callback(device_t dev, int index, caddr_t data)
{

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: pci.c,v 1.112 1999/07/27 05:08:36 mdodd Exp $
* $Id: pci.c,v 1.113 1999/07/28 07:57:47 dfr Exp $
*
*/
@ -1116,18 +1116,26 @@ pci_new_probe(device_t dev)
return 0;
}
static void
static int
pci_print_child(device_t dev, device_t child)
{
struct pci_devinfo *dinfo;
pcicfgregs *cfg;
int retval = 0;
dinfo = device_get_ivars(child);
cfg = &dinfo->cfg;
retval += bus_print_child_header(dev, child);
if (cfg->intpin > 0 && cfg->intline != 255)
printf(" irq %d", cfg->intline);
printf(" at device %d.%d", pci_get_slot(child), pci_get_function(child));
printf(" on %s%d", device_get_name(dev), device_get_unit(dev));
retval += printf(" irq %d", cfg->intline);
retval += printf(" at device %d.%d", pci_get_slot(child),
pci_get_function(child));
retval += bus_print_child_footer(dev, child);
return (retval);
}
static void

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bus.h,v 1.20 1999/07/04 14:58:55 phk Exp $
* $Id: bus.h,v 1.21 1999/07/24 09:34:10 dfr Exp $
*/
#ifndef _SYS_BUS_H_
@ -174,7 +174,9 @@ int bus_generic_deactivate_resource(device_t dev, device_t child, int type,
int rid, struct resource *r);
int bus_generic_detach(device_t dev);
void bus_generic_driver_added(device_t dev, driver_t *driver);
void bus_generic_print_child(device_t dev, device_t child);
int bus_print_child_header(device_t dev, device_t child);
int bus_print_child_footer(device_t dev, device_t child);
int bus_generic_print_child(device_t dev, device_t child);
int bus_generic_probe(device_t dev);
int bus_generic_read_ivar(device_t dev, device_t child, int which,
uintptr_t *result);