---
name: "own"
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/own"
---

# own(9)

Dallas Semiconductor 1-Wire Network and Transport Interface

## NAME

**own**, **own\_send\_command**, **own\_command\_wait**, **own\_self\_command**, **own\_acquire\_bus**, **own** **crc**, **own\_release\_bus**, **OWN\_ACQUIRE\_BUS**, **OWN\_CRC**, **OWN\_RELEASE\_BUS**, **OWN\_SEND\_COMMAND** – Dallas Semiconductor 1-Wire Network and Transport Interface

## SYNOPSIS

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

**#include \<dev/ow/own.h\>**

*int*\

**own\_send\_command**(*device\_t pdev*, *struct ow\_cmd \*cmd*);

*int*\

**own\_command\_wait**(*device\_t pdev*, *struct ow\_cmd \*cmd*);

*int*\

**own\_self\_command**(*device\_t pdev*, *struct ow\_cmd \*cmd*, *uint8\_t xpt\_cmd*);

*int*\

**own\_acquire\_bus**(*device\_t pdev*, *int how*);

*int*\

**own\_release\_bus**(*device\_t pdev*);

*int*\

**own\_crc**(*device\_t pdev*, *uint8\_t \*buffer*, *size\_t len*);

*int*\

**OWN\_SEND\_COMMAND**(*device\_t ndev*, *device\_t pdev*, *struct ow\_cmd \*cmd*);

*int*\

**OWN\_ACQUIRE\_BUS**(*device\_t ndev*, *device\_t pdev*, *int how*);

*void*\

**OWN\_RELEASE\_BUS**(*device\_t ndev*, *device\_t pdev*);

*uint8\_t*\

**OWN\_CRC**(*device\_t ndev*, *device\_t pdev*, *uint8\_t \*buffer*, *size\_t len*);

## DESCRIPTION

The **own** interface defines three sets of functions for interacting with 1-Wire devices: sending commands, reserving the bus, and ensuring data integrity. Wrappers are provided for the raw **OWN** [kobj(9)](/kobj/9.md) interfaces and should be used for improved safety over the [kobj(9)](/kobj/9.md) ones.

### Bus Commands

The 1-Wire bus defines different layers of access to the devices on the bus. The **own** functions provide access to the network and transport layers. The network layer designates the next command as being either for all devices on the bus, or for a specific device. The network layer also specifies the speed used by the link layer.

*struct ow\_cmd* encapsulates network access, speed, and timing information. It specifies the commands to send and whether or not to read data. Its members are:

- *flags*

  Flags controlling the interpretation of the structure. These flags are defined in ⟨dev/ow/ow.h⟩:

  - OW\_FLAG\_OVERDRIVE

    Send *xpt\_cmd* bytes and read *xpt\_read* bytes at overdrive speed.

  - OW\_FLAG\_READ\_BIT

    Interpret *xpt\_read\_len* to be in bits to be read after *xpt\_cmd* rather than bytes.

- *rom\_cmd*

  ROM command bytes to send.

- *rom\_len*

  Number of ROM command bytes to send.

- *rom\_read\_len*

  Number of bytes to read after sending the ROM command.

- *rom\_read*

  Buffer for bytes read after the ROM command.

- *xpt\_cmd*

  Transport command to send.

- *xpt\_len*

  Length of the transport command bytes to send. Specify 0 for no transport command.

- *xpt\_read\_len*

  Number of bytes to read after *xpt\_cmd* bytes are sent. If the OW\_FLAG\_READ\_BIT bit is set in *flags*, then it is the number of bits to read. Bits read are packed into bytes.

- *xpt\_read*

  Buffer for data read.

**own\_command\_wait**() acquires the 1-Wire bus, waiting if necessary, sends the command, and then releases the bus. **own\_send\_command**() sends the command without bus reservation. *pdev* is the client device (the presentation layer device) sending the command. The *cmd* argument describes the transaction to send to the 1-Wire bus.

**own\_self\_command**() fills in *cmd* with a MATCH\_ROM ROM command, the ROM address of *pdev* and the *xpt\_cmd* as a convenient way to create directed commands.

### Bus Reservation

The 1-Wire system includes an advisory lock for the bus that presentation layer devices can use to coordinate access. Locking is purely advisory at this time.

**own\_acquire\_bus**() reserves the bus. It waits indefinitely if the *how* argument is OWN\_WAIT and returns the error EWOULDBLOCK if passed OWN\_DONTWAIT when the bus is owned by another client.

**own\_release\_bus**() releases the bus.

### Data Integrity

**own\_crc**() computes the 1-Wire standard CRC function over the data passed in *buffer* and *len* and returns the result.

### Notes

The 1-Wire standard (Maxim AN937) defines layers that are akin to ISO networking layers. The lowest relevant layer, the link layer, defines the polling windows and the timing of the signaling of different modes. The network layer is built on top of the link layer and is used to address devices in a unicast or multicast manner. The transport layer defines commands and responses from the devices. The presentation layer is composed of the device specific commands and actions used to control the specific 1-Wire devices on bus.

These interfaces are implemented by the [ow(4)](/ow/4.md) device. Presentation layer devices (children of the newbus [ow(4)](/ow/4.md) device) should only call the functions described here. The functionality provided by the [owc(4)](/owc/4.md) device (specifically the [owll(9)](/owll/9.md) interface) should only be called by the [ow(4)](/ow/4.md) driver.

## SEE ALSO

[ow(4)](/ow/4.md), [owc(4)](/owc/4.md), [owll(9)](/owll/9.md) *https://pdfserv.maximintegrated.com/en/an/AN937.pdf*

## LEGAL

1-Wire is a registered trademark of Maxim Integrated Products, Inc.

## HISTORY

The **own** driver first appeared in FreeBSD 11.0.

## AUTHORS

The **own** device driver and this manual page were written by Warner Losh.
