Next: Device Map, Previous: Device Read, Up: Device Interface
The function
device_write
writes data_count bytes from the buffer data to device. The number of bytes actually written is returned in bytes_written.If mode is
D_NOWAIT
, the function returns without waiting for I/O completion. Otherwise mode should be 0. recnum is the record number to be written, its meaning is device specific.The function returns
D_SUCCESS
if some data was successfully written andD_NO_SUCH_DEVICE
if device does not denote a device port or the device is dead or not completely open.
The
device_write_inband
function works as thedevice_write
function, except that the data is sent “in-line” in the request IPC message (see Memory).
This is the asynchronous form of the
device_write
function.device_write_request
performs the write request. The meaning for the parameters is as indevice_write
. Additionally, the caller has to supply a reply port to which theds_device_write_reply
message is sent by the kernel when the write has been performed. The return value of the write operation is stored in return_code.As neither function receives a reply message, only message transmission errors apply. If no error occurs,
KERN_SUCCESS
is returned.
The
device_write_request_inband
andds_device_write_reply_inband
functions work as thedevice_write_request
andds_device_write_reply
functions, except that the data is sent “in-line” in the request IPC message (see Memory).