Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SCSI Command Processing

Functions

ocs_ramd_hndlr_rtn_e ocs_ramd_mode_sense6 (ocs_io_t *io, uint8_t cdb[])
 Process SCSI Mode Sense 6 command. More...
 
ocs_ramd_hndlr_rtn_e ocs_ramd_mode_sense10 (ocs_io_t *io, uint8_t cdb[])
 Process SCSI Mode Sense 10 command. More...
 
ocs_ramd_hndlr_rtn_e ocs_ramd_good_status (ocs_io_t *io)
 Send a good SCSI status. More...
 
ocs_ramd_hndlr_rtn_e ocs_ramd_check_cond (ocs_io_t *io, uint8_t sense_key, uint8_t asc, uint8_t ascq)
 Send a SCSI check condition. More...
 
ocs_ramd_hndlr_rtn_e ocs_ramd_task_set_full_or_busy (ocs_io_t *io)
 Send a SCSI task set full or busy status. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write6 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE (6) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write12 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE (12) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write32 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE (32) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_long10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE LONG (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_long16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE LONG (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE SAME (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE SAME (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same32 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE SAME (32) command. More...
 
static int32_t ocs_ramd_first_burst_local (ocs_io_t *io, uint32_t bytes_left)
 Process first burst data into the IO DMA memory. More...
 
static int32_t ocs_ramd_first_burst_no_dif (ocs_io_t *io, ocs_ramdisc_t *ramdisc)
 Process the first burst data without any DIF information. More...
 
static void ocs_ramd_set_dif_prot_type_fields (ocs_t *ocs, ocs_ramdisc_t *ramdisc, ocs_scsi_dif_info_t *dif_info)
 Set the Disable App and reference fields based on the protection type. More...
 
static int32_t ocs_ramd_first_burst_with_dif (ocs_io_t *io, ocs_ramdisc_t *ramdisc, uint32_t data_blk_size)
 Process the first burst data by adding/verifying/stripping DIF information. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_common (ocs_io_t *io, uint64_t lba, uint32_t block_count, uint8_t wrprotect, uint32_t app_tag, uint32_t ref_tag)
 Common code for all SCSI WRITE commands. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_long_common (ocs_io_t *io, uint64_t lba, uint16_t xfer_len, uint8_t cor_dis, uint8_t wr_uncor, uint8_t pblock)
 Common code for all SCSI WRITE LONG commands. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same_common (ocs_io_t *io, uint64_t lba, uint32_t block_count, uint8_t wrprotect, uint8_t pbdata, uint8_t lbdata, uint32_t app_tag, uint32_t ref_tag)
 Common code for all SCSI WRITE SAME commands. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_complete_write_same (ocs_io_t *io)
 Command completion for the SCSI WRITE SAME command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read6 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ (6) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read12 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ (12) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read32 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ (32) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_long10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ LONG (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_long16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ LONG (16) command. More...
 
static int32_t ocs_ramd_data_phase_start (ocs_io_t *io)
 Common code to start a SCSI data phase once the IO has been set up. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_common (ocs_io_t *io, uint64_t lba, uint32_t block_count, uint8_t rdprotect, uint32_t app_tag, uint32_t ref_tag)
 Common code used for all SCSI READ commands. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_long_common (ocs_io_t *io, uint64_t lba, uint16_t xfer_len, uint8_t pblock, uint8_t corrct)
 Common code used for all SCSI READ commands. More...
 
static uint32_t scsi_validate_format_unit (ocs_io_t *io)
 Validate a FORMAT UNIT parameter list. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_format_unit (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI FORMAT UNIT command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_capacity10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ CAPACITY (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_capacity16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ CAPACITY (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_inquiry (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI INQUIRY command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_request_sense (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI REQUEST SENSE command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_test_unit_ready (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI TEST UNIT READY command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_reserve_release (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI RESERVE or RELEASE command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_report_luns (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI REPORT LUNS command. More...
 
static uint32_t scsi_validate_mode_select (ocs_io_t *io)
 Validate a MODE SELECT parameter list. More...
 
static int32_t scsi_mode_select_cb (ocs_io_t *io, ocs_scsi_io_status_e scsi_status, uint32_t flags, void *arg)
 Command data phase callback for the MODE SELECT command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_mode_select (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI MODE SELECT command. More...
 
static int32_t ocs_ramd_abort_node_tasks (ocs_node_t *node, ocs_io_t *myio)
 Abort all tasks associated with a node. More...
 
static int32_t ocs_ramd_abort_node_tasks_lun (ocs_node_t *node, uint32_t lun, ocs_io_t *myio)
 Abort tasks associated with a given node and LUN. More...
 

Function Details

static int32_t ocs_ramd_abort_node_tasks ( ocs_node_t *  node,
ocs_io_t *  myio 
)
static

Abort all tasks associated with a node.

Description
All the IOs associated with the node are aborted.
Parameters
nodePointer to the remote node.
myioPointer to the IO requesting the abort.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 6486 of file ocs_ramd.c.

static int32_t ocs_ramd_abort_node_tasks_lun ( ocs_node_t *  node,
uint32_t  lun,
ocs_io_t *  myio 
)
static

Abort tasks associated with a given node and LUN.

Description
The tasks associated with a node and lun are aborted.
Parameters
nodePointer to the node.
lunLUN value.
myioPointer to the IO requesting the abort.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 6539 of file ocs_ramd.c.

ocs_ramd_hndlr_rtn_e ocs_ramd_check_cond ( ocs_io_t *  io,
uint8_t  sense_key,
uint8_t  asc,
uint8_t  ascq 
)

Send a SCSI check condition.

Description
A SCSI check condition response is sent to the initiator associated with the IO.
Parameters
ioPointer to the IO context.
sense_keySCSI response sense key.
ascSCSI response ASC value.
ascqSCSI response ASCA value.
Returns
Returns SCSI_HANDLER_RESP_STARTED on success, or SCSI_HANDLER_NOT_STARTED on error.

Definition at line 2551 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_complete_write_same ( ocs_io_t *  io)
static

Command completion for the SCSI WRITE SAME command.

Description
This function is called when the data phase for the WRITE SAME command has completed. At this point, a single block has been transfered to the target and written to the ramdisc. The remaining actions involve copying that block, possibly with modifications, to other blocks on the ramdisc.

Note: This function must call either ocs_ramd_check_cond or ocs_ramd_status_good.
Parameters
ioPointer to the IO context.
Returns
Returns SCSI_HANDLER_NOT_STARTED if an error occurs, or SCSI_HANDLER_RESP_STARTED if a response (either STATUS GOOD or CHECK CONDITION) has been sent.

Definition at line 4245 of file ocs_ramd.c.

static int32_t ocs_ramd_data_phase_start ( ocs_io_t *  io)
static

Common code to start a SCSI data phase once the IO has been set up.

Parameters
ioPointer to the IO context.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 4662 of file ocs_ramd.c.

static int32_t ocs_ramd_first_burst_local ( ocs_io_t *  io,
uint32_t  bytes_left 
)
static

Process first burst data into the IO DMA memory.

Parameters
ioPointer to the IO context.
bytes_leftThe number of first burst bytes received.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 3520 of file ocs_ramd.c.

static int32_t ocs_ramd_first_burst_no_dif ( ocs_io_t *  io,
ocs_ramdisc_t *  ramdisc 
)
static

Process the first burst data without any DIF information.

Parameters
ioPointer to the IO context.
ramdiscPointer to the ramdisc structure.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 3550 of file ocs_ramd.c.

static int32_t ocs_ramd_first_burst_with_dif ( ocs_io_t *  io,
ocs_ramdisc_t *  ramdisc,
uint32_t  data_blk_size 
)
static

Process the first burst data by adding/verifying/stripping DIF information.

Parameters
ioPointer to the IO context.
ramdiscPointer to the ramdisc structure.
data_blk_sizeSize of the block without any DIF.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 3665 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_format_unit ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI FORMAT UNIT command.

Description
The SCSI FORMAT UNIT command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 5156 of file ocs_ramd.c.

ocs_ramd_hndlr_rtn_e ocs_ramd_good_status ( ocs_io_t *  io)

Send a good SCSI status.

Description
A good SCSI status is sent to the initiator associated with the IO.
Parameters
ioPointer to the IO context.
Returns
Returns SCSI_HANDLER_RESP_STARTED on success, or SCSI_HANDLER_NOT_STARTED on error.

Definition at line 2519 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_inquiry ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI INQUIRY command.

Description
The SCSI INQUIRY command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 5692 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_mode_select ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI MODE SELECT command.

Description
The SCSI MODE SELECT command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 6411 of file ocs_ramd.c.

ocs_ramd_hndlr_rtn_e ocs_ramd_mode_sense10 ( ocs_io_t *  io,
uint8_t  cdb[] 
)

Process SCSI Mode Sense 10 command.

The SCSI Mode Sense 10 command is processed

Parameters
iopointer to IO context
cdbpointer to SCSI cdb
Returns
returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 396 of file mode_sense.c.

ocs_ramd_hndlr_rtn_e ocs_ramd_mode_sense6 ( ocs_io_t *  io,
uint8_t  cdb[] 
)

Process SCSI Mode Sense 6 command.

The SCSI Mode Sense 6 command is processed

Parameters
iopointer to IO context
cdbpointer to SCSI cdb
Returns
returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 379 of file mode_sense.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read10 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI READ (10) command.

Description
The SCSI READ (10) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4383 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read12 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI READ (12) command.

Description
The SCSI READ (12) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4422 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read16 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI READ (16) command.

Description
The SCSI READ (16) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4462 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read32 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI READ (32) command.

Description
The SCSI READ (32) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4506 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read6 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI READ (6) command.

Description
The SCSI READ (6) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4339 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read_capacity10 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI READ CAPACITY (10) command.

Description
The SCSI READ CAPACITY (10) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 5280 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read_capacity16 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI READ CAPACITY (16) command.

Description
The SCSI READ CAPACITY (16) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 5367 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read_common ( ocs_io_t *  io,
uint64_t  lba,
uint32_t  block_count,
uint8_t  rdprotect,
uint32_t  app_tag,
uint32_t  ref_tag 
)
static

Common code used for all SCSI READ commands.

Description
The SCSI READ command is processed.
Parameters
ioPointer to the IO context.
lbaStarting LBA for the transfer.
block_countNumber of blocks to transfer.
rdprotectValue of the RDPROTECT field in the CDB.
app_tagValue of the APPLICATION TAG to expect.
ref_tagValue of the REFERENCE TAG to expect for the first block.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4768 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read_long10 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI READ LONG (10) command.

Description
The SCSI READ LONG (10) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4574 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read_long16 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI READ LONG (16) command.

Description
The SCSI READ LONG (16) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4618 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_read_long_common ( ocs_io_t *  io,
uint64_t  lba,
uint16_t  xfer_len,
uint8_t  pblock,
uint8_t  corrct 
)
static

Common code used for all SCSI READ commands.

Description
The SCSI READ command is processed.
Parameters
ioPointer to the IO context.
lbaStarting LBA for the transfer.
xfer_lenTransfer length, in bytes.
pblockPhysical block bit from the CDB.
corrctCorrection bit from the CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4926 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_report_luns ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI REPORT LUNS command.

Description
The SCSI REPORT LUNS command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 6161 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_request_sense ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI REQUEST SENSE command.

Description
The SCSI REQUEST SENSE command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 6041 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_reserve_release ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI RESERVE or RELEASE command.

Description
The SCSI RESERVE or RELEASE command is processed. This is only a stub however and always returns a good status with no actual reservation being made.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_CMD_NOT_SUPPORTED is an error and the IO should be freed.

Definition at line 6128 of file ocs_ramd.c.

static void ocs_ramd_set_dif_prot_type_fields ( ocs_t *  ocs,
ocs_ramdisc_t *  ramdisc,
ocs_scsi_dif_info_t *  dif_info 
)
static

Set the Disable App and reference fields based on the protection type.

Parameters
ocsPointer to the ocs structure.
ramdiscPointer to the ramdisc structure.
dif_infoPointer to the DIF information structure for an IO.

Definition at line 3618 of file ocs_ramd.c.

ocs_ramd_hndlr_rtn_e ocs_ramd_task_set_full_or_busy ( ocs_io_t *  io)

Send a SCSI task set full or busy status.

Description
A SCSI task set full or busy response is sent, depending on whether another IO is already active on the LUN.
Parameters
ioPointer to the IO context.
Returns
Returns SCSI_HANDLER_RESP_STARTED on success or SCSI_HANDLER_NOT_STARTED on error.

Definition at line 2599 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_test_unit_ready ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI TEST UNIT READY command.

Description
The SCSI TEST UNIT READY command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 6102 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write10 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI WRITE (10) command.

Description
The SCSI WRITE (10) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 3022 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write12 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI WRITE (12) command.

Description
The SCSI WRITE (12) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 3066 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write16 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI WRITE (16) command.

Description
The SCSI WRITE (16) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 3112 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write32 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI WRITE (32) command.

Description
The SCSI WRITE (32) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 3162 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write6 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI WRITE (6) command.

Description
The SCSI WRITE (6) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 2968 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write_common ( ocs_io_t *  io,
uint64_t  lba,
uint32_t  block_count,
uint8_t  wrprotect,
uint32_t  app_tag,
uint32_t  ref_tag 
)
static

Common code for all SCSI WRITE commands.

Description
The SCSI WRITE command is processed.
Parameters
ioPointer to the IO context.
lbaStarting LBA for the transfer.
block_countNumber of blocks to transfer.
wrprotectValue of the WRPROTECT field in the CDB.
ref_tagValue of the REFERENCE TAG to write for the first block.
app_tagValue of the APPLICATION TAG to write.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 3975 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write_long10 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI WRITE LONG (10) command.

Description
The SCSI WRITE LONG (10) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 3244 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write_long16 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI WRITE LONG (16) command.

Description
The SCSI WRITE LONG (16) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 3291 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write_long_common ( ocs_io_t *  io,
uint64_t  lba,
uint16_t  xfer_len,
uint8_t  cor_dis,
uint8_t  wr_uncor,
uint8_t  pblock 
)
static

Common code for all SCSI WRITE LONG commands.

Description
The SCSI WRITE LONG command is processed.
Parameters
ioPointer to the IO context.
lbaStarting LBA for the transfer.
xfer_lenTransfer length, in bytes.
cor_disCorrection disabled bit from the CDB.
wr_uncorWrite uncorrectable bit from the CDB.
pblockPhysical block bit from the CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4065 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same10 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI WRITE SAME (10) command.

Description
The SCSI WRITE SAME (10) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 3343 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same16 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI WRITE SAME (16) command.

Description
The SCSI WRITE SAME (16) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 3390 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same32 ( ocs_io_t *  io,
uint8_t  cdb[] 
)
static

Process the SCSI WRITE SAME (32) command.

Description
The SCSI WRITE SAME (32) command is processed.
Parameters
ioPointer to the IO context.
cdbPointer to the SCSI CDB.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 3443 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same_common ( ocs_io_t *  io,
uint64_t  lba,
uint32_t  block_count,
uint8_t  wrprotect,
uint8_t  pbdata,
uint8_t  lbdata,
uint32_t  app_tag,
uint32_t  ref_tag 
)
static

Common code for all SCSI WRITE SAME commands.

Description
The SCSI WRITE SAME command is processed.
Parameters
ioPointer to the IO context.
lbaStarting LBA for the transfer.
block_countNumber of blocks to be written to the media.
wrprotectWRPROTECT value from the CDB.
pbdataPBDATA bit from the CDB.
lbdataLBDATA bit from the CDB.
ref_tagValue of the REFERENCE TAG to write for the first block.
app_tagValue of the APPLICATION TAG to write.
Returns
Returns the handler status for the command. SCSI_HANDLER_NOT_STARTED and SCSI_CMD_NOT_SUPPORTED are errors and the IO should be freed.

Definition at line 4135 of file ocs_ramd.c.

static int32_t scsi_mode_select_cb ( ocs_io_t *  io,
ocs_scsi_io_status_e  scsi_status,
uint32_t  flags,
void *  arg 
)
static

Command data phase callback for the MODE SELECT command.

Description
This function is called when the SCSI command data phase has completed following a MODE SELECT command.
Parameters
ioPointer to the IO structure.
scsi_statusCompletion status.
flagsFlags.
argApplication-specified argument.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 6371 of file ocs_ramd.c.

static uint32_t scsi_validate_format_unit ( ocs_io_t *  io)
static

Validate a FORMAT UNIT parameter list.

Description
Called after a FORMAT UNIT data out phase has completed. This function validates the contents of the parameter list. If the parameter list is valid, the function takes the appropriate action and returns 0. If the parameter list is not valid, the function returns a sense key, code, and qualifier to be returned to the initiator in a CHECK CONDITION.
Parameters
ioPointer to the IO context.
Returns
Returns 0 for success; or a non-zero sense key, code, and qualifier for failure.

Definition at line 4974 of file ocs_ramd.c.

static uint32_t scsi_validate_mode_select ( ocs_io_t *  io)
static

Validate a MODE SELECT parameter list.

Description
Called after a MODE SELECT data out phase has completed. This function validates the contents of the parameter list. If the parameter list is valid, it takes the appropriate action and returns 0. If the parameter list is not valid, the function returns a sense key, code, and qualifier to be returned to the initiator in a CHECK CONDITION.
Parameters
ioPointer to the IO context.
Returns
Returns 0 on success; or a non-zero sense key, code, and qualifier on failure.

Definition at line 6282 of file ocs_ramd.c.