Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_iscsi.h File Reference
#include "ocs_os.h"
#include "ocs_hal.h"
#include "ocs_ioctl.h"

Go to the source code of this file.

Detailed Description

Defines the iSCSI interface functions to the os specific code. Contains many of the iSCSI configuration parameters and structures. This code should be OS independant.

Definition in file ocs_iscsi.h.

Data Structures

struct  ocs_iscsi_mem_tracker_t
 iSCSI object memory tracker More...
 
struct  ocs_iscsi_lgn_retry_t
 object to queue login requests waiting for buffers More...
 
struct  ocs_iscsi_route_table_entry_t
 Structure used to hold the response entries of set_route_table command. More...
 
struct  ocs_iscsi_route_table_t
 
struct  ocs_config_ctx_t
 structure used to signal when a mailbox command callback is complete and passes the status and any other parameters back to the caller. More...
 
struct  ocs_iscsi_cluster_tgt_t
 
struct  ocs_iscsi_cluster_sendtargets_t
 
struct  ocs_iscsi_tgt_ip_t
 Stores information needed IP addresses for targets. More...
 
struct  ocs_iscsi_t
 iSCSI object More...
 

Macros

#define ISCSI_LUN_ADDRESS_METHOD_SHIFT   6
 
#define ISCSI_LUN_ADDRESS_METHOD_MASK   0xc0
 
#define ISCSI_LUN_ADDR_METHOD_PERIPHERAL   0x0
 
#define ISCSI_LUN_ADDR_METHOD_FLAT   0x1
 
#define ISCSI_LUN_ADDR_METHOD_LOGICAL   0x2
 
#define ISCSI_LUN_ADDR_METHOD_EXTENDED   0x3
 
#define ISCSI_LUN_ADDR_SIMPLE_MAX   0xff
 
#define ISCSI_LUN_ADDR_FLAT_MAX   0x3fff
 
#define LOW_THRESH   0x10000000
 
#define HIGH_THRESH   0xefffffff
 
#define GT_WRAPPED(a_cmd_sn, b_cmd_sn)
 
#define GT_NOTWRAPPED(a, b)
 
#define GT_WRAP(a, b)   (GT_NOTWRAPPED((a), (b)) || GT_WRAPPED((a), (b)))
 
#define GTE_WRAP(a, b)   ( ( (a)==(b) ) || GT_WRAP((a),(b)) )
 
#define OCS_CNFG_CTX_COMPL_TIMEOUT   (3 * 1000000)
 
#define OCS_ISCSI_MAX_LINK_STATE_CALLBACKS   2
 
#define OCS_CLUST_TARGET_KEY_RETCNT   (9999)
 
#define OCS_CLUST_TARGET_TTT   (0xFFFFFF00)
 
#define OCS_MAX_IP   256
 

Typedefs

typedef void(* ocs_link_state_cb_t )(ocs_t *, ocs_link_state_e)
 Template for a function to be called when the link state changes. More...
 

Enumerations

enum  ocs_pdu_process_rtn_e {
  OCS_PDU_RTN_PROCESSED = 0, OCS_PDU_RTN_CBIT_QUEUED, OCS_PDU_RTN_SEND_REJECT, OCS_PDU_RTN_NO_RESOURCES,
  OCS_PDU_RTN_GENERAL_ERROR
}
 iSCSI PDU processing return codes More...
 
enum  ocs_iscsi_retry_type_e {
  OCS_RETRY_REQ_RECV_LOGIN_RSP, OCS_RETRY_REQ_RECV_LOGOUT, OCS_RETRY_REQ_SEND_ASYNC, OCS_RETRY_REQ_SEND_LOGIN,
  OCS_RETRY_REQ_SEND_LOGIN_RSP_INVALID, OCS_RETRY_REQ_SEND_LOGOUT, OCS_RETRY_REQ_SEND_LOGOUT_RSP, OCS_RETRY_REQ_SEND_NOP_IN,
  OCS_RETRY_REQ_SEND_NOP_OUT, OCS_RETRY_REQ_SEND_REJECT
}
 The types of requests that may be retried. More...
 
