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

Functions

int32_t ocs_scsi_tgt_driver_init (void)
 Driver-wide initialization for the target-server. More...
 
int32_t ocs_scsi_tgt_driver_exit (void)
 Driver-wide clean-up for the target-server. More...
 
int32_t ocs_scsi_tgt_new_device (ocs_t *ocs)
 Initializes any target fields on the ocs structure. More...
 
int32_t ocs_scsi_tgt_del_device (ocs_t *ocs)
 Tears down the target members of the ocs structure. More...
 
int32_t ocs_scsi_tgt_new_domain (ocs_domain_t *domain)
 Accept a new domain notification. More...
 
void ocs_scsi_tgt_del_domain (ocs_domain_t *domain)
 Accept a domain lost notification. More...
 
int32_t ocs_scsi_tgt_new_sport (ocs_sport_t *sport)
 Accept a new SLI Port notification. More...
 
void ocs_scsi_tgt_del_sport (ocs_sport_t *sport)
 Accept a SLI Port gone notification. More...
 
int32_t ocs_scsi_validate_initiator (ocs_node_t *node)
 Validate a new initiator. More...
 
int32_t ocs_scsi_new_initiator (ocs_node_t *node)
 Receive notification of a new SCSI initiator node. More...
 
int32_t ocs_scsi_del_initiator (ocs_node_t *node, ocs_scsi_del_initiator_reason_e reason)
 Delete a SCSI initiator node. More...
 
int32_t _ocs_scsi_recv_cmd (ocs_io_t *io, uint32_t lun, uint8_t *cdb, uint32_t cdb_len, uint32_t flags)
 Receive an FCP SCSI command. More...
 
int32_t ocs_scsi_recv_cmd_first_burst (ocs_io_t *io, uint32_t lun, uint8_t *cdb, uint32_t cdb_len, uint32_t flags, ocs_dma_t first_burst_buffers[], uint32_t first_burst_bytes)
 Receive an FCP SCSI command with the first burst data. More...
 
int32_t ocs_scsi_recv_tmf (ocs_io_t *tmfio, uint32_t lun, ocs_scsi_tmf_cmd_e cmd, ocs_io_t *io_to_abort, uint32_t flags)
 Receive a TMF command IO. More...
 

Function Details

int32_t _ocs_scsi_recv_cmd ( ocs_io_t *  io,
uint32_t  lun,
uint8_t *  cdb,
uint32_t  cdb_len,
uint32_t  flags 
)

Receive an FCP SCSI command.

Description
Called by the base driver when a new SCSI command has been received. The target-server processes the command, and issues data phase and/or response phase requests to the base driver. The IO context (ocs_io_t) structure has an element of type ocs_scsi_tgt_io_t named tgt_io that is declared and used by a target-server for private information.
Parameters
ioPointer to the IO context.
lunLUN for this IO.
cdbPointer to the SCSI CDB.
cdb_lenLength of the CDB, in bytes.
flagsCommand flags.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 1207 of file ocs_ramd.c.

int32_t ocs_scsi_del_initiator ( ocs_node_t *  node,
ocs_scsi_del_initiator_reason_e  reason 
)

Delete a SCSI initiator node.

Description
Sent by the base driver to notify a target-server that a remote initiator is now gone. The base driver has terminated all outstanding IOs, and the target-server will receive the appropriate completions.

Note: This function is only called if the base driver is enabled for target capability.
Parameters
nodePointer to the node being deleted.
reasonThis is the reason that the initiator was removed and will be one of the following enumeration types: OCS_SCSI_INITIATOR_DELETED or OS_SCSI_INITIATOR_MISSING.
Returns
Returns OCS_SCSI_CALL_COMPLETE to indicate that all work completed.

Definition at line 1092 of file ocs_ramd.c.

int32_t ocs_scsi_new_initiator ( ocs_node_t *  node)

Receive notification of a new SCSI initiator node.

Description
Sent by the base driver to notify a target-server of the presence of a new remote initiator. The target-server may use this call to prepare for an inbound IO from this node. The ocs_node_t structure has an element of type ocs_scsi_tgt_node_t named tgt_node that is declared and used by a target-server for private information.

Note: This function is only called if the base driver is enabled for target capability.
Parameters
nodePointer to a new remote initiator node.
Returns
Returns 0 on success, or a negative error code value on failure.
Note

Definition at line 1027 of file ocs_ramd.c.

int32_t ocs_scsi_recv_cmd_first_burst ( ocs_io_t *  io,
uint32_t  lun,
uint8_t *  cdb,
uint32_t  cdb_len,
uint32_t  flags,
ocs_dma_t  first_burst_buffers[],
uint32_t  first_burst_bytes 
)

Receive an FCP SCSI command with the first burst data.

Description
Receive a new FCP SCSI command from the base driver with the first burst data.
Parameters
ioPointer to the IO context.
lunLUN for this IO.
cdbPointer to the SCSI CDB.
cdb_lenLength of CDB, in bytes.
flagsCommand flags.
first_burst_buffersFirst burst buffers.
first_burst_bytesThe number of bytes received in the first burst.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 1230 of file ocs_ramd.c.

