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

Functions

int32_t ocs_iscsi_login_initialize (ocs_iscsi_t *iscsi)
 Initialize the login and retry object used within the login module. More...
 
void ocs_iscsi_login_teardown (ocs_iscsi_t *iscsi)
 Releases the login and retry object used within the login module. More...
 
int32_t ocs_iscsi_are_login_reqs_outstanding (ocs_cxn_t *cxn)
 Checks to see if there are any retry or login IOs active on a connection. More...
 
ocs_hal_rtn_e ocs_iscsi_login_cxn_cleanup (ocs_cxn_t *cxn)
 Frees any retry objects for the connection. More...
 
void ocs_iscsi_login_retry (ocs_cxn_t *cxn)
 Attempt to start a request on the retry queue. More...
 
static ocs_cxn_q_cbit_t * ocs_iscsi_cbit_pdu_setup (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t *status, uint8_t *status_detail, char **recv_ptr, uint32_t *recv_len, char **resp_ptr, uint32_t *resp_size)
 Does the initial checks and processing for the continue bit. More...
 
static void ocs_iscsi_cbit_fill_buffer (ocs_cxn_t *cxn, uint8_t status, uint32_t *len)
 Copies the appropriate send data from the c bit processing. More...
 
static void ocs_iscsi_cbit_backout (ocs_cxn_t *cxn, ocs_cxn_q_cbit_t *cbit)
 Backs out the adding of a cbit object on this connection. More...
 
void ocs_iscsi_cbit_cleanup (ocs_cxn_t *cxn)
 Sends the login parameters to the firmware. More...
 
ocs_pdu_process_rtn_e ocs_iscsi_recv_login (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len)
 Function to process a login PDU on a target. More...
 
static int32_t ocs_iscsi_send_login_rsp_invalid_during_login_queue (ocs_cxn_t *cxn, uint32_t itt)
 Function to queue a send login request. More...
 
int32_t ocs_iscsi_recv_login_rsp (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len)
 Function to process a login response PDU. More...
 
static int32_t ocs_iscsi_send_login_queue (ocs_cxn_t *cxn, bool is_discovery, char *tgt_name)
 Function to queue a send login request. More...
 
static int32_t ocs_iscsi_add_tgt_keys (ocs_cxn_t *cxn, char *resp_ptr, uint32_t resp_size, uint32_t plen_orig, char *tgt_name)
 Add targets to the sendTarget response. More...
 
ocs_pdu_process_rtn_e ocs_iscsi_recv_text (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 *reject_reason)
 Function to process a text PDU. More...
 
ocs_pdu_process_rtn_e ocs_iscsi_recv_logout (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len)
 Function to process a logout PDU. More...
 
int32_t ocs_iscsi_send_logout (ocs_cxn_t *cxn, uint8_t immediate, uint8_t reason_code)
 Function to send a logout PDU. More...
 
int32_t ocs_iscsi_send_logout_rsp (ocs_cxn_t *cxn, uint8_t response, uint32_t itt)
 Function to send a logout response PDU. More...
 
int32_t ocs_iscsi_recv_logout_rsp (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len)
 Handle logout response from a target. More...
 
int32_t ocs_iscsi_send_nop_out (ocs_cxn_t *cxn, uint64_t lun, uint32_t itt, uint32_t ttt, char *data_ptr, uint32_t data_len)
 Send NOP-Out from an initiator. More...
 
int32_t ocs_iscsi_send_nop_in (ocs_cxn_t *cxn, uint64_t lun, uint32_t itt, uint32_t ttt, char *data_ptr, uint32_t data_len)
 Send NOP-In from a target. More...
 
int32_t ocs_iscsi_recv_nop_in (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len)
 Handle NOP-IN from a target. More...
 
ocs_pdu_process_rtn_e ocs_iscsi_recv_nop_out (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len)
 Handle NOP-OUT from an initiator. More...
 
static int32_t ocs_iscsi_send_reject_queue (ocs_cxn_t *cxn, void *hdr, uint32_t hdr_len, uint8_t reason)
 Function to queue a send reject request. More...
 
static int32_t ocs_iscsi_send_async_queue (ocs_cxn_t *cxn, void *payload, uint32_t payload_len, uint8_t reason, uint64_t lun, uint16_t param1, uint16_t param2, uint16_t param3)
 Function to queue an asynchronous request. More...
 

Function Details

static int32_t ocs_iscsi_add_tgt_keys ( ocs_cxn_t *  cxn,
char *  resp_ptr,
uint32_t  resp_size,
uint32_t  plen_orig,
char *  tgt_name 
)
static

Add targets to the sendTarget response.

Parameters
cxnPointer to the connection object.
resp_ptrPointer to the start of the response buffer.
resp_sizeSize of the response buffer.
plen_origPayload length added so far.
tgt_nameTarget name to add.
Returns
Returns the number of bytes added to the payload.

Definition at line 3429 of file ocs_login.c.

int32_t ocs_iscsi_are_login_reqs_outstanding ( ocs_cxn_t *  cxn)

Checks to see if there are any retry or login IOs active on a connection.

