#include "ocs.h"#include "ocs_iscsi.h"#include "ocs_iscsi_spec.h"#include "ocs_common.h"#include "ocs_hal.h"#include "ocs_iscsi_api.h"#include "ocs_isns.h"#include "ocs_login.h"#include "ocs_session.h"#include "ocs_cxn.h"#include "sli4_iscsi.h"Go to the source code of this file.
Implements the iSCSI interface functions.
Definition in file ocs_iscsi.c.
Macros | |
| #define | IDLE_TIMER_MS (30 * 1000) /* 30 seconds */ |
Functions | |
| static int32_t | ocs_iscsi_hal_configure (ocs_iscsi_t *iscsi) |
| Configure the HAL based on iSCSI compile parameters. More... | |
| static int32_t | ocs_iscsi_link_event_cb (void *arg, uint8_t isLinkUp) |
| Function to receive the notification of link events. More... | |
| static int32_t | ocs_iscsi_cxn_event_cb (void *arg, ocs_hal_cxn_event_t *cxn_event) |
| Function to receive connection events. More... | |
| static int32_t | ocs_iscsi_unsolicited_event_cb (void *arg, 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 receive unsolicited PDUs. More... | |
| static ocs_config_ctx_t * | ocs_iscsi_ctx_alloc (ocs_iscsi_t *iscsi, ocs_config_ctx_e index) |
| Allocates an iSCSI API context that provides a synchronous API when using a asynchronous mailbox command. More... | |
| static int32_t | ocs_iscsi_ctx_wait (ocs_iscsi_t *iscsi, ocs_config_ctx_e index, int timeout_usec) |
| Waits on an iSCSI API context until the command completes or the timeout occurs. More... | |
| static void | ocs_iscsi_ctx_free (ocs_iscsi_t *iscsi, ocs_config_ctx_e index) |
| Frees an iSCSI API context that provides a synchronous API when using a asynchronous mailbox command. More... | |
| static void | ocs_iscsi_ctx_post (ocs_config_ctx_t *ctx, int32_t status, uint32_t ext_status) |
| Updates the status fields and post to the semaphore if it is still in use. More... | |
| static void | ocs_iscsi_ctx_teardown (ocs_iscsi_t *iscsi) |
| Completes any active iSCSI API context when the device is being shut down. 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... | |
| static void | ocs_iscsi_convert_to_hal_ipsub (ocs_ip_address_subnet_t *ip, ocs_hal_ip_address_subnet_t *hal_ip) |
| Convert an iSCSI IP address to the HAL IP address. More... | |
| static void | ocs_iscsi_convert_to_ipsub (ocs_ip_address_subnet_t *ip, ocs_hal_ip_address_subnet_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... | |
| 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... | |
| 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... | |
| static int32_t | ocs_iscsi_cxn_request_logout (ocs_cxn_t *cxn) |
| Attempts to send an asynchronous message to request the initiator to logout. More... | |
| static void | ocs_iscsi_idle_timeout (void *arg) |
| This function is called to check for idle connections. More... | |
| static void | ocs_iscsi_ctx_general_cb (void *ul_arg, int32_t status, uint32_t ext_status, void *params) |
| This function is the callback a general API context command. More... | |
| static void | ocs_iscsi_isns_discover_cb (void *ul_arg, int32_t status, uint32_t ext_status, void *params) |
| This function is the callback for the iSNS server IP addresses. More... | |
| static void | ocs_iscsi_isns_send_cb (void *ul_arg, int32_t status, uint32_t ext_status, void *params) |
| This function is the callback for the iSNS send. More... | |
| int32_t | ocs_iscsi_isns_esi_listen_start (ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port) |
| Starts an iSNS ESI TCP listen socket. More... | |
| int32_t | ocs_iscsi_isns_esi_listen_stop (ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port) |
| Stops an iSNS ESI TCP listen socket. More... | |
| int32_t | ocs_iscsi_isns_discover (ocs_t *ocs, ocs_hal_portal_t portal, uint32_t max_entries, uint32_t *num_ips, ocs_ip_address_t *ip) |
| Discovers the iSNS through the DHCP service. More... | |
| int32_t | ocs_iscsi_isns_send (ocs_t *ocs, ocs_ip_address_t *isns_server, uint32_t tcp_port, void *buffer, uint32_t *pkt_len, uint32_t buff_len) |
| Sends an iSNS packet to a server to test the interface. More... | |
| static void | ocs_iscsi_query_ip_cb (void *ul_arg, int32_t status, uint32_t ext_status, void *params) |
| This function is the callback for querying IP addresses. More... | |
| int32_t | ocs_iscsi_mac_set (ocs_t *ocs, uint8_t *mac_address) |
| Sets the MAC address of the iSCSI device. More... | |
| uint8_t * | ocs_iscsi_mac_get (ocs_t *ocs) |
| Gets the MAC address of the iSCSI device. More... | |
| static void | ocs_iscsi_print_module_params (ocs_iscsi_t *iscsi) |
| This function prints the module parameters to the log for debugging purposes. More... | |
| int32_t | ocs_iscsi_interrupts_required (ocs_os_handle_t os, ocs_hal_t *hal) |
| Returns the number of interrupts needed for this adapter. More... | |
| int32_t | ocs_iscsi_initialize (ocs_os_handle_t os, ocs_iscsi_t *iscsi, ocs_hal_t *hal, uint32_t device_instance) |
| Initialize the iSCSI device by setting up the chip. More... | |
| void | ocs_iscsi_uninitialize (ocs_iscsi_t *iscsi) |
| Indicate that HAL is not initialized. More... | |
| int32_t | ocs_iscsi_teardown (ocs_iscsi_t *iscsi) |
| Shut down the device. More... | |
| int32_t | ocs_iscsi_mtu_set (ocs_t *ocs, uint8_t is_jumbo) |
| Sets the TCP MTU size of the iSCSI device. More... | |
| void | ocs_iscsi_cluster_tgts_free (ocs_iscsi_t *iscsi) |
| iscsi cluster targets free More... | |
| static void | ocs_iscsi_ctx_route_table_read_cb (void *ul_arg, int32_t status, uint32_t ext_status, void *params) |
| This function is the callback a add route table command. 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_add_entry (ocs_t *ocs, ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *gateway) |
| Adds an entry to a routing table. More... | |
| int32_t | ocs_iscsi_route_table_read (ocs_t *ocs, ocs_route_table_t *route_table) |
| int32_t | ocs_iscsi_ip_address_add (ocs_t *ocs, ocs_hal_portal_t portal, ocs_ip_address_subnet_t *ipsub) |
| Adds the IP address to the specified interface. More... | |
| int32_t | ocs_iscsi_ip_address_remove (ocs_t *ocs, ocs_hal_portal_t portal, ocs_ip_address_subnet_t *ipsub) |
| Remove the IP address to the specified interface. More... | |
| int32_t | ocs_iscsi_ip_address_query (ocs_t *ocs, ocs_hal_portal_t portal, ocs_ip_type_e ip_type, uint32_t max_entries, uint32_t *num_ips, ocs_ip_address_subnet_t *ipsub) |
| Queries the IP addresses on the default interface. 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... | |
| int32_t | ocs_iscsi_gateway_set (ocs_t *ocs, ocs_ip_address_t *gateway) |
| Sets the IP gateway address. More... | |
| ocs_hal_portal_t | ocs_iscsi_portal_get_default (ocs_t *ocs) |
| Retrieves the default portal. More... | |
| int32_t | ocs_iscsi_portal_find_ip_address (ocs_t *ocs, ocs_hal_portal_t iface_handle, ocs_ip_address_t *ip, ocs_ip_address_t *subnet, uint16_t *tcp_port, int32_t *listening) |
| Find IP address of interface handle If IP address is found for given interface handle, copy to ip and subnet params. More... | |
| int32_t | ocs_iscsi_portal_remove_ip_addresses (ocs_t *ocs, ocs_hal_portal_t iface_handle) |
| Check and remove IP addresses of the corresponding interface. More... | |
| int32_t | ocs_iscsi_find_portal_from_vlan (ocs_t *ocs, uint32_t vlan_id, ocs_hal_portal_t *iface_handle) |
| Helper function to find respective interface handle of VLAN id. More... | |
| int32_t | ocs_iscsi_portal_is_vlan_exists (ocs_t *ocs, uint32_t vlan_id) |
| Check VLAN for duplicate. More... | |
| int32_t | ocs_iscsi_portal_add_vlan (ocs_t *ocs, ocs_hal_portal_t iface, uint32_t vlan_id) |
| Add VLAN and iface handle to portal_list. 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_portal_read_vlan_ids (ocs_t *ocs, void *arg_out, uint32_t arg_out_length) |
| Read VLAN IDs to provided buffer. More... | |
| static void | ocs_iscsi_portal_create_cb (void *ul_arg, int32_t status, uint32_t ext_status, void *params) |
| This function is the callback for creating an interface/portal. More... | |
| int32_t | ocs_iscsi_portal_create (ocs_t *ocs, unsigned int vlan_id, ocs_hal_portal_t *portal) |
| Creates a portal for a VLAN. More... | |
| int32_t | ocs_iscsi_portal_delete (ocs_t *ocs, ocs_hal_portal_t portal) |
| Removes a previously-created portal. More... | |
| int32_t | ocs_iscsi_listen_start (ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port) |
| Starts a TCP listen socket. More... | |
| int32_t | ocs_iscsi_listen_stop (ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port) |
| Stops a TCP listen socket. More... | |
| int32_t | ocs_iscsi_register_link_state_callback (ocs_t *ocs, ocs_link_state_cb_t cb) |
| Register to receive link state change notifications. More... | |
| void | ocs_iscsi_unregister_link_state_callback (ocs_t *ocs, ocs_link_state_cb_t cb) |
| Unregister a link state change callback. More... | |
| static int32_t | ocs_iscsi_cxn_event_invalid (ocs_iscsi_t *iscsi, ocs_cxn_t *cxn, uint32_t code) |
| Function to process connection invalidation notifications. More... | |
| static int32_t | ocs_iscsi_cxn_event_data_digest (ocs_iscsi_t *iscsi, ocs_hal_tgt_data_digest_t *tgt_digest) |
| Function to process a data digest error. More... | |
| static uint32_t | ocs_iscsi_decode_lun (uint8_t *lu) |
| Decode a LU Number according to SAM. More... | |
| static ocs_pdu_process_rtn_e | ocs_iscsi_recv_cmd (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) |
| Function to receive unsolicited command PDUs. More... | |
| static int32_t | ocs_iscsi_recv_tm_cb (ocs_io_t *io, ocs_scsi_io_status_e status, uint32_t flags, void *arg) |
| Callback function used to free an IO for a rejected task management function. More... | |
| static ocs_pdu_process_rtn_e | ocs_iscsi_recv_tm (ocs_iscsi_t *iscsi, ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len) |
| Function to receive unsolicited task management PDUs. More... | |
| static int32_t | ocs_iscsi_recv_tm_rsp (ocs_iscsi_t *iscsi, ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len) |
| Function to receive unsolicited task management response PDUs. 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... | |
| static int32_t | ocs_iscsi_unsolicited_event_ini (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) |
| Function to receive unsolicited PDUs for an initiator. 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... | |
| 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. More... | |
| void | ocs_iscsi_cxn_req_invalidate (ocs_iscsi_t *iscsi) |
| #define IDLE_TIMER_MS (30 * 1000) /* 30 seconds */ |
Definition at line 147 of file ocs_iscsi.c.
| 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.
|
static |
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 385 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.
|
static |
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 399 of file ocs_iscsi.c.
|
static |
Allocates an iSCSI API context that provides a synchronous API when using a asynchronous mailbox command.
| iscsi | Pointer to the iSCSI object. |
| index | Index of the context to allocate. |
Definition at line 174 of file ocs_iscsi.c.
|
static |
Frees an iSCSI API context that provides a synchronous API when using a asynchronous mailbox command.
| iscsi | Pointer to the iSCSI object. |
| index | Index of the context to free. |
Definition at line 238 of file ocs_iscsi.c.
|
static |
This function is the callback a general API context command.
| ul_arg | Pointer to the iscsi object. |
| status | Status of the command. |
| ext_status | Extended status of the command. |
| params | Points to the command parameters. |
Definition at line 927 of file ocs_iscsi.c.
|
static |
Updates the status fields and post to the semaphore if it is still in use.
| ctx | Pointer to the command context. |
| status | Status of the command. |
| ext_status | Extended status of the command. |
Definition at line 251 of file ocs_iscsi.c.
|
static |
This function is the callback a add route table command.
| ul_arg | Pointer to the iscsi object. |
| status | Status of the command. |
| ext_status | Extended status of the command. |
| params | Points to the command parameters. |
Definition at line 2233 of file ocs_iscsi.c.
|
static |
Completes any active iSCSI API context when the device is being shut down.
| iscsi | Pointer to the iSCSI object. |
Definition at line 273 of file ocs_iscsi.c.
|
static |
Waits on an iSCSI API context until the command completes or the timeout occurs.
| iscsi | Pointer to the iSCSI object. |
| index | Index of the context to free. |
| timeout_usec | Timeout in microseconds. |
Definition at line 199 of file ocs_iscsi.c.
|
static |
Function to receive connection events.
| arg | Pointer to the iSCSI structure that represents this device. |
| cxn_event | Identifies the event that was received. |
Definition at line 3601 of file ocs_iscsi.c.
|
static |
Function to process a data digest error.
| iscsi | Pointer to the iSCSI structure that represents this device. |
| tgt_digest | Pointer to the data digest error fields. |
Definition at line 3555 of file ocs_iscsi.c.
|
static |
Function to process connection invalidation notifications.
| iscsi | Pointer to the iSCSI structure that represents this device. |
| cxn | Pointer to the connection object. |
| code | Error code. |
Definition at line 3490 of file ocs_iscsi.c.
| void ocs_iscsi_cxn_req_invalidate | ( | ocs_iscsi_t * | iscsi | ) |
Definition at line 4456 of file ocs_iscsi.c.
|
static |
Attempts to send an asynchronous message to request the initiator to logout.
| cxn | Pointer to the connection object. |
Definition at line 782 of file ocs_iscsi.c.
|
static |
Decode a LU Number according to SAM.
| lu | Pointer to LU data |
Definition at line 3644 of file ocs_iscsi.c.
| int32_t ocs_iscsi_find_portal_from_vlan | ( | ocs_t * | ocs, |
| uint32_t | vlan_id, | ||
| ocs_hal_portal_t * | iface_handle | ||
| ) |
Helper function to find respective interface handle of VLAN id.
| ocs | Pointer to the ocs structure that represents this device. |
| vlan_tag | The vlan id |
| iface_handle |
Definition at line 2921 of file ocs_iscsi.c.
| int32_t ocs_iscsi_gateway_set | ( | ocs_t * | ocs, |
| ocs_ip_address_t * | gateway | ||
| ) |
Sets the IP gateway address.
| ocs | Pointer to the ocs structure that represents this device. |
| gateway | IP address of the gateway. |
Definition at line 2771 of file ocs_iscsi.c.
|
static |
Configure the HAL based on iSCSI compile parameters.
| iscsi | Pointer to the iSCSI structure that represents this device. |
Definition at line 2015 of file ocs_iscsi.c.
|
static |
This function is called to check for idle connections.
| arg | Pointer to the iscsi object. |
Definition at line 818 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.
| int32_t ocs_iscsi_ip_address_add | ( | ocs_t * | ocs, |
| ocs_hal_portal_t | portal, | ||
| ocs_ip_address_subnet_t * | ipsub | ||
| ) |
Adds the IP address to the specified interface.
| ocs | Pointer to the ocs structure that represents this device. |
| portal | Portal to use. |
| ipsub | IP Address and subnet to add. |
Definition at line 2417 of file ocs_iscsi.c.
| int32_t ocs_iscsi_ip_address_query | ( | ocs_t * | ocs, |
| ocs_hal_portal_t | portal, | ||
| ocs_ip_type_e | ip_type, | ||
| uint32_t | max_entries, | ||
| uint32_t * | num_ips, | ||
| ocs_ip_address_subnet_t * | ipsub | ||
| ) |
Queries the IP addresses on the default interface.
| ocs | Pointer to the ocs structure that represents this device. |
| portal | Portal to use. |
| ip_type | Enumerated type indicating the type of IP address (IPV4, IPV6, etc). |
| max_entries | Maximum number of entries to be returned. |
| num_ips | Actual number of entries returned. |
| ipsub | Used to return queried IP addresses. |
Definition at line 2567 of file ocs_iscsi.c.
| int32_t ocs_iscsi_ip_address_remove | ( | ocs_t * | ocs, |
| ocs_hal_portal_t | portal, | ||
| ocs_ip_address_subnet_t * | ipsub | ||
| ) |
Remove the IP address to the specified interface.
| ocs | Pointer to the ocs structure that represents this device. |
| portal | Portal to use. |
| ipsub | IP Address and subnet to remove. |
Definition at line 2510 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_isns_discover | ( | ocs_t * | ocs, |
| ocs_hal_portal_t | portal, | ||
| uint32_t | max_entries, | ||
| uint32_t * | num_ips, | ||
| ocs_ip_address_t * | ip | ||
| ) |
Discovers the iSNS through the DHCP service.
| ocs | Pointer to the ocs structure that represents this device. |
| portal | Portal to use. |
| max_entries | Maximum number of entries to be returned. |
| num_ips | Actual number of entries returned. |
| ip | IP address to listen on. |
Definition at line 1138 of file ocs_iscsi.c.
|
static |
This function is the callback for the iSNS server IP addresses.
| ul_arg | Pointer to the iscsi object. |
| status | Status of the command. |
| ext_status | Extended status of the command. |
| params | Pointer to ocs_hal_ip_address_subnet_t. |
Definition at line 946 of file ocs_iscsi.c.
| int32_t ocs_iscsi_isns_esi_listen_start | ( | ocs_t * | ocs, |
| ocs_ip_address_t * | ip, | ||
| uint16_t | tcp_port | ||
| ) |
Starts an iSNS ESI TCP listen socket.
| ocs | Pointer to the ocs structure that represents this device. |
| ip | IP address to listen on. |
| tcp_port | TCP port number to listen on. |
Definition at line 1037 of file ocs_iscsi.c.
| int32_t ocs_iscsi_isns_esi_listen_stop | ( | ocs_t * | ocs, |
| ocs_ip_address_t * | ip, | ||
| uint16_t | tcp_port | ||
| ) |
Stops an iSNS ESI TCP listen socket.
| ocs | Pointer to the ocs structure that represents this device. |
| ip | IP address to listen on. |
| tcp_port | TCP port number to listen on. |
Definition at line 1087 of file ocs_iscsi.c.
| int32_t ocs_iscsi_isns_send | ( | ocs_t * | ocs, |
| ocs_ip_address_t * | isns_server, | ||
| uint32_t | tcp_port, | ||
| void * | buffer, | ||
| uint32_t * | pkt_len, | ||
| uint32_t | buff_len | ||
| ) |
Sends an iSNS packet to a server to test the interface.
| ocs | Pointer to the ocs structure that represents this device. |
| isns_server | IP address of the iSNS server. |
| tcp_port | TCP port number. |
| buffer | Pointer to the virtual address of the iSNS buffer. This buffer is used for both the request and response. |
| pkt_len | Length of the packet and returns the length of the response. |
| buff_len | Length of the buffer. Used to truncate the response if required. |
Definition at line 1196 of file ocs_iscsi.c.
|
static |
This function is the callback for the iSNS send.
| ul_arg | Pointer to the iscsi object. |
| status | Status of the command. |
| ext_status | Extended status of the command. |
| params | Pointer to ocs_hal_ip_address_subnet_t. |
Definition at line 986 of file ocs_iscsi.c.
|
static |
Function to receive the notification of link events.
| arg | Pointer to the iSCSI structure that represents this device. |
| isLinkUp | Non-zero means the link is up. |
Definition at line 3385 of file ocs_iscsi.c.
| int32_t ocs_iscsi_listen_start | ( | ocs_t * | ocs, |
| ocs_ip_address_t * | ip, | ||
| uint16_t | tcp_port | ||
| ) |
Starts a TCP listen socket.
| ocs | Pointer to the ocs structure that represents this device. |
| ip | IP address to listen on. |
| tcp_port | TCP port number to listen on. |
Definition at line 3227 of file ocs_iscsi.c.
| int32_t ocs_iscsi_listen_stop | ( | ocs_t * | ocs, |
| ocs_ip_address_t * | ip, | ||
| uint16_t | tcp_port | ||
| ) |
Stops a TCP listen socket.
| ocs | Pointer to the ocs structure that represents this device. |
| ip | IP address to listen on. |
| tcp_port | TCP port number to listen on. |
Definition at line 3275 of file ocs_iscsi.c.
| uint8_t* ocs_iscsi_mac_get | ( | ocs_t * | ocs | ) |
Gets the MAC address of the iSCSI device.
| ocs | Pointer to the ocs structure that represents this device. |
Definition at line 1323 of file ocs_iscsi.c.
| int32_t ocs_iscsi_mac_set | ( | ocs_t * | ocs, |
| uint8_t * | mac_address | ||
| ) |
Sets the MAC address of the iSCSI device.
| ocs | Pointer to the ocs structure that represents this device. |
| mac_address | Pointer to the MAC address value. |
Definition at line 1281 of file ocs_iscsi.c.
| int32_t ocs_iscsi_mtu_set | ( | ocs_t * | ocs, |
| uint8_t | is_jumbo | ||
| ) |
Sets the TCP MTU size of the iSCSI device.
| ocs | Pointer to the ocs structure that represents this device |
| is_jumbo | If TRUE, then the portal will be set for jumbo, otherwise set for the standard 1500 bytes. |
Definition at line 2173 of file ocs_iscsi.c.
| int32_t ocs_iscsi_portal_add_vlan | ( | ocs_t * | ocs, |
| ocs_hal_portal_t | iface, | ||
| uint32_t | vlan_id | ||
| ) |
Add VLAN and iface handle to portal_list.
| ocs | Pointer to the ocs structure that represents this device. |
| iface | The interface handle to add |
| vlan_tag | The vlan id to add |
Definition at line 2976 of file ocs_iscsi.c.
| int32_t ocs_iscsi_portal_create | ( | ocs_t * | ocs, |
| unsigned int | vlan_id, | ||
| ocs_hal_portal_t * | portal | ||
| ) |
Creates a portal for a VLAN.
| ocs | Pointer to the ocs structure that represents this device. |
| vlan_tag | The vlan to create. |
| portal | Portal to create. |
Definition at line 3125 of file ocs_iscsi.c.
|
static |
This function is the callback for creating an interface/portal.
| ul_arg | Pointer to the iscsi object. |
| status | Status of the command. |
| ext_status | Extended status of the command. |
| params | NULL for this function. |
Definition at line 3103 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_delete | ( | ocs_t * | ocs, |
| ocs_hal_portal_t | portal | ||
| ) |
Removes a previously-created portal.
| ocs | Pointer to the ocs structure that represents this device. |
| portal | Portal to remove. |
Definition at line 3183 of file ocs_iscsi.c.
| int32_t ocs_iscsi_portal_find_ip_address | ( | ocs_t * | ocs, |
| ocs_hal_portal_t | iface_handle, | ||
| ocs_ip_address_t * | ip, | ||
| ocs_ip_address_t * | subnet, | ||
| uint16_t * | tcp_port, | ||
| int32_t * | listening | ||
| ) |
Find IP address of interface handle If IP address is found for given interface handle, copy to ip and subnet params.
Definition at line 2830 of file ocs_iscsi.c.
| ocs_hal_portal_t ocs_iscsi_portal_get_default | ( | ocs_t * | ocs | ) |
Retrieves the default portal.
| ocs | Pointer to the ocs structure that represents this device. |
Definition at line 2816 of file ocs_iscsi.c.
| int32_t ocs_iscsi_portal_is_vlan_exists | ( | ocs_t * | ocs, |
| uint32_t | vlan_id | ||
| ) |
Check VLAN for duplicate.
| ocs | Pointer to the ocs structure that represents this device. |
| vlan_tag | The vlan to check for duplicates. |
Definition at line 2949 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_portal_remove_ip_addresses | ( | ocs_t * | ocs, |
| ocs_hal_portal_t | iface_handle | ||
| ) |
Check and remove IP addresses of the corresponding interface.
| ocs | Pointer to the OCS context |
| iface_handle | Interface handle to check for IP addresses |
Definition at line 2862 of file ocs_iscsi.c.
|
static |
This function prints the module parameters to the log for debugging purposes.
| iscsi | Pointer to the iSCSI structure that represents this device |
Definition at line 1334 of file ocs_iscsi.c.
|
static |
This function is the callback for querying IP addresses.
| ul_arg | Pointer to the iSCSI object. |
| status | Status of the command. |
| ext_status | Extended status of the command. |
| params | Pointer to ocs_hal_ip_address_subnet_t. |
Definition at line 1253 of file ocs_iscsi.c.
|
static |
Function to receive unsolicited command PDUs.
| 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. |
Definition at line 3705 of file ocs_iscsi.c.
|
static |
Function to receive unsolicited task management PDUs.
| 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. |
Definition at line 3838 of file ocs_iscsi.c.
|
static |
Callback function used to free an IO for a rejected task management function.
| io | Pointer to the OS io object. |
| status | Status of the command. |
| flags | Flags. |
| arg | Points to the io object. |
Definition at line 3818 of file ocs_iscsi.c.
|
static |
Function to receive unsolicited task management response PDUs.
| 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. |
Definition at line 3956 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.
|
static |
Function to receive unsolicited PDUs.
| arg | 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). |
Definition at line 4210 of file ocs_iscsi.c.
|
static |
Function to receive unsolicited PDUs for an initiator.
| 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). |
Definition at line 4116 of file ocs_iscsi.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.