xref: /freebsd/share/man/man9/BUS_GET_PROPERTY.9 (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1.\" -
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2021 Semihalf
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.Dd February 18, 2022
27.Dt BUS_GET_PROPERTY 9
28.Os
29.Sh NAME
30.Nm BUS_GET_PROPERTY
31.Nd get child's specific property
32.Sh SYNOPSIS
33.In sys/param.h
34.In sys/bus.h
35.Ft ssize_t
36.Fn BUS_GET_PROPERTY "device_t dev" "device_t child" "const char *propname" \
37    "void *propvalue" "size_t size" "device_property_type_t type"
38.Sh DESCRIPTION
39The
40.Fn BUS_GET_PROPERTY
41method
42is called from driver code which wants to access a child's specific data stored
43on the bus.
44A property has a name and an associated value.
45Implementation shall copy to
46.Fa propvalue
47at most
48.Fa size
49bytes.
50.Pp
51.Fn BUS_GET_PROPERTY
52supports different property types specified via the
53.Fa type
54argument.
55The
56.Fa size
57is guaranteed to be a multiple of the underlying property type.
58If a type is not supported,
59.Fn BUS_GET_PROPERTY
60shall return -1.
61.Sh NOTES
62If
63.Fa propvalue
64is NULL or
65.Fa size
66is zero, the implementation shall return only the size of the property.
67.Sh RETURN VALUES
68The property size if successful, otherwise -1.
69.Sh SEE ALSO
70.Xr device 9 ,
71.Xr device_get_property 9
72.Sh AUTHORS
73This manual page was written by
74.An Bartlomiej Grzesik .
75