udi_scsi_io_nak(3udi)


Indicate abnormal completion of SCSI I/O request

SYNOPSIS

#include <udi.h>

void udi_scsi_io_nak (

	udi_scsi_io_cb_t *cb,

	udi_scsi_status_t status,

	udi_buf_t *sense_buf );
 

ARGUMENTS cb is a pointer to a SCSI IO control block.

status is the status of the I/O request.

sense_buf is a pointer to the sense data buffer containing the details of a SCSI command failure if the values in status are set to indicate a CHECK CONDITION; otherwise, sense_buf must be NULL. If non-NULL, sense_buf->buf_size must equal the number of bytes of valid sense data. If there are no sense data bytes, sense_buf may be NULL.

TARGET CHANNEL The target channel for this operation is the bind channel connecting a SCSI HD to its child PD.

DESCRIPTION The udi_scsi_io_nak operation is used by an HD to indicate abnormal completion of a SCSI I/O request back to a child PD, in response to a udi_scsi_io_req operation. This operation must be used to indicate a status other than UDI_OK to the PD. The udi_scsi_io_ack operation must be used to indicate a UDI_OK status in which the exact amount of data requested was transferred.

If data_buf is not NULL, the HD must set data_buf->buf_size to the number of bytes actually transferred, which must be less than or equal to the requested size. The data_buf pointer must either be the same as in the original request, or a direct "descendant" of the original buffer (i.e. results from a chain of one or more service calls such as udi_buf_write that replace the original buffer with a modified version).

If flags in the control block include UDI_SCSI_DATA_OUT, the contents of the data buffer must be the same as in the original request. This allows the PD to retry failed operations if it so chooses.

Data in data_buf is always preserved by this channel operation.

After receiving and processing a udi_scsi_io_nak, the PD must free sense_buf, if non-NULL, by calling udi_buf_free. The HD can reclaim the sense data buffer by copying it before sending it off in the nak; in many environment implementations this will be accomplished (via copy-on-write semantics) without any actual data copy.

warnings The control block must be the same control block as passed to the HD in the corresponding udi_scsi_io_req operation.

REFERENCES udi_scsi_io_cb_t, udi_scsi_io_req, udi_scsi_io_ack


UDI SCSI Driver Specification Contents