Main index | Section 9 | Options |
#include <sys/bus.h>
#include <dev/ow/own.h>
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.
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.
These interfaces are implemented by the ow(4) device. Presentation layer devices (children of the newbus ow(4) device) should only call the functions described here. The functionality provided by the owc(4) device (specifically the owll(9) interface) should only be called by the ow(4) driver.
OWN (9) | July 20, 2015 |
Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Did you know that 7/5 people don't know how to use fractions? | ” |