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

Go to the source code of this file.

Detailed Description

Declare driver's domain handler exported interface

Definition in file ocs_domain.h.

Functions

int32_t ocs_domain_init (ocs_t *ocs, ocs_domain_t *domain)
 
ocs_domain_t * ocs_domain_find (ocs_t *ocs, uint64_t fcf_wwn)
 Find the domain, given its FCF_WWN. More...
 
ocs_domain_t * ocs_domain_alloc (ocs_t *ocs, uint64_t fcf_wwn)
 Allocate a domain object. More...
 
void ocs_domain_free (ocs_domain_t *domain)
 Free a domain object. More...
 
void ocs_domain_force_free (ocs_domain_t *domain)
 Free memory resources of a domain object. More...
 
void ocs_register_domain_list_empty_cb (ocs_t *ocs)
 Register a callback when the domain_list goes empty. More...
 
void ocs_unregister_domain_list_empty_cb (ocs_t *ocs)
 Unregister a callback for the domain_list empty cb. More...
 
void ocs_xport_domain_list_empty_cb (ocs_t *ocs, void *arg)
 domain list empty callback More...
 
uint64_t ocs_get_wwn (ocs_hal_t *hal, ocs_hal_property_e prop)
 Return the WWN as a uint64_t. More...
 
static void ocs_domain_lock_init (ocs_domain_t *domain)
 
static int32_t ocs_domain_lock_try (ocs_domain_t *domain)
 
static void ocs_domain_lock (ocs_domain_t *domain)
 
static void ocs_domain_unlock (ocs_domain_t *domain)
 
int32_t ocs_domain_cb (void *arg, ocs_hal_domain_event_e event, void *data)
 Accept domain callback events from the HAL. More...
 
