Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SLI Port (sport) State Machine: States

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...
 
static void _ocs_sport_free (void *arg)
 Free a SLI port object. More...
 
void ocs_sport_force_free (ocs_sport_t *sport)
 Free memory resources of a SLI port object. More...
 
ocs_sport_t * ocs_sport_get_instance (ocs_domain_t *domain, uint32_t index)
 Return a SLI port object, given an instance index. More...
 
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_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...
 
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...
 
int32_t ocs_vport_start (ocs_domain_t *domain)
 Start the vports on a domain. More...
 
static void ocs_vport_link_down (ocs_sport_t *sport)
 Clear the sport reference in the vport specification. 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...
 
int ocs_ddump_sport (ocs_textbuf_t *textbuf, ocs_sli_port_t *sport)
 Generate a SLI port ddump. More...
 

Function Details

void* __ocs_sport_allocated ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

SLI port state machine: Physical sport allocated.

Description
This is the initial state for sport objects.
Parameters
ctxRemote node state machine context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 607 of file ocs_sport.c.

void* __ocs_sport_attached ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

SLI port state machine: Attached.

Description
State entered after the sport attach has completed.
Parameters
ctxRemote node state machine context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 807 of file ocs_sport.c.

void* __ocs_sport_vport_allocated ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

SLI port state machine: virtual sport allocated.

Description
This state is entered after the sport is allocated; it then waits for a fabric node FDISC to complete, which requests a sport attach. The sport attach complete is handled in this state.
Parameters
ctxRemote node state machine context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 762 of file ocs_sport.c.

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.

Description
This state is entered when a virtual port is instantiated,
Parameters
ctxRemote node state machine context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 645 of file ocs_sport.c.

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.

Description
Waits for the HAL sport allocation request to complete.
Parameters
ctxRemote node state machine context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 696 of file ocs_sport.c.

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.

Description
Waits for the HAL's port free to complete.
Parameters
ctxRemote node state machine context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 934 of file ocs_sport.c.

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.

Description
Waits for the ALL_CHILD_NODES_FREE event to be posted from the node shutdown process.
Parameters
ctxRemote node state machine context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 886 of file ocs_sport.c.

static void _ocs_sport_free ( void *  arg)
static

Free a SLI port object.

Description
The sport object is freed.
Parameters
sportPointer to the SLI port object.
Returns
None.

Definition at line 222 of file ocs_sport.c.

int ocs_ddump_sport ( ocs_textbuf_t *  textbuf,
ocs_sli_port_t *  sport 
)

Generate a SLI port ddump.

Description
Generates the SLI port ddump data.
Parameters
textbufPointer to the text buffer.
sportPointer to the SLI-4 port.
Returns
Returns 0 on success, or a negative value on failure.

Definition at line 1203 of file ocs_sport.c.

int32_t ocs_port_cb ( void *  arg,
ocs_hal_port_event_e  event,
void *  data 
)

SLI port HAL callback.

Description
This function is called in response to a HAL sport event. This code resolves the reference to the sport object, and posts the corresponding event.
Parameters
argPointer to the OCS context.
eventHAL sport event.
dataApplication-specific event (pointer to the sport).
Returns
Returns 0 on success, or a negative error value on failure.

Definition at line 88 of file ocs_sport.c.

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.

Description
A sport object is allocated and associated with the domain. Various structure members are initialized.
Parameters
domainPointer to the domain structure.
wwpnWorld wide port name in host endian.
wwnnWorld wide node name in host endian.
fc_idPort ID of sport may be specified, use UINT32_MAX to fabric choose
enable_iniEnables initiator capability on this port using a non-zero value.
enable_tgtEnables target capability on this port using a non-zero value.
Returns
Pointer to an ocs_sport_t object; or NULL.

Definition at line 144 of file ocs_sport.c.

int32_t ocs_sport_attach ( ocs_sport_t *  sport,
uint32_t  fc_id 
)

Request a SLI port attach.

Description
External call to request an attach for a sport, given an FC_ID.
Parameters
sportPointer to the sport context.
fc_idFC_ID of which to attach.
Returns
Returns 0 on success, or a negative error value on failure.

Definition at line 426 of file ocs_sport.c.

ocs_sport_t* ocs_sport_find ( ocs_domain_t *  domain,
uint32_t  d_id 
)

Find a SLI port object, given an FC_ID.

Description
Returns a pointer to the sport object, given an FC_ID.
Parameters
domainPointer to the domain.
d_idFC_ID to find.
Returns
Returns a pointer to the ocs_sport_t; or NULL.

Definition at line 365 of file ocs_sport.c.

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.

Description
Return a pointer to a sport, given the WWNN and WWPN.
Parameters
domainPointer to the domain.
wwnnWorld wide node name.
wwpnWorld wide port name.
Returns
Returns a pointer to a SLI port, if found; or NULL.

Definition at line 397 of file ocs_sport.c.

void ocs_sport_force_free ( ocs_sport_t *  sport)

Free memory resources of a SLI port object.

Description
After the sport object is freed, its child objects are freed.
Parameters
sportPointer to the SLI port object.
Returns
None.

Definition at line 299 of file ocs_sport.c.

ocs_sport_t* ocs_sport_get_instance ( ocs_domain_t *  domain,
uint32_t  index 
)

Return a SLI port object, given an instance index.

Description
A pointer to a sport object is returned, given its instance index.
Parameters
domainPointer to the domain.
indexInstance index value to find.
Returns
Returns a pointer to the ocs_sport_t object; or NULL.

Definition at line 336 of file ocs_sport.c.

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.

Description
A previously-allocated virtual port is removed by posting the shutdown event to the sport with a matching WWN.
Parameters
ocsPointer to the device object.
domainPointer to the domain structure (may be NULL).
wwpnWorld wide port name of the port to delete (host endian).
wwnnWorld wide node name of the port to delete (host endian).
Returns
Returns 0 on success, or a negative error value on failure.

Definition at line 1115 of file ocs_sport.c.

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.

Description
A new sport is created, in response to an external management request.


Note: If the WWPN is zero, the firmware will assign the WWNs.

Parameters
domainPointer to the domain context.
wwpnWorld wide port name.
wwnnWorld wide node name
fc_idRequested port ID (used in fabric emulation mode).
iniTRUE, if port is created as an initiator node.
tgtTRUE, if port is created as a target node.
tgt_dataPointer to target specific data
ini_dataPointer to initiator specific data
restore_vportIf TRUE, then the vport will be re-created automatically on link disruption.
Returns
Returns 0 on success; or a negative error value on failure.

Definition at line 1057 of file ocs_sport.c.

static void ocs_vport_link_down ( ocs_sport_t *  sport)
static

Clear the sport reference in the vport specification.

Description
Clear the sport pointer on the vport specification when the vport is torn down. This allows it to be re-created when the link is re-established.
Parameters
sportPointer to the sport context.

Definition at line 1017 of file ocs_sport.c.

int32_t ocs_vport_start ( ocs_domain_t *  domain)

Start the vports on a domain.

Description
Use the vport specification to find the associated vports and start them.
Parameters
domainPointer to the domain context.
Returns
Returns 0 on success, or a negative error value on failure.

Definition at line 969 of file ocs_sport.c.