Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_sport.h File Reference

Go to the source code of this file.

Detailed Description

OCS FC SLI port (SPORT) exported declarations

Definition in file ocs_sport.h.

Functions

int32_t ocs_port_cb (void *arg, ocs_hal_port_event_e event, void *data)
 SLI port HAL callback. More...
 
ocs_sport_t * ocs_sport_alloc (ocs_domain_t *domain, uint64_t wwpn, uint64_t wwnn, uint32_t fc_id, uint8_t enable_ini, uint8_t enable_tgt)
 Allocate a SLI port object. More...
 
void ocs_sport_free (ocs_sport_t *sport)
 
void ocs_sport_force_free (ocs_sport_t *sport)
 Free memory resources of a SLI port object. More...
 
void ocs_sport_nodes_shutdown (ocs_t *ocs, ocs_sport_t *sport)
 Shutdown all remote nodes of sport. More...
 
static void ocs_sport_lock_init (ocs_sport_t *sport)
 
static void ocs_sport_lock_free (ocs_sport_t *sport)
 
static int32_t ocs_sport_lock_try (ocs_sport_t *sport)
 
static void ocs_sport_lock (ocs_sport_t *sport)
 
static void ocs_sport_unlock (ocs_sport_t *sport)
 
ocs_sport_t * ocs_sport_find (ocs_domain_t *domain, uint32_t d_id)
 Find a SLI port object, given an FC_ID. More...
 
ocs_sport_t * ocs_sport_find_wwn (ocs_domain_t *domain, uint64_t wwnn, uint64_t wwpn)
 Find a SLI port, given the WWNN and WWPN. More...
 
int32_t ocs_sport_attach (ocs_sport_t *sport, uint32_t fc_id)
 Request a SLI port attach. More...
 