enum  ocs_config_ctx_e {
  OCS_CNFG_CTX_IP_ADD, OCS_CNFG_CTX_IP_QUERY, OCS_CNFG_CTX_IP_REMOVE, OCS_CNFG_CTX_ISNS_DISC,
  OCS_CNFG_CTX_ISNS_SEND, OCS_CNFG_CTX_LISTEN_START, OCS_CNFG_CTX_LISTEN_STOP, OCS_CNFG_CTX_PORTAL_CREATE,
  OCS_CNFG_CTX_PORTAL_DELETE, OCS_CNFG_CTX_SET_GATEWAY, OCS_CNFG_CTX_SET_MAC, OCS_CNFG_CTX_SET_MTU,
  OCS_CNFG_CTX_SET_VLAN, OCS_CNFG_CTX_SET_ROUTE_TABLE, OCS_CNFG_CTX_GET_ROUTE_TABLE, OCS_CNFG_CTX_MAX
}
 The types of mailbox operations we want to wait for. More...
 

Functions

int32_t ocs_iscsi_interrupts_required (ocs_os_handle_t, ocs_hal_t *)
 Returns the number of interrupts needed for this adapter. More...
 
int32_t ocs_iscsi_initialize (ocs_os_handle_t, ocs_iscsi_t *, ocs_hal_t *, uint32_t)
 Initialize the iSCSI device by setting up the chip. More...
 
void ocs_iscsi_uninitialize (ocs_iscsi_t *)
 Indicate that HAL is not initialized. More...
 
int32_t ocs_iscsi_teardown (ocs_iscsi_t *)
 Shut down the device. More...
 
int32_t ocs_iscsi_register_link_state_callback (ocs_t *ocs, ocs_link_state_cb_t)
 Register to receive link state change notifications. More...
 
void ocs_iscsi_unregister_link_state_callback (ocs_t *ocs, ocs_link_state_cb_t)
 Unregister a link state change callback. More...
 
void ocs_iscsi_rx_buffers_free (ocs_iscsi_t *, ocs_hal_rq_buffer_t *, ocs_hal_rq_buffer_t *)
 Add a receive buffer pair to the Receive Queue, if an error is received, then queue the buffer. More...
 
void ocs_iscsi_cxn_req_invalidate (ocs_iscsi_t *iscsi)
 
int32_t ocs_iscsi_inet_pton4 (const char *src, ocs_ip_address_t *ip)
 Converts an IPv4 address from a string to the IP structure. More...
 
int32_t ocs_iscsi_inet_pton6 (const char *src, ocs_ip_address_t *ip)
 Converts an IPv6 address from a string to the IP structure. More...
 
ocs_hal_ip_type_e ocs_iscsi_convert_to_hal_ip_type (ocs_ip_type_e ip_type)
 Convert an iSCSI IP type to the HAL value. More...
 
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. More...
 
void ocs_iscsi_convert_to_hal_ip (ocs_ip_address_t *ip, ocs_hal_ip_address_t *hal_ip)
 Convert an iSCSI IP address to the HAL IP address. More...
 
void ocs_iscsi_convert_to_ip (ocs_ip_address_t *ip, ocs_hal_ip_address_t *hal_ip)
 Convert an iSCSI IP address to the HAL IP address. More...
 
void ocs_iscsi_ipsub_combine (ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *ip, ocs_ip_address_t *subnet)
 Combines an iSCSI IP address and subnet into the combined structure. More...
 
void ocs_iscsi_ipsub_split (ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *ip, ocs_ip_address_t *subnet)
 Splits an iSCSI IP address and subnet from the combined structure. More...
 
void format_ip_address (ocs_ip_type_e ip_type, uint8_t *address, char *buffer, int size)
 Format an IP address into a string. More...
 
void format_mac_address (uint8_t *address, char *buffer, int size)
 Format a MAC address into a string. More...
 
int32_t parse_mac_address (const char *src, uint8_t *dest)
 Parse a string into a MAC address. More...
 