Parameters
cxnPointer to the connection object.
Returns
Returns FALSE if nothing is active, or TRUE otherwise.

Definition at line 245 of file ocs_login.c.

static void ocs_iscsi_cbit_backout ( ocs_cxn_t *  cxn,
ocs_cxn_q_cbit_t *  cbit 
)
static

Backs out the adding of a cbit object on this connection.

Parameters
cxnPointer to the connection object.
cbitPointer to the C bit object that was added.

Definition at line 2388 of file ocs_login.c.

void ocs_iscsi_cbit_cleanup ( ocs_cxn_t *  cxn)

Sends the login parameters to the firmware.

Parameters
cxnPointer to the connection object.
Returns
Returns 0 on success.

Definition at line 2410 of file ocs_login.c.

static void ocs_iscsi_cbit_fill_buffer ( ocs_cxn_t *  cxn,
uint8_t  status,
uint32_t *  len 
)
static

Copies the appropriate send data from the c bit processing.

Parameters
cxnPointer to the connection object.
statusPasses the login status.
lenPasses and returns the length of the payload.

Definition at line 2355 of file ocs_login.c.

static ocs_cxn_q_cbit_t* ocs_iscsi_cbit_pdu_setup ( ocs_cxn_t *  cxn,
ocs_hal_rq_buffer_t *  hdr,
ocs_hal_rq_buffer_t *  data,
uint32_t  data_len,
uint8_t *  status,
uint8_t *  status_detail,
char **  recv_ptr,
uint32_t *  recv_len,
char **  resp_ptr,
uint32_t *  resp_size 
)
static

Does the initial checks and processing for the continue bit.

Parameters
cxnPointer to the connection object.
hdrDMA memory information for the header.
dataDMA memory information for the data.
data_lenLength of the data received.
statusPasses and returns the login status.
status_detailPasses and returns the login detailed status.
recv_ptrReturns the pointer to the receive data.
recv_lenReturns the length of the received data.
resp_ptrReturns the pointer to the send payload.
resp_sizeReturns the size of the send payload.
Returns
Pointer to the cbit object added.

Definition at line 2241 of file ocs_login.c.

ocs_hal_rtn_e ocs_iscsi_login_cxn_cleanup ( ocs_cxn_t *  cxn)

Frees any retry objects for the connection.

Parameters
cxnPointer to the connection object.

Definition at line 277 of file ocs_login.c.

int32_t ocs_iscsi_login_initialize ( ocs_iscsi_t *  iscsi)

Initialize the login and retry object used within the login module.

Parameters
iscsiPointer to the iSCSI object.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 200 of file ocs_login.c.

void ocs_iscsi_login_retry ( ocs_cxn_t *  cxn)

Attempt to start a request on the retry queue.

Description
Since requests may be queued due to both lack of WRB or login memory, this function may be called from an IO completion.
Parameters
cxnPointer to the connection object.

Definition at line 402 of file ocs_login.c.

void ocs_iscsi_login_teardown ( ocs_iscsi_t *  iscsi)

Releases the login and retry object used within the login module.

Parameters
iscsiPointer to the iSCSI object.

Definition at line 227 of file ocs_login.c.

ocs_pdu_process_rtn_e ocs_iscsi_recv_login ( ocs_cxn_t *  cxn,
ocs_hal_rq_buffer_t *  hdr,
uint32_t  hdr_len,
ocs_hal_rq_buffer_t *  data,
uint32_t  data_len 
)

Function to process a login PDU 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.
Returns
Returns 0 on success.

Definition at line 2450 of file ocs_login.c.

int32_t ocs_iscsi_recv_login_rsp ( ocs_cxn_t *  cxn,
ocs_hal_rq_buffer_t *  hdr,
uint32_t  hdr_len,
ocs_hal_rq_buffer_t *  data,
uint32_t  data_len 
)

Function to process a login response PDU.

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.
Returns
Returns 0 on success.

Definition at line 2893 of file ocs_login.c.

ocs_pdu_process_rtn_e ocs_iscsi_recv_logout ( ocs_cxn_t *  cxn,
ocs_hal_rq_buffer_t *  hdr,
uint32_t  hdr_len 
)

Function to process a logout PDU.

Parameters
cxnPointer to the connection object.
hdrDMA memory information for the header.
hdr_lenLength of the header received.
Returns
Returns 0 on success.

Definition at line 3881 of file ocs_login.c.

int32_t ocs_iscsi_recv_logout_rsp ( ocs_cxn_t *  cxn,
ocs_hal_rq_buffer_t *  hdr,
uint32_t  hdr_len 
)

Handle logout response from a target.

Parameters
cxnPointer to the connection object.
hdrDMA memory information for the header.
hdr_lenLength of the header received.
Returns
Returns 0 on success.

Definition at line 4163 of file ocs_login.c.

int32_t ocs_iscsi_recv_nop_in ( ocs_cxn_t *  cxn,
ocs_hal_rq_buffer_t *  hdr,
uint32_t  hdr_len,
ocs_hal_rq_buffer_t *  data,
uint32_t  data_len 
)