void * __ocs_sport_allocated (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 SLI port state machine: Physical sport allocated. More...
 
void * __ocs_sport_wait_shutdown (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 SLI port state machine: Wait for the node shutdowns to complete. More...
 
void * __ocs_sport_wait_port_free (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 SLI port state machine: Wait for the HAL's port free to complete. More...
 
void * __ocs_sport_vport_init (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 SLI port state machine: Handle initial virtual port events. More...
 
void * __ocs_sport_vport_wait_alloc (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 SLI port state machine: Wait for the HAL SLI port allocation to complete. More...
 
void * __ocs_sport_vport_allocated (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 SLI port state machine: virtual sport allocated. More...
 
void * __ocs_sport_attached (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 SLI port state machine: Attached. More...
 
int32_t ocs_vport_start (ocs_domain_t *domain)
 Start the vports on a domain. More...
 
int32_t ocs_sport_vport_new (ocs_domain_t *domain, uint64_t wwpn, uint64_t wwnn, uint32_t fc_id, uint8_t ini, uint8_t tgt, void *tgt_data, void *ini_data, uint8_t restore_vport)
 Allocate a new virtual SLI port. More...
 
int32_t ocs_sport_vport_del (ocs_t *ocs, ocs_domain_t *domain, uint64_t wwpn, uint64_t wwnn)
 Remove a previously-allocated virtual port. More...
 
void ocs_vport_del_all (ocs_t *ocs)
 Force free all saved vports. More...
 
int8_t ocs_vport_create_spec (ocs_t *ocs, uint64_t wwnn, uint64_t wwpn, uint32_t fc_id, uint32_t enable_ini, uint32_t enable_tgt, void *tgt_data, void *ini_data)
 Create a saved vport entry. More...
 
int ocs_ddump_sport (ocs_textbuf_t *textbuf, ocs_sport_t *sport)
 
int ocs_sparm_cmp (uint8_t *sparms1, uint8_t *sparms2)
 Compare service parameters. More...
 
ocs_node_group_dir_t * ocs_node_group_dir_alloc (ocs_sport_t *sport, uint8_t *sparms)
 Allocate a node group directory entry. More...
 
void ocs_node_group_dir_free (ocs_node_group_dir_t *node_group_dir)
 Free a node group directory entry. More...
 
ocs_node_group_dir_t * ocs_node_group_dir_find (ocs_sport_t *sport, uint8_t *sparms)
 Find a matching node group directory entry. More...
 
ocs_remote_node_group_t * ocs_remote_node_group_alloc (ocs_node_group_dir_t *node_group_dir)
 Allocate a remote node group object. More...
 
void ocs_remote_node_group_free (ocs_remote_node_group_t *node_group)
 Free a remote node group object. More...
 
int ocs_node_group_init (ocs_node_t *node)
 Initialize a node for high login mode. More...
 
void ocs_node_group_free (ocs_node_t *node)
 

Function Details

int ocs_ddump_sport ( ocs_textbuf_t *  textbuf,
ocs_sport_t *  sport 
)
ocs_node_group_dir_t* ocs_node_group_dir_alloc ( ocs_sport_t *  sport,
uint8_t *  sparms 
)

Allocate a node group directory entry.

Description
A node group directory entry is allocated, initialized, and added to the sport's node group directory list.
Parameters
sportPointer to the sport object.
sparmsPointer to the service parameters.
Returns
Returns a pointer to the allocated ocs_node_group_dir_t; or NULL.

Definition at line 1843 of file ocs_sport.c.

ocs_node_group_dir_t* ocs_node_group_dir_find ( ocs_sport_t *  sport,
uint8_t *  sparms 
)

Find a matching node group directory entry.

Description
The sport's node group directory list is searched for a matching set of service parameters. The first matching entry is returned; otherwise NULL is returned.
Parameters
sportPointer to the sport object.
sparmsPointer to the sparams to match.
Returns
Returns a pointer to the first matching entry found; or NULL.

Definition at line 1912 of file ocs_sport.c.

void ocs_node_group_dir_free ( ocs_node_group_dir_t *  node_group_dir)

Free a node group directory entry.

Description
The node group directory entry node_group_dir is removed from the sport's node group directory list and freed.
Parameters
node_group_dirPointer to the node group directory entry.
Returns
None.

Definition at line 1880 of file ocs_sport.c.

void ocs_node_group_free ( ocs_node_t *  node)
int ocs_node_group_init ( ocs_node_t *  node)

Initialize a node for high login mode.

Description
The node is initialized for high login mode. The following steps are performed:
  1. The sports node group directory is searched for a matching set of service parameters.
  2. If a matching set is not found, a node group directory entry is allocated.
  3. If less than the hlm_group_size number of remote node group objects is present in the node group directory, a new remote node group object is allocated and added to the list.
  4. A remote node group object is selected, and the node is attached to the node group.
Parameters
nodePointer to the node.
Returns
Returns 0 on success, or a negative error value on failure.

Definition at line 2042 of file ocs_sport.c.

ocs_remote_node_group_t* ocs_remote_node_group_alloc ( ocs_node_group_dir_t *  node_group_dir)

Allocate a remote node group object.

Description
A remote node group object is allocated, initialized, and placed on the node group list of node_group_dir. The HAL remote node group alloc function is called.
Parameters
node_group_dirPointer to the node group directory.
Returns
Returns a pointer to the allocated remote node group object; or NULL.

Definition at line 1940 of file ocs_sport.c.

void ocs_remote_node_group_free ( ocs_remote_node_group_t *  node_group)

Free a remote node group object.

Description
The remote node group object node_group is removed from its node group directory entry and freed.
Parameters
node_groupPointer to the remote node group object.
Returns
None.

Definition at line 1995 of file ocs_sport.c.

int ocs_sparm_cmp ( uint8_t *  sp1,
uint8_t *  sp2 
)

Compare service parameters.

Description
Returns 0 if the two service parameters are the same, excluding the port/node name elements.
Parameters
sp1Pointer to service parameters 1.
sp2Pointer to service parameters 2.
Returns
Returns 0 if parameters match; otherwise, returns a positive or negative value, depending on the arithmetic magnitude of the first mismatching byte.

Definition at line 1814 of file ocs_sport.c.

void ocs_sport_free ( ocs_sport_t *  sport)

Definition at line 280 of file ocs_sport.c.

static void ocs_sport_lock ( ocs_sport_t *  sport)
inlinestatic

Definition at line 67 of file ocs_sport.h.

static void ocs_sport_lock_free ( ocs_sport_t *  sport)
inlinestatic

Definition at line 55 of file ocs_sport.h.

static void ocs_sport_lock_init ( ocs_sport_t *  sport)
inlinestatic

Definition at line 50 of file ocs_sport.h.

static int32_t ocs_sport_lock_try ( ocs_sport_t *  sport)
inlinestatic

Definition at line 60 of file ocs_sport.h.

void ocs_sport_nodes_shutdown ( ocs_t *  ocs,
ocs_sport_t *  sport 
)

Shutdown all remote nodes of sport.

Definition at line 2124 of file ocs_sport.c.

static void ocs_sport_unlock ( ocs_sport_t *  sport)
inlinestatic

Definition at line 74 of file ocs_sport.h.

int8_t ocs_vport_create_spec ( ocs_t *  ocs,
uint64_t  wwnn,
uint64_t  wwpn,
uint32_t  fc_id,
uint32_t  enable_ini,
uint32_t  enable_tgt,
void *  tgt_data,
void *  ini_data 
)

Create a saved vport entry.

A saved vport entry is added to the vport list, which is restored following a link up. This function is used to allow vports to be created the first time the link comes up without having to go through the ioctl() API.

Parameters
ocsPointer to device context.
wwnnWorld wide node name (may be zero for auto-select).
wwpnWorld wide port name (may be zero for auto-select).
fc_idRequested port ID (used in fabric emulation mode).
enable_iniTRUE if vport is to be an initiator port.
enable_tgtTRUE if vport is to be a target port.
tgt_dataPointer to target specific data.
ini_dataPointer to initiator specific data.
Returns
None.

Definition at line 1716 of file ocs_sport.c.

void ocs_vport_del_all ( ocs_t *  ocs)

Force free all saved vports.

Description
Delete all device vports.
Parameters
ocsPointer to the device object.
Returns
None.

Definition at line 1175 of file ocs_sport.c.