int32_t ocs_iscsi_send_tmf_resp (ocs_io_t *io, uint8_t response, ocs_scsi_io_cb_t cb, void *arg)
 send TMF response data More...
 
int32_t ocs_scsi_io_dispatch (ocs_io_t *io, void *cb)
 Attempt to dispatch an IO. More...
 
void ocs_scsi_pending_cleanup (ocs_node_t *node)
 Clean up any IOs on the pending list when a connection goes down. More...
 
void ocs_target_io_aborted_nop_cmpl (ocs_cxn_t *cxn)
 This function is called whenever a target NOP completes. More...
 
int32_t ocs_iscsi_add_ip_to_tbl (ocs_t *ocs, char *desc, ocs_ip_address_subnet_t *ipsub, ocs_hal_portal_t portal)
 Adds an IP address to the table. More...
 
int32_t ocs_iscsi_remove_ip_from_tbl (ocs_t *ocs, ocs_ip_address_subnet_t *ipsub, ocs_hal_portal_t portal)
 Remove an IP address from the table. More...
 
int32_t ocs_iscsi_is_ip_in_tbl (ocs_t *ocs, ocs_ip_address_subnet_t *ipsub)
 Checks if an IP address/subnet is present in the table. More...
 
ocs_pdu_process_rtn_e ocs_iscsi_tgt_process_cmd_sn (ocs_iscsi_t *iscsi, 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, uint8_t *reject_reason)
 Function to process unsolicited PDUs for a target. More...
 
void ocs_iscsi_tracker_init (ocs_iscsi_mem_tracker_t *tracker)
 Initialize the memory tracker. More...
 
void ocs_iscsi_tracker_free (ocs_iscsi_t *iscsi, ocs_iscsi_mem_tracker_t *tracker)
 Free the memory associated with a memory tracker. More...
 
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. More...
 
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. More...
 
int32_t ocs_iscsi_portal_read_vlan_ids (ocs_t *ocs, void *arg_out, uint32_t arg_out_length)
 Read VLAN IDs to provided buffer. More...
 
int32_t ocs_iscsi_portal_del_vlan (ocs_t *ocs, ocs_hal_portal_t iface)
 Delete iface handle and VLAN from portal_list. More...
 
int32_t ocs_iscsi_route_table_del_entry (ocs_t *ocs, ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *gateway)
 Deletes an entry from a routing table. More...
 
int32_t ocs_iscsi_route_table_read (ocs_t *ocs, ocs_route_table_t *route_table)
 
int32_t ocs_iscsi_route_table_add_entry (ocs_t *ocs, ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *gateway)
 Adds an entry to a routing table. More...
 
void ocs_iscsi_cluster_tgts_free (ocs_iscsi_t *iscsi)
 iscsi cluster targets free More...
 
bool ocs_scsi_check_cxn_wq_full (ocs_t *ocs, ocs_cxn_t *cxn)
 Check Connection WQ's full status. More...
 

Macro Details

#define GT_NOTWRAPPED (   a,
  b 
)
Value:
(((a) > (b)) && (((a) < HIGH_THRESH) || \
((b) > LOW_THRESH)))
#define LOW_THRESH
Definition: ocs_iscsi.h:67
#define HIGH_THRESH
Definition: ocs_iscsi.h:68

Definition at line 79 of file ocs_iscsi.h.

#define GT_WRAP (   a,
  b 
)    (GT_NOTWRAPPED((a), (b)) || GT_WRAPPED((a), (b)))

Definition at line 87 of file ocs_iscsi.h.

#define GT_WRAPPED (   a_cmd_sn,
  b_cmd_sn 
)
Value:
(((b_cmd_sn) > HIGH_THRESH) && \
((a_cmd_sn) < LOW_THRESH))
#define LOW_THRESH
Definition: ocs_iscsi.h:67
#define HIGH_THRESH
Definition: ocs_iscsi.h:68

Definition at line 73 of file ocs_iscsi.h.

