Go to the source code of this file.
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... | |
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... | |
| #define GT_NOTWRAPPED | ( | a, | |
| b | |||
| ) |
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 | |||
| ) |
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.
| 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.
| enum ocs_config_ctx_e |
The types of mailbox operations we want to wait for.
Definition at line 186 of file ocs_iscsi.h.
The types of requests that may be retried.
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.
| void format_ip_address | ( | ocs_ip_type_e | ip_type, |
| uint8_t * | address, | ||
| char * | buffer, | ||
| int | size | ||
| ) |
Format an IP address into a string.
| ip_type | Enumerated type indicating the type of IP address (IPV4, IPV6, etc). |
| address | Pointer to an array containing the IP address to be formatted. 4 bytes for IPV4, 16 bytes for IPV6. |
| buffer | Pointer to the buffer into which the result will be placed. |
| size | Size of the output buffer in bytes. |
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.
| address | Pointer to an array of 6 bytes containing the MAC address. |
| buffer | Pointer to the buffer into which the result will be placed. |
| size | Size of the output buffer in bytes. |
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.
| ocs | Pointer to the ocs structure. |
| desc | A character description of the IP address being added. |
| ipsub | Pointer to the IP/subnet structure. |
| portal | Portal 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.
| ip | Pointer to the iSCSI IP address. |
| hal_ip | Pointer 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.
| ip_type | iSCSI IP type to convert. |
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.
| ip | Pointer to the iSCSI IP address. |
| hal_ip | Pointer 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.
| ip_type | HAL IP type to convert. |
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.
| src | Pointer to the ASCII IP address. |
| ip | Pointer to a IP address structure. |
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.
| src | Pointer to the ASCII IP address. |
| ip | Pointer to an IP address structure. |
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.
| ipsub | Pointer to the combined iSCSI IP/subnet address. |
| ip | Pointer to the IP address. |
| subnet | Pointer 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.
| ipsub | Pointer to the combined iSCSI IP/subnet address. |
| ip | Pointer to the IP address. |
| subnet | Pointer 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.
| ocs | Pointer to the ocs structure. |
| ipsub | Pointer to the IP address/subnet structure to check. |
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.
| ocs | Pointer to the ocs structure that represents this device. |
| iface | The interface handle to delete |
| vlan_tag | The vlan id to delete |
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.
| ocs | Pointer to the ocs structure that represents this device. |
| arg_out | Pointer to output buffer |
| arg_out_length | Length of output buffer |
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.
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.
| ocs | Pointer to the ocs structure. |
| ipsub | Pointer to the IP/subnet structure. |
| portal | Portal that has the IP address. |
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.
| ocs | Pointer to the ocs structure that represents this device. |
| ipsub | IP Address, subnet and gateway to add. |
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.
| ocs | Pointer to the ocs structure that represents this device. |
| ipsub | IP Address, subnet and gateway to delete. |
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.
| iscsi | Pointer to the iSCSI object. |
| header | DMA memory for the unsolicited header. |
| payload | DMA 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.
| iscsi | Pointer to the iSCSI structure that represents this device. |
| cxn | Pointer to the connection object. |
| hdr | DMA memory information for the header. |
| hdr_len | Length of the header received. |
| data | DMA memory information for the data. |
| data_len | Length of the data received. |
| code | Type of callback received from the chip (i.e. SLI_STATUS_UNSOL_DATA_DIGEST_ERROR). |
| reject_reason | Returns the reject reason. |
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.
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.
| ocs | Pointer to OCS object |
| cxn | Pointer to connection object |
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.
| io | Pointer to IO structure. |
| cb | Callback function. |
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.
| node | Pointer 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.
| cxn | Pointer 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.
| src | Pointer to the input string. |
| dest | Pointer to an array of at least 6 bytes in which the MAC address will be stored. |
Definition at line 737 of file ocs_iscsi.c.