Writing Device Drivers

Accessing Target Devices

This section describes the LDI kernel interfaces for accessing target devices. These interfaces enable a kernel device consumer to perform operations on the target device specified by the layered driver handle. Kernel device consumers can perform operations such as read, write, strategy, and ioctl on the target device.

ldi_handle_t

Layered driver handle for target device access. An opaque data structure.

ldi_read(9F)

Pass a read request to the device entry point for the target device. This operation is supported for block, character, and STREAMS devices.

ldi_aread(9F)

Pass an asynchronous read request to the device entry point for the target device. This operation is supported for block and character devices.

ldi_write(9F)

Pass a write request to the device entry point for the target device. This operation is supported for block, character, and STREAMS devices.

ldi_awrite(9F)

Pass an asynchronous write request to the device entry point for the target device. This operation is supported for block and character devices.

ldi_strategy(9F)

Pass a strategy request to the device entry point for the target device. This operation is supported for block and character devices.

ldi_dump(9F)

Pass a dump request to the device entry point for the target device. This operation is supported for block and character devices.

ldi_poll(9F)

Pass a poll request to the device entry point for the target device. This operation is supported for block, character, and STREAMS devices.

ldi_ioctl(9F)

Pass an ioctl request to the device entry point for the target device. This operation is supported for block, character, and STREAMS devices. The LDI supports STREAMS linking and STREAMS ioctl commands. See the “STREAM IOCTLS” section of the ldi_ioctl(9F) man page. See also the ioctl commands in the streamio(7I) man page.

ldi_devmap(9F)

Pass a devmap request to the device entry point for the target device. This operation is supported for block and character devices.

ldi_getmsg(9F)

Get a message block from a stream.

ldi_putmsg(9F)

Put a message block on a stream.