#define GTE_WRAP (   a,
  b 
)    ( ( (a)==(b) ) || GT_WRAP((a),(b)) )

Definition at line 94 of file ocs_iscsi.h.

#define HIGH_THRESH   0xefffffff

Definition at line 68 of file ocs_iscsi.h.

#define ISCSI_LUN_ADDR_FLAT_MAX   0x3fff

Definition at line 62 of file ocs_iscsi.h.

#define ISCSI_LUN_ADDR_METHOD_EXTENDED   0x3

Definition at line 59 of file ocs_iscsi.h.

#define ISCSI_LUN_ADDR_METHOD_FLAT   0x1

Definition at line 57 of file ocs_iscsi.h.

#define ISCSI_LUN_ADDR_METHOD_LOGICAL   0x2

Definition at line 58 of file ocs_iscsi.h.

#define ISCSI_LUN_ADDR_METHOD_PERIPHERAL   0x0

Definition at line 56 of file ocs_iscsi.h.

#define ISCSI_LUN_ADDR_SIMPLE_MAX   0xff

Definition at line 61 of file ocs_iscsi.h.

#define ISCSI_LUN_ADDRESS_METHOD_MASK   0xc0

Definition at line 55 of file ocs_iscsi.h.

#define ISCSI_LUN_ADDRESS_METHOD_SHIFT   6

Definition at line 54 of file ocs_iscsi.h.

#define LOW_THRESH   0x10000000

Definition at line 67 of file ocs_iscsi.h.

#define OCS_CLUST_TARGET_KEY_RETCNT   (9999)

Definition at line 242 of file ocs_iscsi.h.

#define OCS_CLUST_TARGET_TTT   (0xFFFFFF00)

Definition at line 252 of file ocs_iscsi.h.

#define OCS_CNFG_CTX_COMPL_TIMEOUT   (3 * 1000000)

Definition at line 181 of file ocs_iscsi.h.

#define OCS_ISCSI_MAX_LINK_STATE_CALLBACKS   2

Definition at line 236 of file ocs_iscsi.h.

#define OCS_MAX_IP   256

Definition at line 288 of file ocs_iscsi.h.

Type Details

typedef void(* ocs_link_state_cb_t)(ocs_t *, ocs_link_state_e)

Template for a function to be called when the link state changes.

Definition at line 234 of file ocs_iscsi.h.

Enumeration Details

The types of mailbox operations we want to wait for.

Enumerator
OCS_CNFG_CTX_IP_ADD 
OCS_CNFG_CTX_IP_QUERY 
OCS_CNFG_CTX_IP_REMOVE 
OCS_CNFG_CTX_ISNS_DISC 
OCS_CNFG_CTX_ISNS_SEND 
OCS_CNFG_CTX_LISTEN_START 
OCS_CNFG_CTX_LISTEN_STOP 
OCS_CNFG_CTX_PORTAL_CREATE 
OCS_CNFG_CTX_PORTAL_DELETE 
OCS_CNFG_CTX_SET_GATEWAY 
OCS_CNFG_CTX_SET_MAC 
OCS_CNFG_CTX_SET_MTU 
OCS_CNFG_CTX_SET_VLAN 
OCS_CNFG_CTX_SET_ROUTE_TABLE 
OCS_CNFG_CTX_GET_ROUTE_TABLE 
OCS_CNFG_CTX_MAX 

Definition at line 186 of file ocs_iscsi.h.

The types of requests that may be retried.

Enumerator
OCS_RETRY_REQ_RECV_LOGIN_RSP 
OCS_RETRY_REQ_RECV_LOGOUT 
OCS_RETRY_REQ_SEND_ASYNC 
OCS_RETRY_REQ_SEND_LOGIN 
OCS_RETRY_REQ_SEND_LOGIN_RSP_INVALID 
OCS_RETRY_REQ_SEND_LOGOUT 
OCS_RETRY_REQ_SEND_LOGOUT_RSP 
OCS_RETRY_REQ_SEND_NOP_IN 
OCS_RETRY_REQ_SEND_NOP_OUT 
OCS_RETRY_REQ_SEND_REJECT 