void * __ocs_domain_init (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Domain state machine: Initial state. More...
 
void * __ocs_domain_wait_alloc (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Domain state machine: Wait for the domain allocation to complete. More...
 
void * __ocs_domain_allocated (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Domain state machine: Wait for the domain attach request. More...
 
void * __ocs_domain_wait_attach (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Domain state machine: Wait for the HAL domain attach to complete. More...
 
void * __ocs_domain_ready (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Domain state machine: Ready state. More...
 
void * __ocs_domain_wait_sports_free (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Domain state machine: Wait for nodes to free prior to the domain shutdown. More...
 
void * __ocs_domain_wait_shutdown (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Domain state machine: Complete the domain shutdown. More...
 
void * __ocs_domain_wait_domain_lost (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Domain state machine: Wait for the domain alloc/attach completion after receiving a domain lost. More...
 
void ocs_domain_save_sparms (ocs_domain_t *domain, void *payload)
 Save the port's service parameters. More...
 
void ocs_domain_attach (ocs_domain_t *domain, uint32_t s_id)
 Initiator domain attach. More...
 
int ocs_domain_post_event (ocs_domain_t *domain, ocs_sm_event_t, void *)
 
int ocs_ddump_domain (ocs_textbuf_t *textbuf, ocs_domain_t *domain)
 Generate a domain ddump. More...
 
void __ocs_domain_attach_internal (ocs_domain_t *domain, uint32_t s_id)
 Initiator domain attach. (internal call only) More...
 

Function Details

void __ocs_domain_attach_internal ( ocs_domain_t *  domain,
uint32_t  s_id 
)

Initiator domain attach. (internal call only)

Assumes that the domain SM lock is already locked

Description

The HAL domain attach function is started.

Parameters
domainPointer to the domain object.
s_idFC_ID of which to register this domain.
Returns
None.

Definition at line 1280 of file ocs_domain.c.

int ocs_ddump_domain ( ocs_textbuf_t *  textbuf,
ocs_domain_t *  domain 
)

Generate a domain ddump.

Description

Generates a domain ddump.

Parameters
textbufPointer to the text buffer.
domainPointer to the domain context.
Returns
Returns 0 on success, or a negative value on failure.

Definition at line 1376 of file ocs_domain.c.

ocs_domain_t* ocs_domain_alloc ( ocs_t *  ocs,
uint64_t  fcf_wwn 
)

Allocate a domain object.

Description

A domain object is allocated and initialized. It is associated with the ocs argument.

Parameters
ocsPointer to the OCS device.
fcf_wwnFCF WWN of the domain.
Returns
Returns a pointer to the ocs_domain_t object; or NULL.

Definition at line 218 of file ocs_domain.c.

void ocs_domain_attach ( ocs_domain_t *  domain,
uint32_t  s_id 
)

Initiator domain attach.

Description

The HAL domain attach function is started.

Parameters
domainPointer to the domain object.
s_idFC_ID of which to register this domain.
Returns
None.

Definition at line 1299 of file ocs_domain.c.

int32_t ocs_domain_cb ( void *  arg,
ocs_hal_domain_event_e  event,
void *  data 
)

Accept domain callback events from the HAL.

Description

HAL calls this function with various domain-related events.

Parameters
argApplication-specified argument.
eventDomain event.
dataEvent specific data.
Returns
Returns 0 on success; or a negative error value on failure.

Definition at line 94 of file ocs_domain.c.

ocs_domain_t* ocs_domain_find ( ocs_t *  ocs,
uint64_t  fcf_wwn 
)

Find the domain, given its FCF_WWN.

Description

Search the domain_list to find a matching domain object.

Parameters
ocsPointer to the OCS device.
fcf_wwnFCF WWN to find.
Returns
Returns the pointer to the domain if found; or NULL otherwise.

Definition at line 189 of file ocs_domain.c.

void ocs_domain_force_free ( ocs_domain_t *  domain)

Free memory resources of a domain object.

Description

After the domain object is freed, its child objects are also freed.

Parameters
domainPointer to a domain object.
Returns
None.

Definition at line 341 of file ocs_domain.c.

void ocs_domain_free ( ocs_domain_t *  domain)

Free a domain object.

Description

The domain object is freed.

Parameters
domainDomain object to free.
Returns
None.

Definition at line 279 of file ocs_domain.c.

int32_t ocs_domain_init ( ocs_t *  ocs,
ocs_domain_t *  domain 
)
static void ocs_domain_lock ( ocs_domain_t *  domain)
inlinestatic

Definition at line 63 of file ocs_domain.h.

static void ocs_domain_lock_init ( ocs_domain_t *  domain)
inlinestatic

Definition at line 51 of file ocs_domain.h.

static int32_t ocs_domain_lock_try ( ocs_domain_t *  domain)
inlinestatic

Definition at line 56 of file ocs_domain.h.

int ocs_domain_post_event ( ocs_domain_t *  domain,
ocs_sm_event_t  ,
void *   
)

Definition at line 1307 of file ocs_domain.c.

void ocs_domain_save_sparms ( ocs_domain_t *  domain,
void *  payload 
)

Save the port's service parameters.

Description

Service parameters from the fabric FLOGI are saved in the domain's flogi_service_params array.

Parameters
domainPointer to the domain.
payloadService parameters to save.
Returns
None.

Definition at line 1261 of file ocs_domain.c.

static void ocs_domain_unlock ( ocs_domain_t *  domain)
inlinestatic

Definition at line 70 of file ocs_domain.h.

uint64_t ocs_get_wwn ( ocs_hal_t *  hal,
ocs_hal_property_e  prop 
)

Return the WWN as a uint64_t.

Description

Calls the HAL property function for the WWNN or WWPN, and returns the value as a uint64_t.

Parameters
halPointer to the HAL object.
propHAL property.
Returns
Returns uint64_t request value.

Definition at line 1349 of file ocs_domain.c.

void ocs_register_domain_list_empty_cb ( ocs_t *  ocs)

Register a callback when the domain_list goes empty.

Description

A function callback may be registered when the domain_list goes empty.

Parameters
ocsPointer to a device object.
Returns
None.

Definition at line 389 of file ocs_domain.c.

void ocs_unregister_domain_list_empty_cb ( ocs_t *  ocs)

Unregister a callback for the domain_list empty cb.

Description

A function callback may be unregistered when the domain_list goes empty.

Parameters
ocsPointer to a device object.
Returns
None.

Definition at line 370 of file ocs_domain.c.

void ocs_xport_domain_list_empty_cb ( ocs_t *  ocs,
void *  arg 
)

domain list empty callback

Description
Function is invoked when the device domain list goes empty. By convention arg points to an ocs_sem_t instance, that is incremented.
Parameters
ocsPointer to device object.
argPointer to semaphore instance.
Returns
None.

Definition at line 771 of file ocs_xport.c.