Handle NOP-IN from a target.

Description
Note: We do not handle more than one buffer of NOP data.
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.
Returns
Returns 0 on success.

Definition at line 4503 of file ocs_login.c.

ocs_pdu_process_rtn_e ocs_iscsi_recv_nop_out ( ocs_cxn_t *  cxn,
ocs_hal_rq_buffer_t *  hdr,
uint32_t  hdr_len,
ocs_hal_rq_buffer_t *  data,
uint32_t  data_len 
)

Handle NOP-OUT from an initiator.

Description
Note: We do not handle more than one buffer of NOP data.
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.
Returns
Returns 0 on success.

Definition at line 4560 of file ocs_login.c.

ocs_pdu_process_rtn_e ocs_iscsi_recv_text ( 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 *  reject_reason 
)

Function to process a text PDU.

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.
reject_reasonReturns the reject reason.
Returns
Returns 0 on success.

Definition at line 3546 of file ocs_login.c.

static int32_t ocs_iscsi_send_async_queue ( ocs_cxn_t *  cxn,
void *  payload,
uint32_t  payload_len,
uint8_t  reason,
uint64_t  lun,
uint16_t  param1,
uint16_t  param2,
uint16_t  param3 
)
static

Function to queue an asynchronous request.

Parameters
cxnPointer to the connection object.
payloadVirtual memory containing the payload to send.
payload_lenLength of the payload to send.
reasoniSCSI asynchronous reason.
luniSCSI LUN.
param1Parameter 1 in the asynchronous PDU.
param2Parameter 2 in the asynchronous PDU.
param3Parameter 3 in the asynchronous PDU.
Returns
Returns 0 on success.

Definition at line 4742 of file ocs_login.c.

static int32_t ocs_iscsi_send_login_queue ( ocs_cxn_t *  cxn,
bool  is_discovery,
char *  tgt_name 
)
static

Function to queue a send login request.

Parameters
cxnPointer to the connection object.
is_discoveryTRUE for a discovery session.
tgt_nameTarget name for a normal session.
Returns
Returns 0 on success.

Definition at line 3147 of file ocs_login.c.

static int32_t ocs_iscsi_send_login_rsp_invalid_during_login_queue ( ocs_cxn_t *  cxn,
uint32_t  itt 
)
static

Function to queue a send login request.

Parameters
cxnPointer to the connection object.
ittInitiator task tag.
Returns
Returns 0 on success.

Definition at line 2785 of file ocs_login.c.

int32_t ocs_iscsi_send_logout ( ocs_cxn_t *  cxn,
uint8_t  immediate,
uint8_t  reason_code 
)

Function to send a logout PDU.

Parameters
cxnPointer to the connection object.
immediateTRUE if sending as an immediate command.
reason_codeLogout reason.
Returns
Returns 0 on success.

Definition at line 3992 of file ocs_login.c.

int32_t ocs_iscsi_send_logout_rsp ( ocs_cxn_t *  cxn,
uint8_t  response,
uint32_t  itt 
)

Function to send a logout response PDU.

Parameters
cxnPointer to the connection object.
responseLogout response per the iSCSI specification.
ittInitiator task tag of the logout request.
Returns
Returns 0 on success.

Definition at line 4095 of file ocs_login.c.

int32_t ocs_iscsi_send_nop_in ( ocs_cxn_t *  cxn,
uint64_t  lun,
uint32_t  itt,
uint32_t  ttt,
char *  data_ptr,
uint32_t  data_len 
)

Send NOP-In from a target.

Description
Note: We do not handle more than one buffer of NOP data.
Parameters
cxnPointer to the connection object.
lunLUN for the PDU (Host byte order).
ittInitiator task tag (Host byte order).
tttTarget transfer tag (Host byte order).
data_ptrPointer to the payload data (may be NULL).
data_lenLength of the payload data.
Returns
Returns 0 on success.

Definition at line 4404 of file ocs_login.c.

int32_t ocs_iscsi_send_nop_out ( ocs_cxn_t *  cxn,
uint64_t  lun,
uint32_t  itt,
uint32_t  ttt,
char *  data_ptr,
uint32_t  data_len 
)

Send NOP-Out from an initiator.

Description
Note: We do not handle more than one buffer of NOP data.
Parameters
cxnPointer to the connection object.
lunLUN for the PDU (Host byte order).
ittInitiator task tag (Host byte order).
tttTarget transfer tag (Host byte order).
data_ptrPointer to the payload data (may be NULL).
data_lenLength of the payload data.
Returns
Returns 0 on success.

Definition at line 4250 of file ocs_login.c.

static int32_t ocs_iscsi_send_reject_queue ( ocs_cxn_t *  cxn,
void *  hdr,
uint32_t  hdr_len,
uint8_t  reason 
)
static

Function to queue a send reject request.

Parameters
cxnPointer to the connection object.
hdrVirtual memory information for the rejected header.
hdr_lenLength of the header received.
reasonThe iSCSI reject reason.
Returns
Returns 0 on success.

Definition at line 4613 of file ocs_login.c.