---
name: "device_get_property"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/device_get_property"
---

# device\_get\_property(9)

access device specific data

## NAME

**device\_get\_property**, **device\_has\_property** – access device specific data

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/bus.h\>**

*ssize\_t*\

**device\_get\_property**(*device\_t dev*, *const char \*prop*, *void \*val*, *size\_t sz*, *device\_property\_type\_t type*);

*bool*\

**device\_has\_property**(*device\_t dev*, *const char \*prop*);

## DESCRIPTION

Access device specific data provided by the parent bus. Drivers can use these properties to obtain device capabilities and set necessary quirks.

The underlying property type is specified with the *type* argument. Currently the following types are supported:

- DEVICE\_PROP\_BUFFER

  The underlying property is a string of bytes.

- DEVICE\_PROP\_ANY

  Wildcard property type.

- DEVICE\_PROP\_HANDLE

  Following a reference the underlying property is a handle of the respective bus.

- DEVICE\_PROP\_UINT32

  The underlying property is an array of unsigned 32 bit integers. The *sz* argument shall be a multiple of 4.

- DEVICE\_PROP\_UINT64

  The underlying property is an array of unsigned 64 bit integers. The *sz* argument shall be a multiple of 8.

## NOTES

You can pass NULL as pointer to property's value when calling **device\_get\_property**() to obtain its size.

Currently this interface is implemented by [simplebus(4)](/simplebus/4.md) and [acpi(4)](/acpi/4.md).

## RETURN VALUES

**device\_get\_property**() if successful returns property's size, otherwise returns -1.

**device\_has\_property**() returns true if given property was found.

## SEE ALSO

[acpi(4)](/acpi/4.md), [simplebus(4)](/simplebus/4.md), [device(9)](/device/9.md)

## AUTHORS

This manual page was written by Bartlomiej Grzesik.