int32_t ocs_scsi_recv_tmf ( ocs_io_t *  tmfio,
uint32_t  lun,
ocs_scsi_tmf_cmd_e  cmd,
ocs_io_t *  io_to_abort,
uint32_t  flags 
)

Receive a TMF command IO.

Description
Called by the base driver when a SCSI TMF command has been received. The target-server processes the command, aborting commands as needed, and posts a response using ocs_scsi_send_resp(). The IO context (ocs_io_t) structure has an element of type ocs_scsi_tgt_io_t, named tgt_io that is declared and used by a target-server for private information.

Notes: -If the target-server walks the nodes active_ios linked list, and starts IO abort processing, the code must not abort the IO passed into the ocs_scsi_recv_tmf() command.
  • This io_to_abort is guaranteed not to be freed during this function's scope. Since ocs_scsi_tgt_abort_io() takes a reference on the io_to_abort, if ocs_scsi_tgt_abort_io() is called within this function's scope, another reference is not needed. If ocs_scsi_tgt_abort_io() isn't called in this context and the io_to_abort pointer needs to be used beyond this function's scope, use ocs_ref_get() to take another reference.
Parameters
tmfioPointer to the IO context.
lunLogical unit value.
cmdCommand request.
io_to_abortPointer to the IO object to abort for TASK_ABORT (NULL for all other TMF).
flagsFlags.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 2682 of file ocs_ramd.c.

int32_t ocs_scsi_tgt_del_device ( ocs_t *  ocs)

Tears down the target members of the ocs structure.

Description
Called by the OS code when the device is removed.
Parameters
ocsPointer to the ocs.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 836 of file ocs_ramd.c.

void ocs_scsi_tgt_del_domain ( ocs_domain_t *  domain)

Accept a domain lost notification.

Description
Called by the base driver when a domain goes away. A target-server uses this call to clean up all domain-scoped resources.

Note: For initiator-client back-ends, the ocs_scsi_ini_del_domain() function is called.
Parameters
domainPointer to the domain.
Returns
None.

Definition at line 902 of file ocs_ramd.c.

void ocs_scsi_tgt_del_sport ( ocs_sport_t *  sport)

Accept a SLI Port gone notification.

Description
Called by the base driver when a sport goes away. A target-server uses this call to clean up all sport-scoped resources.

Note: For initiator-client backends, the ocs_scsi_ini_del_sport() function is called.
Parameters
sportPointer to the sport structure.
Returns
None.

Definition at line 974 of file ocs_ramd.c.

int32_t ocs_scsi_tgt_driver_exit ( void  )

Driver-wide clean-up for the target-server.

Description
Called by the OS driver-wide exit/clean-up.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 401 of file ocs_ramd.c.

int32_t ocs_scsi_tgt_driver_init ( void  )

Driver-wide initialization for the target-server.

Description
Called by the OS initialization prior to the PCI device discovery.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 354 of file ocs_ramd.c.

int32_t ocs_scsi_tgt_new_device ( ocs_t *  ocs)

Initializes any target fields on the ocs structure.

Description
Called by the OS initialization code when a new device is discovered.
Parameters
ocsPointer to the ocs.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 753 of file ocs_ramd.c.

int32_t ocs_scsi_tgt_new_domain ( ocs_domain_t *  domain)

Accept a new domain notification.

Description
Called by the base driver when a new domain is discovered. A target-server uses this call to prepare for the new remote node notifications coming from the ocs_scsi_new_initiator(). The domain context has the ocs_scsi_tgt_domain_t structure, which is declared by the target-server code and used for target-server private data.

Note: This function will only be called if the base driver has been enabled for target capability. For initiator-client back-ends, the ocs_scsi_ini_new_domain() function is called.
Parameters
domainPointer to the domain.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 880 of file ocs_ramd.c.

int32_t ocs_scsi_tgt_new_sport ( ocs_sport_t *  sport)

Accept a new SLI Port notification.

Description
Called by the base driver when a new SLI Port (sport) is discovered. A target-server uses this call to prepare for new remote node notifications arising from ocs_scsi_new_initiator().

Note: This function will only be called if the base driver has been enabled for target capability. For initiator-client backends, the ocs_scsi_ini_new_sport() function is called.
Parameters
sportPointer to the sport.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 924 of file ocs_ramd.c.

int32_t ocs_scsi_validate_initiator ( ocs_node_t *  node)

Validate a new initiator.

Description
Sent by the base driver to validate a remote initiatiator. The target-server returns TRUE if this initiator should be accepted.

Note: This function is only to be called if the base driver is enabled for target capability.
Parameters
nodePointer to the remote initiator node to validate.
Returns
Returns TRUE if the initiator should be accepted, or FALSE if the initiator should be rejected.
Note

Definition at line 1002 of file ocs_ramd.c.