]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man9/BUS_ADD_CHILD.9
accept_filter(9): Fix a mandoc related error
[FreeBSD/FreeBSD.git] / share / man / man9 / BUS_ADD_CHILD.9
1 .\" -*- nroff -*-
2 .\"
3 .\" Copyright (c) 2004 M. Warner Losh <imp@FreeBSD.org>
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd April 8, 2018
28 .Dt BUS_ADD_CHILD 9
29 .Os
30 .Sh NAME
31 .Nm BUS_ADD_CHILD
32 .Nd "add a device node to the tree with a given priority"
33 .Sh SYNOPSIS
34 .In sys/param.h
35 .In sys/bus.h
36 .Ft device_t
37 .Fn BUS_ADD_CHILD "device_t dev" "int order" "const char *name" "int unit"
38 .Sh DESCRIPTION
39 The
40 .Fn BUS_ADD_CHILD
41 method
42 is used by the driver identify routine to add devices to the tree.
43 It can also be used to add children to buses that implement this
44 routine in other contexts, although the behavior is bus specific.
45 Please see
46 .Xr device_add_child 9
47 for more details.
48 The interface is the same as
49 .Xr device_add_child 9
50 however, the bus'
51 .Fn BUS_ADD_CHILD
52 is called.
53 .Pp
54 Buses implementing
55 .Fn BUS_ADD_CHILD
56 should insert the device into the tree using
57 .Xr device_add_child 9
58 before adding things such as their own ivars and resource lists to the device.
59 .Fn BUS_ADD_CHILD
60 is not called by
61 .Xr device_add_child 9 .
62 .Fn BUS_ADD_CHILD
63 instead calls
64 .Xr device_add_child 9 .
65 .Pp
66 A panic will result when called for a bus that does not implement
67 .Fn BUS_ADD_CHILD .
68 Some buses require a special bus-specific routine to be called instead
69 of
70 .Fn BUS_ADD_CHILD .
71 .Sh RETURN VALUES
72 The
73 .Fn BUS_ADD_CHILD
74 method returns
75 .Vt device_t
76 added to the tree, or
77 .Dv NULL
78 to indicate failure.
79 .Sh SEE ALSO
80 .Xr device 9 ,
81 .Xr device_add_child 9 ,
82 .Xr driver 9
83 .Sh AUTHORS
84 This manual page was written by
85 .An M. Warner Losh .