---
name: "device"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/device"
---

# device(9)

an abstract representation of a device

## NAME

**device** – an abstract representation of a device

## SYNOPSIS

*typedef* *struct* *device* *\*device\_t*;

## DESCRIPTION

The device object represents a piece of hardware attached to the system such as an expansion card, the bus which that card is plugged into, disk drives attached to the expansion card etc. The system defines one device, *root\_bus* and all other devices are created dynamically during autoconfiguration. Normally devices representing top-level busses in the system (ISA, PCI etc.) will be attached directly to *root\_bus* and other devices will be added as children of their relevant bus.

The devices in a system form a tree. All devices except *root\_bus* have a parent (see [device\_get\_parent(9)](/device_get_parent/9.md)). In addition, any device can have children attached to it (see [device\_add\_child(9)](/device_add_child/9.md), [device\_add\_child\_ordered(9)](/device_add_child_ordered/9.md), [device\_find\_child(9)](/device_find_child/9.md), [device\_get\_children(9)](/device_get_children/9.md), and [device\_delete\_child(9)](/device_delete_child/9.md)).

A device which has been successfully probed and attached to the system will also have a driver (see [device\_get\_driver(9)](/device_get_driver/9.md) and [driver(9)](/driver/9.md)) and a devclass (see [device\_get\_devclass(9)](/device_get_devclass/9.md) and [devclass(9)](/devclass/9.md)). Various other attributes of the device include a unit number (see [device\_get\_unit(9)](/device_get_unit/9.md)), verbose description (normally supplied by the driver, see [device\_set\_desc(9)](/device_set_desc/9.md) and [device\_get\_desc(9)](/device_get_desc/9.md)), a set of bus-specific variables (see [device\_get\_ivars(9)](/device_get_ivars/9.md)) and a set of driver-specific variables (see [device\_get\_softc(9)](/device_get_softc/9.md)).

Devices can be in one of several states:

- DS\_NOTPRESENT

  the device has not been probed for existence or the probe failed

- DS\_ALIVE

  the device probe succeeded but not yet attached

- DS\_ATTACHED

  the device has been successfully attached

- DS\_BUSY

  the device is currently open

The current state of the device can be determined by calling [device\_get\_state(9)](/device_get_state/9.md).

## SEE ALSO

[devclass(9)](/devclass/9.md), [driver(9)](/driver/9.md)

## AUTHORS

This manual page was written by Doug Rabson.
