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

Functions

int32_t ocs_session_initialize (ocs_iscsi_t *iscsi)
 Initialize the session management by allocating objects for sessions. More...
 
void ocs_session_teardown (ocs_iscsi_t *iscsi)
 Releases the session objects used within the login module. More...
 
int32_t ocs_session_cxn_new (ocs_cxn_t *cxn, char *tgt_name, char *ini_name, uint64_t isid, uint16_t tsih, uint16_t cid, uint32_t cmd_sn)
 Find an existing session or create a new one based on the login parameters. More...
 
int32_t ocs_session_cxn_del (ocs_cxn_t *cxn)
 Removes a connection from its session. More...
 
ocs_cxn_t * ocs_session_cxn_find (ocs_session_t *session, uint16_t cid)
 Locate a connection within a session based on the cid. More...
 
void ocs_session_close (ocs_session_t *session, uint8_t reset)
 Closes all connections on a session. More...
 
void ocs_session_max_cmd_sn_upd (ocs_session_t *session)
 Updates the max_cmd_sn based on the number IOs available. More...
 
static void ocs_session_check_queued_commands (ocs_session_t *session)
 Checks the queued command to see if any can start. More...
 
static int32_t ocs_session_queue_command (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t code, uint32_t cmd_sn)
 Adds a command to the command queue. More...
 
int32_t ocs_session_tgt_unsol_pdu_recv (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t code)
 Function to handle unsolicited PDUs on a target. More...
 

Function Details

static void ocs_session_check_queued_commands ( ocs_session_t *  session)
static

Checks the queued command to see if any can start.

Parameters
sessionPointer to the session object.

Definition at line 501 of file ocs_session.c.

void ocs_session_close ( ocs_session_t *  session,
uint8_t  reset 
)

Closes all connections on a session.

Parameters
sessionPointer to the session object.
resetA non-zero value causes a connection reset to be issued.

Definition at line 405 of file ocs_session.c.

int32_t ocs_session_cxn_del ( ocs_cxn_t *  cxn)

Removes a connection from its session.

Parameters
cxnPointer to the connection object.

Definition at line 343 of file ocs_session.c.

ocs_cxn_t* ocs_session_cxn_find ( ocs_session_t *  session,
uint16_t  cid 
)

Locate a connection within a session based on the cid.

Parameters
sessionPointer to the session object.
cidThe iSCSI connection ID to find.
Returns
Pointer to the connection, or NULL if not found.

Definition at line 379 of file ocs_session.c.

int32_t ocs_session_cxn_new ( ocs_cxn_t *  cxn,
char *  tgt_name,
char *  ini_name,
uint64_t  isid,
uint16_t  tsih,
uint16_t  cid,
uint32_t  cmd_sn 
)

Find an existing session or create a new one based on the login parameters.

Parameters
cxnPointer to the connection object.
tgt_namePointer to the target name.
ini_namePointer to the initiator name.
isidThe iSCSI initiator session ID from the login PDU.
tsihThe iSCSI target session handle from the login PDU.
cidThe iSCSI connection ID from the login PDU.
cmd_snThe iSCSI command SN from the login PDU.
Returns
  • 0 - success.
  • 1 - session does not exist.
  • 2 - exceeds Max Cxn.
  • 3 - no resources.

Definition at line 187 of file ocs_session.c.

int32_t ocs_session_initialize ( ocs_iscsi_t *  iscsi)

Initialize the session management by allocating objects for sessions.

Parameters
iscsiPointer to the iSCSI structure that represents this device.
Returns
Returns 0 on success.

Definition at line 67 of file ocs_session.c.

void ocs_session_max_cmd_sn_upd ( ocs_session_t *  session)

Updates the max_cmd_sn based on the number IOs available.

Parameters
sessionPointer to the session object.

Definition at line 449 of file ocs_session.c.

static int32_t ocs_session_queue_command ( ocs_cxn_t *  cxn,
ocs_hal_rq_buffer_t *  hdr,
uint32_t  hdr_len,
ocs_hal_rq_buffer_t *  data,
uint32_t  data_len,
uint8_t  code,
uint32_t  cmd_sn 
)
static

Adds a command to the command queue.

Parameters
cxnPointer to the connection object.
hdrDMA memory information for the header.
hdr_lenLength of the header received.
dataDMA memory information for the data.
data_lenLength of the data received.
codeType of callback received from the chip (i.e. SLI_STATUS_UNSOL_DATA_DIGEST_ERROR).
cmd_snThe iSCSI command sequence number.
Returns
Returns 0 on success.

Definition at line 643 of file ocs_session.c.

void ocs_session_teardown ( ocs_iscsi_t *  iscsi)

Releases the session objects used within the login module.

Parameters
iscsiPointer to the iSCSI object.

Definition at line 123 of file ocs_session.c.

int32_t ocs_session_tgt_unsol_pdu_recv ( ocs_cxn_t *  cxn,
ocs_hal_rq_buffer_t *  hdr,
uint32_t  hdr_len,
ocs_hal_rq_buffer_t *  data,
uint32_t  data_len,
uint8_t  code 
)

Function to handle unsolicited PDUs on a target.

Parameters
cxnPointer to the connection object.
hdrDMA memory information for the header.
hdr_lenLength of the header received.
dataDMA memory information for the data.
data_lenLength of the data received.
codeType of callback received from the chip (i.e. SLI_STATUS_UNSOL_DATA_DIGEST_ERROR)
Returns
Returns 0 on success.

Definition at line 699 of file ocs_session.c.