Definition at line 130 of file ocs_iscsi.h.

iSCSI PDU processing return codes

Enumerator
OCS_PDU_RTN_PROCESSED 
OCS_PDU_RTN_CBIT_QUEUED 
OCS_PDU_RTN_SEND_REJECT 
OCS_PDU_RTN_NO_RESOURCES 
OCS_PDU_RTN_GENERAL_ERROR 

Definition at line 99 of file ocs_iscsi.h.

Function Details

void format_ip_address ( ocs_ip_type_e  ip_type,
uint8_t *  address,
char *  buffer,
int  size 
)

Format an IP address into a string.

Description
Given a pointer to an IP address and a buffer, this function writes the IP address into the buffer in human readable form.
Parameters
ip_typeEnumerated type indicating the type of IP address (IPV4, IPV6, etc).
addressPointer to an array containing the IP address to be formatted. 4 bytes for IPV4, 16 bytes for IPV6.
bufferPointer to the buffer into which the result will be placed.
sizeSize of the output buffer in bytes.
Returns
None.

Definition at line 460 of file ocs_iscsi.c.

void format_mac_address ( uint8_t *  address,
char *  buffer,
int  size 
)

Format a MAC address into a string.

Description
Given a pointer to a MAC address and a buffer, this function writes the MAC address into the buffer in human readable form.

Note: To avoid truncation, the output buffer must be at least 18 bytes long.
Parameters
addressPointer to an array of 6 bytes containing the MAC address.
bufferPointer to the buffer into which the result will be placed.
sizeSize of the output buffer in bytes.
Returns
None.

Definition at line 711 of file ocs_iscsi.c.

int32_t ocs_iscsi_add_ip_to_tbl ( ocs_t *  ocs,
char *  desc,
ocs_ip_address_subnet_t *  ipsub,
ocs_hal_portal_t  portal 
)

Adds an IP address to the table.

Parameters
ocsPointer to the ocs structure.
descA character description of the IP address being added.
ipsubPointer to the IP/subnet structure.
portalPortal that has the IP address.

Definition at line 2622 of file ocs_iscsi.c.

void ocs_iscsi_cluster_tgts_free ( ocs_iscsi_t *  iscsi)

iscsi cluster targets free

Definition at line 2211 of file ocs_iscsi.c.

void ocs_iscsi_convert_to_hal_ip ( ocs_ip_address_t *  ip,
ocs_hal_ip_address_t *  hal_ip 
)

Convert an iSCSI IP address to the HAL IP address.

Parameters
ipPointer to the iSCSI IP address.
hal_ipPointer to the HAL IP address.

Definition at line 359 of file ocs_iscsi.c.

ocs_hal_ip_type_e ocs_iscsi_convert_to_hal_ip_type ( ocs_ip_type_e  ip_type)

Convert an iSCSI IP type to the HAL value.

Parameters
ip_typeiSCSI IP type to convert.
Returns
Returns the HAL IP type or OCS_HAL_IP_TYPE_V4 if an invalid value is passed.

Definition at line 296 of file ocs_iscsi.c.

void ocs_iscsi_convert_to_ip ( ocs_ip_address_t *  ip,
ocs_hal_ip_address_t *  hal_ip 
)

Convert an iSCSI IP address to the HAL IP address.

Parameters
ipPointer to the iSCSI IP address.
hal_ipPointer to the HAL IP address.

Definition at line 372 of file ocs_iscsi.c.

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.

Parameters
ip_typeHAL IP type to convert.
Returns
Returns the iSCSI IP type or OCS_IP_TYPE_V4 if an invalid value is passed.

Definition at line 327 of file ocs_iscsi.c.

void ocs_iscsi_cxn_req_invalidate ( ocs_iscsi_t *  iscsi)

Definition at line 4456 of file ocs_iscsi.c.

int32_t ocs_iscsi_inet_pton4 ( const char *  src,
ocs_ip_address_t *  ip 
)

