From e1771b7266655dd57b3e0c89174412594d79f077 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 20 Dec 2009 15:02:51 +0100 Subject: [PATCH] Add a BUS_ADD_CHILD.9 manual page (adapted from FreeBSD). --- share/man/man9/BUS_ADD_CHILD.9 | 74 +++++++++++++++++++++++++++++++++++++++ share/man/man9/Makefile | 1 + share/man/man9/device_add_child.9 | 1 + 3 files changed, 76 insertions(+) create mode 100644 share/man/man9/BUS_ADD_CHILD.9 diff --git a/share/man/man9/BUS_ADD_CHILD.9 b/share/man/man9/BUS_ADD_CHILD.9 new file mode 100644 index 0000000000..cee9b8cebc --- /dev/null +++ b/share/man/man9/BUS_ADD_CHILD.9 @@ -0,0 +1,74 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2004 M. Warner Losh. +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/share/man/man9/BUS_ADD_CHILD.9,v 1.4 2005/01/21 08:36:40 ru Exp $ +.\" +.Dd December 20, 2009 +.Dt BUS_ADD_CHILD 9 +.Os +.Sh NAME +.Nm BUS_ADD_CHILD +.Nd "add a device node to the tree with a given priority" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft int +.Fn BUS_ADD_CHILD "device_t parent" "device_t child" "int order" "const char *name" "int unit" +.Sh DESCRIPTION +The +.Fn BUS_ADD_CHILD +method +is used by the driver identify routine to add devices to the tree. +Please see +.Xr device_add_child 9 +for more details. +The interface is similar to +.Xr device_add_child 9 +however, the bus' +.Fn BUS_ADD_CHILD +is called. +.Pp +Busses implementing +.Fn BUS_ADD_CHILD +should insert the device into the tree using +.Xr device_add_child 9 +before adding things such as their own ivars and resource lists to the device. +.Sh RETURN VALUES +The +.Fn BUS_ADD_CHILD +method returns +.Vt device_t +added to the tree, or +.Dv NULL . +.Sh SEE ALSO +.Xr device 9 , +.Xr device_add_child 9 , +.Xr driver 9 +.Sh AUTHORS +This manual page was written by +.An M. Warner Losh . diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 9fd9befe09..3e52f7b050 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -12,6 +12,7 @@ MAN= accept_filter.9 \ boot.9 \ buf.9 \ bufcache.9 \ + BUS_ADD_CHILD.9 \ bus_alloc_resource.9 \ bus_dma.9 \ bus_generic_attach.9 \ diff --git a/share/man/man9/device_add_child.9 b/share/man/man9/device_add_child.9 index 8dac676aef..e6dd85a214 100644 --- a/share/man/man9/device_add_child.9 +++ b/share/man/man9/device_add_child.9 @@ -91,6 +91,7 @@ is used, then the new child will be added as if its order was zero. .Sh RETURN VALUES The new device if successful, NULL otherwise. .Sh SEE ALSO +.Xr BUS_ADD_CHILD 9 , .Xr device 9 .Sh AUTHORS This man page was written by -- 2.11.4.GIT