53 #define std_cxn_state_decl(...) \
54 ocs_cxn_t *cxn = NULL; \
55 ocs_iscsi_t *iscsi = NULL; \
58 ocs_assert(ctx, NULL); \
60 ocs_assert(cxn, NULL); \
62 ocs_assert(iscsi, NULL); \
64 ocs_assert(ocs, NULL); \
66 #define cxn_sm_trace() \
68 if (ocs_debug_is_enabled(OCS_DEBUG_ENABLE_SM_TRACE)) \
69 ocs_log_info(cxn->ocs, "[%s] %-20s %-20s\n", cxn->display_name, __func__, ocs_sm_event_name(evt)); \
76 int ocs_mgmt_node_exec(
char *parent,
char *action,
void *arg_in, uint32_t arg_in_length,
77 void *arg_out, uint32_t arg_out_length,
void *node);
130 ocs_log_err(iscsi->
os,
"Failed to allocate login hdr buffers\n");
141 ocs_log_err(iscsi->
os,
"Failed to allocate login data buffers\n");
176 ocs_t *ocs = cxn->ocs;
186 ocs_lock(&cxn->active_ios_lock);
204 ocs_unlock(&cxn->active_ios_lock);
229 ocs_sm_ctx_t *ctx = &cxn->sm;
231 if (ctx->current_state == state) {
235 ctx->current_state = state;
249 ocs_cxn_t *cxn = arg;
263 if (ocs_timer_pending(&cxn->sm_retry_timer)) {
264 ocs_del_timer(&cxn->sm_retry_timer);
267 ocs_setup_timer(cxn->ocs, &cxn->sm_retry_timer,
300 ocs_log_test(ocs,
"[%s] %-20s %-20s not handled\n", cxn->display_name, funcname,
ocs_sm_event_name(evt));
329 if (ocs_timer_pending(&cxn->ffp_timer)) {
330 ocs_del_timer(&cxn->ffp_timer);
385 remote_ip.
ip_type = cxn->dest_ip_type;
386 ocs_memcpy(remote_ip.
ip_address, cxn->dest_ip, 16);
392 ocs->tcp_window_size,
393 ocs->tcp_window_scale,
445 ocs_log_err(iscsi->os,
"failing building login (rc=%d)\n", rc);
558 ocs_io_t *io, *abort_io = NULL;
572 if (io->hio != NULL) {
578 if (abort_io == NULL) {
593 ocs_log_debug(iscsi->os,
"cxn, hdl=0x%x abort ICD %d\n",
595 (abort_io->hio != NULL) ? abort_io->hio->icd : -1);
673 uint8_t are_login_reqs;
687 if (is_io_empty && !are_login_reqs) {
688 if (cxn->send_logout_rsp) {
694 cxn->send_logout_rsp = FALSE;
765 ocs_log_debug(iscsi->os,
"sent request to close cxn, hdl=0x%x\n",
767 if (cxn->is_ini_cxn) {
901 uint16_t tcp_port = 0;
919 ocs_log_debug(iscsi->os,
"Upload completed on connection\n");
924 is_ini_cxn = cxn->is_ini_cxn;
926 !iscsi->shutting_down) {
927 remote_ip.
ip_type = cxn->dest_ip_type;
928 ocs_memcpy(remote_ip.
ip_address, cxn->dest_ip, 16);
929 if (cxn->session != NULL) {
930 ocs_strcpy(tgt_name, cxn->session->tgt_name);
932 ocs_log_test(iscsi->os,
"INI session with no session - cannot retry connection %s\n",
936 tcp_port = cxn->dest_port;
946 ocs_log_test(iscsi->os,
"Failed to free connection %s\n", cxn->display_name);
950 !iscsi->shutting_down) {
952 ocs_log_test(iscsi->os,
"failed Starting connection to target\n");
1086 ocs->tcp_window_size,
1134 ocs_log_debug(iscsi->os,
"conn_hdl 0x%x Offloading new connection from %s, MSS %d\n",
1187 ocs_log_test(iscsi->os,
"connection from %s failed to reject\n", cxn->display_name);
1281 ocs_log_test(iscsi->os,
"connection from %s is in the error state\n",
1317 uint32_t ext_status,
1320 ocs_cxn_t *cxn = ul_arg;
1324 ocs_log_test(iscsi->
os,
"Failed rejecting connection from %s\n", cxn->display_name);
1327 ocs_log_debug(iscsi->
os,
"cxn rejected from %s\n", cxn->display_name);
1347 uint32_t ext_status,
1350 ocs_cxn_t *cxn = ul_arg;
1354 ocs_log_test(iscsi->
os,
"Failed offloading connection from %s\n",
1358 ocs_log_debug(iscsi->
os,
"cxn Offloaded from %s, window scale %d\n",
1379 uint32_t ext_status,
1382 ocs_cxn_t *cxn = ul_arg;
1387 ocs_log_test(iscsi->
os,
"Failed offloading connection from %s\n",
1393 ip_str,
sizeof(ip_str));
1395 ocs_snprintf(cxn->display_name,
1396 sizeof(cxn->display_name),
1415 uint32_t ext_status,
1418 ocs_cxn_t *cxn = ul_arg;
1422 ocs_log_debug(iscsi->
os,
"Connect success\n");
1425 ocs_log_test(iscsi->
os,
"TCP connect failed with status %d, ext_status %d\n",
1426 status, ext_status);
1441 uint32_t ext_status,
1444 ocs_cxn_t *cxn = ul_arg;
1448 ocs_log_test(iscsi->
os,
"Failed to upload connection %s\n",
1452 ocs_log_debug(iscsi->
os,
"connection uploaded %s\n",
1469 uint32_t ext_status,
1472 ocs_cxn_t *cxn = ul_arg;
1476 ocs_log_test(iscsi->
os,
"Failed to close connection %s\n",
1480 ocs_log_debug(iscsi->
os,
"closed connection %s\n",
1508 ocs_log_test(iscsi->
os,
"target name exceeds maximum length\n");
1517 isid = 0x0000c9000000l | cxn->instance_index;
1523 cxn->instance_index,
1528 ocs_log_test(iscsi->
os,
"failed, ocs_session_cxn_new() return %d\n",
1535 cxn->dest_ip_type = remote_ip->
ip_type;
1536 ocs_memcpy(cxn->dest_ip, remote_ip->
ip_address, 16);
1537 cxn->dest_port = tcp_port;
1540 ip_str,
sizeof(ip_str));
1541 ocs_snprintf(cxn->display_name,
1542 sizeof(cxn->display_name),
1546 ocs_log_debug(iscsi->
os,
"attempt to connect to IP address %s\n",
1550 ocs_log_err(iscsi->
os,
"Failed allocating an initiator connection\n");
1567 ocs_t *ocs = iscsi->
os;
1568 ocs_cxn_t *cxn = NULL;
1571 ocs_log_debug(iscsi->
os,
"cxn event received conn_hdl 0x%x\n", conn_hdl);
1584 ocs_log_test(iscsi->
os,
"conn_hdl %u failed adding initiator to target server\n",
1600 uint32_t ext_status,
1603 ocs_cxn_t *cxn = ul_arg;
1607 ocs_log_test(iscsi->
os,
"Failed to close connection %s\n",
1611 ocs_log_debug(iscsi->
os,
"Invalidated cxn %s success\n",
1630 ocs_log_debug(iscsi->
os,
"sent request to close cxn, hdl=0x%x\n",
1669 ocs_t *ocs = iscsi->
os;
1678 cxn->data_digest = (ocs->enable_data_digest ? 1 : 0);
1679 cxn->hdr_digest = (ocs->enable_hdr_digest ? 1 : 0);
1681 cxn->max_rcv_dsl = 8192;
1682 cxn->max_xmit_dsl = 8192;
1683 cxn->chap_state = 0;
1684 cxn->chap_ident_recv = 0;
1685 cxn->chap_challenge_recv = NULL;
1686 cxn->chap_response = NULL;
1687 cxn->chap_name_recv = NULL;
1688 cxn->chap_name_send = NULL;
1690 cxn->ocs = iscsi->
os;
1692 cxn->session = NULL;
1694 cxn->is_leading_login = TRUE;
1695 cxn->is_first_login_rsp = 1;
1696 cxn->send_logout_rsp = 0;
1697 cxn->logout_rsp = 0;
1698 cxn->idle_count = 0;
1699 cxn->lgn_parms_sent = 0;
1700 cxn->lgn_parms_recv = 0;
1702 cxn->no_idle_timer = FALSE;
1704 cxn->ffp_is_neg_active = FALSE;
1706 cxn->cbit_rsp = NULL;
1707 cxn->cbit_rsp_len = 0;
1708 cxn->cbit_rsp_offset = 0;
1709 cxn->data_digest_error = FALSE;
1710 cxn->login_hdr_mem =
1712 cxn->login_data_mem =
1715 ocs_atomic_init(&cxn->login_mem_in_use, 0);
1717 ocs_atomic_init(&cxn->nop_abort_counter, 0);
1750 ocs_ddump_value(textbuf,
"source_ip_type",
"%d", node->source_ip_type);
1753 node->source_ip, ip_str,
sizeof(ip_str));
1759 node->dest_ip, ip_str,
sizeof(ip_str));
1763 ocs_ddump_value(textbuf,
"max_wr_xfer_size",
"%d", node->max_wr_xfer_size);
1786 ocs_node_t *node = (ocs_node_t *)
object;
1822 if ((io->mgmt_functions) && (io->mgmt_functions->get_list_handler)) {
1823 io->mgmt_functions->get_list_handler(textbuf, io);
1836 ocs_node_t *node = (ocs_node_t *)
object;
1842 ocs_snprintf(qualifier,
sizeof(qualifier),
"%s.node%d", parent, node->instance_index);
1845 if (ocs_strncmp(name, qualifier, strlen(qualifier)) == 0) {
1846 char *unqualified_name = name + strlen(qualifier) +1;
1849 if (ocs_strcmp(unqualified_name,
"cid") == 0) {
1852 }
else if (ocs_strcmp(unqualified_name,
"source_ip_type") == 0) {
1855 }
else if (ocs_strcmp(unqualified_name,
"source_ip") == 0) {
1857 node->source_ip, ip_str,
sizeof(ip_str));
1860 }
else if (ocs_strcmp(unqualified_name,
"source_port") == 0) {
1863 }
else if (ocs_strcmp(unqualified_name,
"dest_ip_type") == 0) {
1866 }
else if (ocs_strcmp(unqualified_name,
"dest_ip") == 0) {
1868 node->dest_ip, ip_str,
sizeof(ip_str));
1871 }
else if (ocs_strcmp(unqualified_name,
"dest_port") == 0) {
1874 }
else if (ocs_strcmp(unqualified_name,
"tcp_mss") == 0) {
1877 }
else if (ocs_strcmp(unqualified_name,
"is_ini_cxn") == 0) {
1880 }
else if (ocs_strcmp(unqualified_name,
"max_wr_xfer_size") == 0) {
1883 }
else if (ocs_strcmp(unqualified_name,
"display_name") == 0) {
1886 }
else if (ocs_strcmp(unqualified_name,
"cxn_state") == 0) {
1889 }
else if (ocs_strcmp(unqualified_name,
"is_leading_login") == 0) {
1892 }
else if (ocs_strcmp(unqualified_name,
"sendRst") == 0) {
1895 }
else if (ocs_strcmp(unqualified_name,
"idle_count") == 0) {
1898 }
else if (ocs_strcmp(unqualified_name,
"lgn_parms_sent") == 0) {
1901 }
else if (ocs_strcmp(unqualified_name,
"lgn_parms_recv") == 0) {
1904 }
else if (ocs_strcmp(unqualified_name,
"stat_sn") == 0) {
1911 if ((io->mgmt_functions) && (io->mgmt_functions->get_handler)) {
1912 retval = io->mgmt_functions->get_handler(textbuf, qualifier, name, io);
1932 ocs_node_t *node = (ocs_node_t *)
object;
1940 node->source_ip, ip_str,
sizeof(ip_str));
1945 node->dest_ip, ip_str,
sizeof(ip_str));
1962 if ((io->mgmt_functions) && (io->mgmt_functions->get_all_handler)) {
1963 io->mgmt_functions->get_all_handler(textbuf, io);
1976 ocs_node_t *node = (ocs_node_t *)
object;
1980 ocs_snprintf(qualifier,
sizeof(qualifier),
"%s/node[%d]", parent, node->instance_index);
1983 if (ocs_strncmp(name, qualifier, strlen(qualifier)) == 0) {
1988 if ((io->mgmt_functions) && (io->mgmt_functions->set_handler)) {
1989 retval = io->mgmt_functions->set_handler(qualifier, name, value, io);
2004 void *arg_out, uint32_t arg_out_length,
void *
object)
2007 ocs_node_t *node = (ocs_node_t *)
object;
2011 ocs_snprintf(qualifier,
sizeof(qualifier),
"%s.node%d", parent, node->instance_index);
2014 if (ocs_strncmp(action, qualifier, strlen(qualifier)) == 0) {
2019 if ((io->mgmt_functions) && (io->mgmt_functions->exec_handler)) {
2020 retval = io->mgmt_functions->exec_handler(qualifier, action, arg_in, arg_in_length,
2021 arg_out, arg_out_length, io);
static int32_t ocs_list_on_list(ocs_list_link_t *link)
Test if object is on a list.
void ocs_iscsi_cbit_cleanup(ocs_cxn_t *cxn)
Sends the login parameters to the firmware.
ocs_hal_rtn_e ocs_hal_cxn_connect(ocs_hal_t *hal, ocs_cxn_t *cxn, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, uint16_t window_size, uint8_t window_scale, cxn_cb_t cxn_cb, void *ul_arg)
Establish a TCP connection from an initiator to a target.
static void ocs_cxn_set_sm_retry_timer(ocs_cxn_t *cxn, uint32_t timeout)
Set the SM timer to retry a command at a later time.
static void * __ocs_cxn_connect_delay(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Connection to target failed, delay before retrying.
static void ocs_cxn_connect_cb(void *, int32_t, uint32_t, void *)
This function is the callback for connecting to a target.
ocs_hal_rtn_e ocs_hal_cxn_close(ocs_hal_t *hal, ocs_cxn_t *cxn, uint8_t sendRst, cxn_cb_t cxn_cb, void *ul_arg)
Invalidates a connection and optionally sends a TCP Reset.
ocs_iscsi_mem_tracker_t cxn_login_data
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.
static void * __ocs_cxn_upload_wait(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Waiting for connection upload to complete.
int ocs_mgmt_node_set(char *parent, char *name, char *value, void *node)
void ocs_scsi_pending_cleanup(ocs_node_t *node)
Clean up any IOs on the pending list when a connection goes down.
static void * __ocs_cxn_connect_wait(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Waiting for the connection to complete.
static void ocs_cxn_get_info_cb(void *, int32_t, uint32_t, void *)
Function to receive the notification that the connection info is available.
static int32_t ocs_list_empty(ocs_list_t *list)
Test if a list is empty.
static void * __ocs_cxn_initial(ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
State: Initial state.
void ocs_mgmt_emit_int(ocs_textbuf_t *textbuf, int mode, const char *name, const char *fmt,...)
Generate a property with an integer value in a management XML document.
static void ocs_cxn_retry_timeout(void *arg)
This function is called on timer expiration and sends an event to the the state machine.
static void * __ocs_cxn_reject_wait(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Waiting for connection reject request to complete.
static ocs_mgmt_functions_t node_mgmt_functions
ocs_cxn_t * ocs_hal_cxn_alloc(ocs_hal_t *hal, uint32_t conn_hdl)
Gets a free connection structure.
static void * __ocs_cxn_upload(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Closing, waiting for the close callback.
ocs_cxn_t * ocs_cxn_alloc(ocs_iscsi_t *iscsi, uint32_t conn_hdl)
Allocates a connection and initializes the fields as required.
int32_t ocs_iscsi_send_login(ocs_cxn_t *cxn, bool is_discovery, char *tgt_name)
Function to send an initial login PDU.
int32_t ocs_cxn_initialize(ocs_iscsi_t *iscsi)
Initialize the iSCSI connection objects.
static void * __ocs_cxn_close(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
Closes a TCP connection.
#define OCS_ISCSI_CXN_RETRY_TIMER_CONNECT_MS
int ocs_ddump_node(ocs_textbuf_t *textbuf, ocs_node_t *node)
Generate node ddump data.
ocs_hal_rtn_e ocs_hal_cxn_reject(ocs_hal_t *hal, uint32_t conn_hdl, cxn_cb_t cxn_cb, void *ul_arg)
Rejects an incoming connection on a target.
void ocs_mgmt_node_get_all(ocs_textbuf_t *textbuf, void *node)
int ocs_mgmt_node_get(ocs_textbuf_t *textbuf, char *parent, char *name, void *node)
ocs_iscsi_mem_tracker_t cxn_login_hdr
static void ocs_cxn_transition(ocs_cxn_t *cxn, ocs_sm_function_t state, void *data)
Transition state of a node.
#define OCS_ISCSI_LOGIN_PAYLOAD_SIZE
void ocs_cxn_force_free(ocs_cxn_t *cxn)
Free memory resources of a node object.
static void ocs_device_lock(ocs_t *ocs)
char * ocs_iscsi_ini_get_name(ocs_t *ocs)
Return this initiator's name.
int32_t ocs_scsi_del_initiator(ocs_node_t *node, ocs_scsi_del_initiator_reason_e reason)
Delete a SCSI initiator node.
void ocs_ddump_section(ocs_textbuf_t *textbuf, const char *name, uint32_t instance)
Generate driver dump section start data.
#define CONN_STATE_NEW_CONN
void ocs_mgmt_start_section(ocs_textbuf_t *textbuf, const char *name, int index)
Generate the beginning of a numbered section in a management XML document.
int const char const char void ocs_mgmt_emit_boolean(ocs_textbuf_t *textbuf, int access, const char *name, const int value)
Generate a property with a boolean value in a management XML document.
#define std_cxn_state_decl(...)
static void * ocs_list_remove(ocs_list_t *list, void *item)
Remove an item from the list.
void ocs_cxn_teardown(ocs_iscsi_t *iscsi)
Free the iSCSI connection objects.
const char * ocs_sm_event_name(ocs_sm_event_t evt)
int32_t ocs_session_cxn_del(ocs_cxn_t *cxn)
Removes a connection from its session.
#define OCS_ISCSI_CACHE_LINE_SIZE
#define ocs_list_init(head, type, link)
static void * __ocs_cxn_close_abort_io(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
Aborts active IO objects on a connection.
ocs_ip_type_e ocs_iscsi_convert_to_ip_type(ocs_hal_ip_type_e ip_type)
Convert an HAL IP type to the iSCSI API value.
ocs_hal_rtn_e ocs_hal_io_abort(ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_abort_scope_e abort_scope, ocs_hal_abort_type_e abort_type)
Abort a currently running IO.
int ocs_mgmt_node_exec(char *parent, char *action, void *arg_in, uint32_t arg_in_length, void *arg_out, uint32_t arg_out_length, void *node)
void *(* ocs_sm_function_t)(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
#define ocs_list_foreach_safe(list, item, nxt)
Iterate a linked list safely.
static void ocs_device_unlock(ocs_t *ocs)
static void ocs_tgt_cxn_invalidate_cb(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
static void * __ocs_cxn_offload_wait(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Waiting for connection offload request to complete.
#define CONN_STATE_LOGOUT_REQUESTED
static void * __ocs_cxn_connect(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Connect to a remote node.
void ocs_iscsi_tracker_init(ocs_iscsi_mem_tracker_t *tracker)
Initialize the memory tracker.
void ocs_mgmt_end_section(ocs_textbuf_t *textbuf, const char *name, int index)
Generate the indexed end of a section in a management XML document.
static void * __ocs_cxn_close_abort_login(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
Aborts any login transactions on a connection.
ocs_hal_ip_type_e ip_type
static void * __ocs_cxn_offload(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
Offload the connection to the chip.
static void * __ocs_cxn_close_wait(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Closing, waiting for the close callback.
ocs_hal_rtn_e ocs_hal_cxn_offload(ocs_hal_t *hal, ocs_cxn_t *cxn, uint32_t tcp_window_size, uint8_t data_digest, uint8_t hdr_digest, uint32_t max_rcv_dsl, cxn_cb_t cxn_cb, void *ul_arg)
Offloads an incoming connection on a target.
void ocs_ddump_endsection(ocs_textbuf_t *textbuf, const char *name, uint32_t instance)
Generate driver dump section end data.
static int32_t ocs_node_lock_try(ocs_node_t *node)
static void * __ocs_cxn_abort_wait(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Waiting for the IO aborts to complete.
ocs_mgmt_get_list_handler get_list_handler
static void * __ocs_cxn_get_info(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
Get information on the connection.
ocs_hal_rtn_e ocs_hal_cxn_free(ocs_hal_t *hal, ocs_cxn_t *cxn)
Frees a connection object for re-use.
static void ocs_cxn_close_cb(void *, int32_t, uint32_t, void *)
This function is the callback for closing a connection.
int ocs_sm_post_event(ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *data)
Post an event to a context.
static void ocs_cxn_upload_cb(void *, int32_t, uint32_t, void *)
This function is the callback for uploading a connection.
ocs_dma_t * ocs_iscsi_tracker_calc(ocs_iscsi_mem_tracker_t *tracker, uint32_t obj_offset)
Helper to return the pointers for a specific object in the group.
#define OCS_ISCSI_LOGIN_MAX_RECV_DATA_SEG_LEN
void ocs_scsi_tgt_ddump(ocs_textbuf_t *textbuf, ocs_scsi_ddump_type_e type, void *obj)
static void * __ocs_cxn_reject(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
Reject a connection after some connection protocol started.
static void ocs_cxn_offload_cb(void *, int32_t, uint32_t, void *)
Function to receive the notification that the connection info is available.
void format_ip_address(ocs_ip_type_e ip_type, uint8_t *address, char *buffer, int size)
Format an IP address into a string.
structure wrapping an IP address together with it's type.
static void ocs_node_lock(ocs_node_t *node)
static void * __ocs_cxn_common(const char *funcname, ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
State: Common device event handler.
int32_t ocs_cxn_connect(ocs_iscsi_t *iscsi, ocs_hal_ip_address_t *remote_ip, uint16_t tcp_port, char *tgt_name)
Log an initiator into the specified target address.
int32_t ocs_iscsi_send_logout_rsp(ocs_cxn_t *cxn, uint8_t response, uint32_t itt)
Function to send a logout response PDU.
ocs_hal_rtn_e ocs_hal_cxn_get_info(ocs_hal_t *hal, ocs_cxn_t *cxn, cxn_cb_t cxn_cb, void *ul_arg)
Retrieves information about an incoming context.
#define ocs_is_target_enabled()
void ocs_ddump_io(ocs_textbuf_t *textbuf, ocs_io_t *io)
generate IO context ddump data
static void * __ocs_cxn_get_info_wait(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Waiting for connection information request to complete.
static void ocs_node_unlock(ocs_node_t *node)
int32_t ocs_scsi_del_target(ocs_node_t *node, ocs_scsi_del_target_reason_e reason)
Delete a SCSI target node.
int32_t ocs_scsi_validate_initiator(ocs_node_t *node)
Validate a new initiator.
static void ocs_cxn_reject_cb(void *, int32_t, uint32_t, void *)
Function to receive the notification that the connection reject is complete.
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.
void ocs_mgmt_node_list(ocs_textbuf_t *textbuf, void *node)
#define OCS_MAX_ISCSI_NAME
static void ocs_io_free(ocs_t *ocs, ocs_io_t *io)
static void * __ocs_cxn_connected(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
State: Connected, waiting for the teardown request.
static void ocs_scsi_notify_node_force_free(ocs_node_t *node)
Notification from base driver that node is in force-free path.
ocs_sm_event_t
State Machine Events.
void ocs_mgmt_emit_string(ocs_textbuf_t *textbuf, int access, const char *name, const char *value)
Generate a property with a string value in a management XML document.
#define ocs_list_foreach(list, item)
Iterate a linked list.
#define OCS_ISCSI_CXN_RETRY_TIMER_NO_RESOURCES_MS
int32_t ocs_cxn_new_tgt_connection(ocs_iscsi_t *iscsi, uint32_t conn_hdl)
Function to receive new TCP connections.
void ocs_sm_disable(ocs_sm_ctx_t *ctx)
Disable further state machine processing.
int32_t ocs_iscsi_tracker_alloc(ocs_iscsi_t *iscsi, ocs_iscsi_mem_tracker_t *tracker, uint8_t zero, uint32_t object_size, uint32_t alignment, uint32_t num_objects)
Allocate a group of objects uses pages to minimize waste.
int32_t ocs_cxn_close(ocs_cxn_t *cxn, uint8_t sendRst)
Issues a request to the HAL to close the connection.
static void * __ocs_cxn_error(ocs_sm_ctx_t *, ocs_sm_event_t, void *)
An error was received, something unexpected occurred.
void ocs_mgmt_emit_property_name(ocs_textbuf_t *textbuf, int access, const char *name)
Generate a property, with no value, in a management XML document.
void ocs_ddump_value(ocs_textbuf_t *textbuf, const char *name, const char *fmt,...)
Generate driver dump data for a given value.
#define CONN_STATE_CLEANUP
void ocs_iscsi_tracker_free(ocs_iscsi_t *iscsi, ocs_iscsi_mem_tracker_t *tracker)
Free the memory associated with a memory tracker.
ocs_hal_rtn_e ocs_iscsi_login_cxn_cleanup(ocs_cxn_t *cxn)
Frees any retry objects for the connection.
ocs_hal_rtn_e ocs_hal_cxn_upload(ocs_hal_t *hal, ocs_cxn_t *cxn, uint8_t graceful, cxn_cb_t cxn_cb, void *ul_arg)
uploads an incoming connection on a target.
void ocs_tgt_cxn_invalidate(ocs_cxn_t *cxn)