Converts an IPv4 address from a string to the IP structure.

Parameters
srcPointer to the ASCII IP address.
ipPointer to a IP address structure.
Returns
Returns 0 for a valid IP address.

Definition at line 513 of file ocs_iscsi.c.

int32_t ocs_iscsi_inet_pton6 ( const char *  src,
ocs_ip_address_t *  ip 
)

Converts an IPv6 address from a string to the IP structure.

Parameters
srcPointer to the ASCII IP address.
ipPointer to an IP address structure.
Returns
Returns 0 for a valid IP address.

Definition at line 574 of file ocs_iscsi.c.

void ocs_iscsi_ipsub_combine ( ocs_ip_address_subnet_t *  ipsub,
ocs_ip_address_t *  ip,
ocs_ip_address_t *  subnet 
)

Combines an iSCSI IP address and subnet into the combined structure.

Parameters
ipsubPointer to the combined iSCSI IP/subnet address.
ipPointer to the IP address.
subnetPointer to the IP subnet address.

Definition at line 414 of file ocs_iscsi.c.

void ocs_iscsi_ipsub_split ( ocs_ip_address_subnet_t *  ipsub,
ocs_ip_address_t *  ip,
ocs_ip_address_t *  subnet 
)

Splits an iSCSI IP address and subnet from the combined structure.

Parameters
ipsubPointer to the combined iSCSI IP/subnet address.
ipPointer to the IP address.
subnetPointer to the IP subnet address.

Definition at line 431 of file ocs_iscsi.c.

int32_t ocs_iscsi_is_ip_in_tbl ( ocs_t *  ocs,
ocs_ip_address_subnet_t *  ipsub 
)

Checks if an IP address/subnet is present in the table.

Parameters
ocsPointer to the ocs structure.
ipsubPointer to the IP address/subnet structure to check.
Returns
Returns TRUE if the IP address is found.

Definition at line 2742 of file ocs_iscsi.c.

int32_t ocs_iscsi_portal_del_vlan ( ocs_t *  ocs,
ocs_hal_portal_t  iface 
)

Delete iface handle and VLAN from portal_list.

Parameters
ocsPointer to the ocs structure that represents this device.
ifaceThe interface handle to delete
vlan_tagThe vlan id to delete
Returns
Returns 0 on success, otherwise a negative value

Definition at line 3011 of file ocs_iscsi.c.

int32_t ocs_iscsi_portal_read_vlan_ids ( ocs_t *  ocs,
void *  arg_out,
uint32_t  arg_out_length 
)

Read VLAN IDs to provided buffer.

Parameters
ocsPointer to the ocs structure that represents this device.
arg_outPointer to output buffer
arg_out_lengthLength of output buffer
Returns
Returns 0 on success, otherwise a negative value

Definition at line 3041 of file ocs_iscsi.c.

int32_t ocs_iscsi_register_link_state_callback ( ocs_t *  ocs,
ocs_link_state_cb_t  cb 
)

Register to receive link state change notifications.

Description
This function is used by upper level drivers to register a function which should be called when the link state changes.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 3324 of file ocs_iscsi.c.

int32_t ocs_iscsi_remove_ip_from_tbl ( ocs_t *  ocs,
ocs_ip_address_subnet_t *  ipsub,
ocs_hal_portal_t  portal 
)

Remove an IP address from the table.

Parameters
ocsPointer to the ocs structure.
ipsubPointer to the IP/subnet structure.
portalPortal that has the IP address.
Returns
Returns 0 if the address was removed, or -1 if the address was not found.

Definition at line 2696 of file ocs_iscsi.c.

int32_t ocs_iscsi_route_table_add_entry ( ocs_t *  ocs,
ocs_ip_address_subnet_t *  ipsub,
ocs_ip_address_t *  gateway 
)

Adds an entry to a routing table.

Parameters
ocsPointer to the ocs structure that represents this device.
ipsubIP Address, subnet and gateway to add.
Returns
Returns 0 on success.

Definition at line 2328 of file ocs_iscsi.c.

