Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/device_get_property.9
Show All 19 Lines | ||||||||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |||||||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||||||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |||||||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||||
.\" | .\" | |||||||||
.\" $FreeBSD$ | .\" $FreeBSD$ | |||||||||
.\" | .\" | |||||||||
.Dd August 19, 2021 | .Dd January 24, 2022 | |||||||||
bz: Please update before commit. | ||||||||||
.Dt DEVICE_GET_PROPERTY 9 | .Dt DEVICE_GET_PROPERTY 9 | |||||||||
.Os | .Os | |||||||||
.Sh NAME | .Sh NAME | |||||||||
.Nm device_get_property , | .Nm device_get_property , | |||||||||
.Nm device_has_property | .Nm device_has_property | |||||||||
.Nd access device specific data | .Nd access device specific data | |||||||||
.Sh SYNOPSIS | .Sh SYNOPSIS | |||||||||
.In sys/param.h | .In sys/param.h | |||||||||
.In sys/bus.h | .In sys/bus.h | |||||||||
.Ft ssize_t | .Ft ssize_t | |||||||||
.Fn device_get_property "device_t dev" "const char *prop" "void *val" "size_t sz" | .Fn device_get_property "device_t dev" "const char *prop" "void *val" "size_t sz" \ | |||||||||
"device_property_type_t type" | ||||||||||
Done Inline ActionsAnd in this manpage. andrew: And in this manpage. | ||||||||||
.Ft bool | .Ft bool | |||||||||
.Fn device_has_property "device_t dev" "const char *prop" | .Fn device_has_property "device_t dev" "const char *prop" | |||||||||
.Sh DESCRIPTION | .Sh DESCRIPTION | |||||||||
Access device specific data provided by the parent bus. | Access device specific data provided by the parent bus. | |||||||||
Drivers can use these properties to obtain device capabilities and set | Drivers can use these properties to obtain device capabilities and set | |||||||||
necessary quirks. | necessary quirks. | |||||||||
.Pp | ||||||||||
The underlying property type is specified with the | ||||||||||
Done Inline Actions
pauamma_gundo.com: | ||||||||||
.Fa type | ||||||||||
argument. | ||||||||||
Currently the following types are supported: | ||||||||||
.Bl -tag -width ".Dv DEVICE_PROP_BUFFER" | ||||||||||
.It Dv DEVICE_PROP_BUFFER | ||||||||||
The underlying property is a string of bytes. | ||||||||||
Done Inline Actions
Or maybe "...is a string of bytes", depending on what you mean. (Would be consistent with the other types.) pauamma_gundo.com: Or maybe "...is a string of bytes", depending on what you mean. (Would be consistent with the… | ||||||||||
.It Dv DEVICE_PROP_ANY | ||||||||||
Wildcard property type. | ||||||||||
.It Dv DEVICE_PROP_UINT32 | ||||||||||
The underlying property is an array of unsigned 32 bit integers. | ||||||||||
The | ||||||||||
.Fa sz | ||||||||||
argument must be a multiple of 4. | ||||||||||
Not Done Inline Actions
pauamma_gundo.com: | ||||||||||
Not Done Inline ActionsOr "shall" if you don't want to use "must". "shall to" is ungrammatical. pauamma_gundo.com: Or "shall" if you don't want to use "must". "shall to" is ungrammatical. | ||||||||||
.It Dv DEVICE_PROP_UINT64 | ||||||||||
The underlying property is an array of unsigned 64 bit integers. | ||||||||||
The | ||||||||||
.Fa sz | ||||||||||
argument must be a multiple of 8. | ||||||||||
Not Done Inline Actions
pauamma_gundo.com: | ||||||||||
Not Done Inline ActionsSame as above. "shall", not "shall to". pauamma_gundo.com: Same as above. "shall", not "shall to". | ||||||||||
.El | ||||||||||
.Sh NOTES | .Sh NOTES | |||||||||
You can pass NULL as pointer to property's value when calling | You can pass NULL as pointer to property's value when calling | |||||||||
.Fn device_get_property | .Fn device_get_property | |||||||||
to obtain its size. | to obtain its size. | |||||||||
.Pp | .Pp | |||||||||
Currently this interface is implemented by | Currently this interface is implemented by | |||||||||
.Xr simplebus 4 | .Xr simplebus 4 | |||||||||
and | and | |||||||||
Show All 14 Lines |
Please update before commit.