Functions | |
| static uint32_t | ocs_fc_getbe32 (void *p) |
| Returns a big-endian 32-bit value given a pointer. More... | |
| void | ocs_scsi_io_alloc_enable (ocs_node_t *node) |
| Enable IO allocation. More... | |
| void | ocs_scsi_io_alloc_disable (ocs_node_t *node) |
| Disable IO allocation. More... | |
| int32_t | ocs_scsi_io_alloc_enabled (ocs_node_t *node) |
| Get state of IO allocation. More... | |
| ocs_io_t * | ocs_scsi_io_alloc (ocs_node_t *node, ocs_scsi_io_role_e role) |
| Allocate a SCSI IO context. More... | |
| static void | _ocs_scsi_io_free (void *arg) |
| Free a SCSI IO context (internal). More... | |
| void | ocs_scsi_io_free (ocs_io_t *io) |
| Free a SCSI IO context. More... | |
| static int32_t | ocs_scsi_convert_dif_info (ocs_t *ocs, ocs_scsi_dif_info_t *scsi_dif_info, ocs_hal_dif_info_t *hal_dif_info) |
| Convert SCSI API T10 DIF information into the FC HAL format. More... | |
| static void | ocs_log_sgl (ocs_io_t *io) |
| This function logs the SGLs for an IO. More... | |
| static int32_t | ocs_scsi_xfer_data (ocs_io_t *io, uint32_t flags, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint64_t xwire_len, ocs_hal_io_type_e type, int enable_ar, ocs_scsi_io_cb_t cb, void *arg) |
| Send read/write data. More... | |
| static void | ocs_scsi_io_free_ovfl (ocs_io_t *io) |
| Free overflow SGL. More... | |
| int32_t | ocs_scsi_send_resp (ocs_io_t *io, uint32_t flags, ocs_scsi_cmd_resp_t *rsp, ocs_scsi_io_cb_t cb, void *arg) |
| Send response data. More... | |
| int32_t | ocs_scsi_send_tmf_resp (ocs_io_t *io, ocs_scsi_tmf_resp_e rspcode, uint8_t addl_rsp_info[3], ocs_scsi_io_cb_t cb, void *arg) |
| Send TMF response data. More... | |
| int32_t | ocs_scsi_tgt_abort_io (ocs_io_t *io, bool send_abts, ocs_scsi_io_cb_t cb, void *arg) |
| Abort a target IO. More... | |
| void | ocs_scsi_io_complete (ocs_io_t *io) |
| Notify the base driver that the IO is complete. More... | |
| int32_t | ocs_scsi_send_rd_io (ocs_node_t *node, ocs_io_t *io, uint32_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, ocs_scsi_rsp_io_cb_t cb, void *arg) |
| Initiate initiator read IO. More... | |
| int32_t | ocs_scsi_send_wr_io (ocs_node_t *node, ocs_io_t *io, uint32_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, ocs_scsi_rsp_io_cb_t cb, void *arg) |
| Initiate initiator write IO. More... | |
| int32_t | ocs_scsi_send_wr_io_first_burst (ocs_node_t *node, ocs_io_t *io, uint32_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, uint32_t first_burst, ocs_scsi_rsp_io_cb_t cb, void *arg) |
| Initiate initiator write IO. More... | |
| int32_t | ocs_scsi_send_nodata_io (ocs_node_t *node, ocs_io_t *io, uint32_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_rsp_io_cb_t cb, void *arg) |
| Initiate initiator SCSI command with no data. More... | |
| int32_t | ocs_scsi_send_tmf (ocs_node_t *node, ocs_io_t *io, ocs_io_t *io_to_abort, uint32_t lun, ocs_scsi_tmf_cmd_e tmf, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t len, ocs_scsi_rsp_io_cb_t cb, void *arg) |
| Initiate initiator task management operation. More... | |
| static int32_t | ocs_scsi_send_io (ocs_hal_io_type_e type, ocs_node_t *node, ocs_io_t *io, uint32_t lun, ocs_scsi_tmf_cmd_e tmf, uint8_t *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, uint32_t first_burst, ocs_scsi_rsp_io_cb_t cb, void *arg) |
| Send an FCP IO. More... | |
| static int32_t | ocs_scsi_abort_io_cb (struct ocs_hal_io_s *hio, ocs_remote_node_t *rnode, uint32_t len, int32_t status, uint32_t ext_status, void *arg) |
| Callback for an aborted IO. More... | |
| uint32_t | ocs_scsi_get_property (ocs_t *ocs, ocs_scsi_property_e prop) |
| Return SCSI API integer valued property. More... | |
| void * | ocs_scsi_get_property_ptr (ocs_t *ocs, ocs_scsi_property_e prop) |
| Return a property pointer. More... | |
| void | ocs_scsi_del_initiator_complete (ocs_node_t *node) |
| Notify that delete initiator is complete. More... | |
| void | ocs_scsi_del_target_complete (ocs_node_t *node) |
| Notify that delete target is complete. More... | |
|
static |
Free a SCSI IO context (internal).
| arg | Pointer to the IO context. |
Definition at line 269 of file ocs_scsi.c.
|
inlinestatic |
Returns a big-endian 32-bit value given a pointer.
| p | Pointer to the 32-bit big-endian location. |
Definition at line 103 of file ocs_scsi.c.
|
static |
This function logs the SGLs for an IO.
| io | Pointer to the IO context. |
Definition at line 947 of file ocs_scsi.c.
|
static |
Callback for an aborted IO.
| hio | HAL IO context. |
| rnode | Remote node. |
| len | Response length. |
| status | Completion status. |
| ext_status | Extended completion status. |
| arg | Application-specific callback, usually IO context. |
Definition at line 2734 of file ocs_scsi.c.
|
static |
Convert SCSI API T10 DIF information into the FC HAL format.
| ocs | Pointer to the ocs structure for logging. |
| scsi_dif_info | Pointer to the SCSI API T10 DIF fields. |
| hal_dif_info | Pointer to the FC HAL API T10 DIF fields. |
Definition at line 837 of file ocs_scsi.c.
| void ocs_scsi_del_initiator_complete | ( | ocs_node_t * | node | ) |
Notify that delete initiator is complete.
| node | Pointer to the node. |
Definition at line 2964 of file ocs_scsi.c.
| void ocs_scsi_del_target_complete | ( | ocs_node_t * | node | ) |
Notify that delete target is complete.
| node | Pointer to the node. |
Definition at line 2985 of file ocs_scsi.c.
| uint32_t ocs_scsi_get_property | ( | ocs_t * | ocs, |
| ocs_scsi_property_e | prop | ||
| ) |
Return SCSI API integer valued property.
| ocs | Pointer to the ocs. |
| prop | Property value to return. |
Definition at line 2799 of file ocs_scsi.c.
| void* ocs_scsi_get_property_ptr | ( | ocs_t * | ocs, |
| ocs_scsi_property_e | prop | ||
| ) |
Return a property pointer.
| ocs | Pointer to the ocs. |
| prop | Property value to return. |
Definition at line 2871 of file ocs_scsi.c.
| ocs_io_t* ocs_scsi_io_alloc | ( | ocs_node_t * | node, |
| ocs_scsi_io_role_e | role | ||
| ) |
Allocate a SCSI IO context.
node. This function is called by an initiator-client when issuing SCSI commands to remote target devices. On completion, ocs_scsi_io_free() is called. | node | Pointer to the associated node structure. |
| role | Role for IO (originator/responder). |
Definition at line 192 of file ocs_scsi.c.
| void ocs_scsi_io_alloc_disable | ( | ocs_node_t * | node | ) |
Disable IO allocation.
| node | Pointer to node object |
Definition at line 144 of file ocs_scsi.c.
| void ocs_scsi_io_alloc_enable | ( | ocs_node_t * | node | ) |
Enable IO allocation.
| node | Pointer to node object. |
Definition at line 122 of file ocs_scsi.c.
| int32_t ocs_scsi_io_alloc_enabled | ( | ocs_node_t * | node | ) |
Get state of IO allocation.
| node | Pointer to node object |
Definition at line 160 of file ocs_scsi.c.
| void ocs_scsi_io_complete | ( | ocs_io_t * | io | ) |
Notify the base driver that the IO is complete.
| io | Pointer to IO context. |
Definition at line 2158 of file ocs_scsi.c.
| void ocs_scsi_io_free | ( | ocs_io_t * | io | ) |
Free a SCSI IO context.
| io | Pointer to the IO context. |
Definition at line 317 of file ocs_scsi.c.
|
static |
Free overflow SGL.
| io | Pointer to IO object. |
Definition at line 1660 of file ocs_scsi.c.
|
static |
Send an FCP IO.
node.| type | HAL IO type to send. |
| node | Pointer to the node destination of the IO. |
| io | Pointer to the IO context. |
| lun | LUN value. |
| tmf | Task management command. |
| cdb | Pointer to the SCSI CDB. |
| cdb_len | Length of the CDB, in bytes. |
| dif_info | Pointer to the T10 DIF fields, or NULL if no DIF. |
| sgl | Pointer to the scatter-gather list. |
| sgl_count | Number of SGL entries in SGL. |
| wire_len | Payload length, in bytes, of data on wire. |
| first_burst | Number of first burst bytes to send. |
| cb | Completion callback. |
| arg | Application-specified completion callback argument. |
Definition at line 2549 of file ocs_scsi.c.
| int32_t ocs_scsi_send_nodata_io | ( | ocs_node_t * | node, |
| ocs_io_t * | io, | ||
| uint32_t | lun, | ||
| void * | cdb, | ||
| uint32_t | cdb_len, | ||
| ocs_scsi_rsp_io_cb_t | cb, | ||
| void * | arg | ||
| ) |
Initiate initiator SCSI command with no data.
cb is invoked and passed request status. If the command completed successfully, the callback is given SCSI response data.| node | Pointer to the node. |
| io | Pointer to the IO context. |
| lun | LUN value. |
| cdb | Pointer to the CDB. |
| cdb_len | Length of the CDB. |
| cb | Completion callback. |
| arg | Application-specified completion callback argument. |
Definition at line 2445 of file ocs_scsi.c.
| int32_t ocs_scsi_send_rd_io | ( | ocs_node_t * | node, |
| ocs_io_t * | io, | ||
| uint32_t | lun, | ||
| void * | cdb, | ||
| uint32_t | cdb_len, | ||
| ocs_scsi_dif_info_t * | dif_info, | ||
| ocs_scsi_sgl_t * | sgl, | ||
| uint32_t | sgl_count, | ||
| uint32_t | wire_len, | ||
| ocs_scsi_rsp_io_cb_t | cb, | ||
| void * | arg | ||
| ) |
Initiate initiator read IO.
sgl for sgl_count entries. | node | Pointer to the node. |
| io | Pointer to the IO context. |
| lun | LUN value. |
| cdb | Pointer to the CDB. |
| cdb_len | Length of the CDB. |
| dif_info | Pointer to the T10 DIF fields, or NULL if no DIF. |
| sgl | Pointer to the scatter-gather list. |
| sgl_count | Count of the scatter-gather list elements. |
| wire_len | Length of the payload. |
| cb | Completion callback. |
| arg | Application-specified completion callback argument. |
Definition at line 2332 of file ocs_scsi.c.
| int32_t ocs_scsi_send_resp | ( | ocs_io_t * | io, |
| uint32_t | flags, | ||
| ocs_scsi_cmd_resp_t * | rsp, | ||
| ocs_scsi_io_cb_t | cb, | ||
| void * | arg | ||
| ) |
Send response data.
ocs_scsi_cmd_resp_t argument with scsi status, status qualifier, sense data, and response data, as needed. cb is invoked. The target-server will generally clean up its IO context resources and call ocs_scsi_io_complete().| io | Pointer to the IO context. |
| flags | Flags to control sending of the SCSI response. |
| rsp | Pointer to the response data populated by the caller. |
| cb | Completion callback. |
| arg | Application-specified completion callback argument. |
Definition at line 1688 of file ocs_scsi.c.
| int32_t ocs_scsi_send_tmf | ( | ocs_node_t * | node, |
| ocs_io_t * | io, | ||
| ocs_io_t * | io_to_abort, | ||
| uint32_t | lun, | ||
| ocs_scsi_tmf_cmd_e | tmf, | ||
| ocs_scsi_sgl_t * | sgl, | ||
| uint32_t | sgl_count, | ||
| uint32_t | len, | ||
| ocs_scsi_rsp_io_cb_t | cb, | ||
| void * | arg | ||
| ) |
Initiate initiator task management operation.
sgl_count may be zero and sgl is ignored. cb is invoked with status and SCSI response data.| node | Pointer to the node. |
| io | Pointer to the IO context. |
| io_to_abort | Pointer to the IO context to abort in the case of OCS_SCSI_TMF_ABORT_TASK. Note: this can point to the same the same ocs_io_t as io, provided that io does not have any outstanding work requests. |
| lun | LUN value. |
| tmf | Task management command. |
| sgl | Pointer to the scatter-gather list. |
| sgl_count | Count of the scatter-gather list elements. |
| len | Length of the payload. |
| cb | Completion callback. |
| arg | Application-specified completion callback argument. |
Definition at line 2482 of file ocs_scsi.c.
| int32_t ocs_scsi_send_tmf_resp | ( | ocs_io_t * | io, |
| ocs_scsi_tmf_resp_e | rspcode, | ||
| uint8_t | addl_rsp_info[3], | ||
| ocs_scsi_io_cb_t | cb, | ||
| void * | arg | ||
| ) |
Send TMF response data.
cb is invoked. The target-server will generally clean up its IO context resources and call ocs_scsi_io_complete().| io | Pointer to the IO context. |
| rspcode | TMF response code. |
| addl_rsp_info | Additional TMF response information (may be NULL for zero data). |
| cb | Completion callback. |
| arg | Application-specified completion callback argument. |
Definition at line 1815 of file ocs_scsi.c.
| int32_t ocs_scsi_send_wr_io | ( | ocs_node_t * | node, |
| ocs_io_t * | io, | ||
| uint32_t | lun, | ||
| void * | cdb, | ||
| uint32_t | cdb_len, | ||
| ocs_scsi_dif_info_t * | dif_info, | ||
| ocs_scsi_sgl_t * | sgl, | ||
| uint32_t | sgl_count, | ||
| uint32_t | wire_len, | ||
| ocs_scsi_rsp_io_cb_t | cb, | ||
| void * | arg | ||
| ) |
Initiate initiator write IO.
sgl for sgl_count entries. cb is invoked and passed request status. If the command completed successfully, the callback is given SCSI response data.| node | Pointer to the node. |
| io | Pointer to IO context. |
| lun | LUN value. |
| cdb | Pointer to the CDB. |
| cdb_len | Length of the CDB. |
| dif_info | Pointer to the T10 DIF fields, or NULL if no DIF. |
| sgl | Pointer to the scatter-gather list. |
| sgl_count | Count of the scatter-gather list elements. |
| wire_len | Length of the payload. |
| cb | Completion callback. |
| arg | Application-specified completion callback argument. |
Definition at line 2371 of file ocs_scsi.c.
| int32_t ocs_scsi_send_wr_io_first_burst | ( | ocs_node_t * | node, |
| ocs_io_t * | io, | ||
| uint32_t | lun, | ||
| void * | cdb, | ||
| uint32_t | cdb_len, | ||
| ocs_scsi_dif_info_t * | dif_info, | ||
| ocs_scsi_sgl_t * | sgl, | ||
| uint32_t | sgl_count, | ||
| uint32_t | wire_len, | ||
| uint32_t | first_burst, | ||
| ocs_scsi_rsp_io_cb_t | cb, | ||
| void * | arg | ||
| ) |
Initiate initiator write IO.
sgl for sgl_count entries. cb is invoked and passed request status. If the command completed successfully, the callback is given SCSI response data.| node | Pointer to the node. |
| io | Pointer to IO context. |
| lun | LUN value. |
| cdb | Pointer to the CDB. |
| cdb_len | Length of the CDB. |
| dif_info | Pointer to the T10 DIF fields, or NULL if no DIF. |
| sgl | Pointer to the scatter-gather list. |
| sgl_count | Count of the scatter-gather list elements. |
| wire_len | Length of the payload. |
| first_burst | Number of first burst bytes to send. |
| cb | Completion callback. |
| arg | Application-specified completion callback argument. |
Definition at line 2412 of file ocs_scsi.c.
| int32_t ocs_scsi_tgt_abort_io | ( | ocs_io_t * | io, |
| bool | send_abts, | ||
| ocs_scsi_io_cb_t | cb, | ||
| void * | arg | ||
| ) |
Abort a target IO.
| io | IO context. |
| send_abts | flag to determine ABTS to initiator or not |
| cb | SCSI target server callback. |
| arg | SCSI target server supplied callback argument. |
Definition at line 1989 of file ocs_scsi.c.
|
inlinestatic |
Send read/write data.
sgl of length sgl_count. The wire_len argument specifies the payload length (independent of the scatter-gather list cumulative length). flags argument has one bit, OCS_SCSI_LAST_DATAPHASE, which is a hint to the base driver that it may use auto SCSI response features if the hardware supports it. | io | Pointer to the IO context. |
| flags | Flags controlling the sending of data. |
| dif_info | Pointer to T10 DIF fields, or NULL if no DIF. |
| sgl | Pointer to the payload scatter-gather list. |
| sgl_count | Count of the scatter-gather list elements. |
| xwire_len | Length of the payload on wire, in bytes. |
| type | HAL IO type. |
| enable_ar | Enable auto-response if true. |
| cb | Completion callback. |
| arg | Application-supplied callback data. |
Definition at line 1502 of file ocs_scsi.c.