int32_t ocs_iscsi_route_table_del_entry ( ocs_t *  ocs,
ocs_ip_address_subnet_t *  ipsub,
ocs_ip_address_t *  gateway 
)

Deletes an entry from a routing table.

Parameters
ocsPointer to the ocs structure that represents this device.
ipsubIP Address, subnet and gateway to delete.
Returns
Returns 0 on success.

Definition at line 2276 of file ocs_iscsi.c.

int32_t ocs_iscsi_route_table_read ( ocs_t *  ocs,
ocs_route_table_t *  route_table 
)

Definition at line 2371 of file ocs_iscsi.c.

void ocs_iscsi_rx_buffers_free ( ocs_iscsi_t *  iscsi,
ocs_hal_rq_buffer_t *  header,
ocs_hal_rq_buffer_t *  payload 
)

Add a receive buffer pair to the Receive Queue, if an error is received, then queue the buffer.

Parameters
iscsiPointer to the iSCSI object.
headerDMA memory for the unsolicited header.
payloadDMA memory for the unsolicited payload.

Definition at line 4447 of file ocs_iscsi.c.

ocs_pdu_process_rtn_e ocs_iscsi_tgt_process_cmd_sn ( ocs_iscsi_t *  iscsi,
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,
uint8_t *  reject_reason 
)

Function to process unsolicited PDUs for a target.

Parameters
iscsiPointer to the iSCSI structure that represents this device.
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).
reject_reasonReturns the reject reason.
Returns
Returns 0 on success.

Definition at line 4042 of file ocs_iscsi.c.

void ocs_iscsi_unregister_link_state_callback ( ocs_t *  ocs,
ocs_link_state_cb_t  cb 
)

Unregister a link state change callback.

Description
This function is used by upper level drivers to remove the registration of a link state callback function.
Returns
None.

Definition at line 3360 of file ocs_iscsi.c.

bool ocs_scsi_check_cxn_wq_full ( ocs_t *  ocs,
ocs_cxn_t *  cxn 
)

Check Connection WQ's full status.

Parameters
ocsPointer to OCS object
cxnPointer to connection object
Returns
true if connection WQ is full, otherwise false

Definition at line 2374 of file ocs_scsi.c.

int32_t ocs_scsi_io_dispatch ( ocs_io_t *  io,
void *  cb 
)

Attempt to dispatch an IO.

Description
An IO is dispatched. The steps are as follows:
  1. Try to allocate a HAL IO. If none is available, place this IO at the tail of the pending IO list.
  2. With a HAL IO in hand, if there are IOs on the pending IO list, push this IO on the tail of the pending list and pop the head of the pending list.
  3. Attach this IO to the HAL IO and submit it.
Parameters
ioPointer to IO structure.
cbCallback function.
Returns
Returns 0 for success, or a negative error code value for failure.

Definition at line 475 of file ocs_scsi.c.

void ocs_scsi_pending_cleanup ( ocs_node_t *  node)

Clean up any IOs on the pending list when a connection goes down.

Parameters
nodePointer to node structure.

Definition at line 598 of file ocs_scsi.c.

void ocs_target_io_aborted_nop_cmpl ( ocs_cxn_t *  cxn)

This function is called whenever a target NOP completes.

Description
Once a TCP ACK is received, the NOP request completes. We can now free any aborted IOs and they are also TCP ACKed.
Parameters
cxnPointer to the connection object.

Definition at line 120 of file ocs_scsi.c.

int32_t parse_mac_address ( const char *  src,
uint8_t *  dest 
)

Parse a string into a MAC address.

Description
This function parses a human readable MAC address into an array of 6 bytes.

The input should be a string of six two-digit hex numbers, optionally separated by - or :. If the input string is not in one of these formats the results are undefined.
Parameters
srcPointer to the input string.
destPointer to an array of at least 6 bytes in which the MAC address will be stored.
Returns
Returns 0 on success; or -1 if the string does not represent a valid MAC address.

Definition at line 737 of file ocs_iscsi.c.