Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Port Functions

Functions

ocs_hal_rtn_e ocs_hal_port_alloc (ocs_hal_t *hal, ocs_sli_port_t *sport, ocs_domain_t *domain, uint8_t *wwpn)
 Allocate a port object. More...
 
ocs_hal_rtn_e ocs_hal_port_attach (ocs_hal_t *hal, ocs_sli_port_t *sport, uint32_t fc_id)
 Attach a physical/virtual SLI port to a domain. More...
 
ocs_hal_rtn_e ocs_hal_port_control (ocs_hal_t *hal, ocs_hal_port_e ctrl, uintptr_t value, ocs_hal_port_control_cb_t cb, void *arg)
 Control a port (initialize, shutdown, or set link configuration). More...
 
ocs_hal_rtn_e ocs_hal_port_free (ocs_hal_t *hal, ocs_sli_port_t *sport)
 Free port resources. More...
 

Function Details

ocs_hal_rtn_e ocs_hal_port_alloc ( ocs_hal_t *  hal,
ocs_sli_port_t *  sport,
ocs_domain_t *  domain,
uint8_t *  wwpn 
)

Allocate a port object.

Description
This function allocates a VPI object for the port and stores it in the indicator field of the port object.
Parameters
halHardware context.
sportSLI port object used to connect to the domain.
domainDomain object associated with this port (may be NULL).
wwpnPort's WWPN in big-endian order, or NULL to use default.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 2882 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_port_attach ( ocs_hal_t *  hal,
ocs_sli_port_t *  sport,
uint32_t  fc_id 
)

Attach a physical/virtual SLI port to a domain.

Description
This function registers a previously-allocated VPI with the device.
Parameters
halHardware context.
sportPointer to the SLI port object.
fc_idFibre Channel ID to associate with this port.
Returns
Returns OCS_HAL_RTN_SUCCESS on success, or an error code on failure.

Definition at line 2966 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_port_control ( ocs_hal_t *  hal,
ocs_hal_port_e  ctrl,
uintptr_t  value,
ocs_hal_port_control_cb_t  cb,
void *  arg 
)

Control a port (initialize, shutdown, or set link configuration).

Description
This function controls a port depending on the ctrl parameter:
  • OCS_HAL_PORT_INIT - Issues the CONFIG_LINK and INIT_LINK commands for the specified port. The HAL generates an OCS_HAL_DOMAIN_FOUND event when the link comes up.
  • OCS_HAL_PORT_SHUTDOWN - Issues the DOWN_LINK command for the specified port. The HAL generates an OCS_HAL_DOMAIN_LOST event when the link is down.
  • OCS_HAL_PORT_SET_LINK_CONFIG - Sets the link configuration.
Parameters
halHardware context.
ctrlSpecifies the operation:
  • OCS_HAL_PORT_INIT
  • OCS_HAL_PORT_SHUTDOWN
  • OCS_HAL_PORT_SET_LINK_CONFIG
valueOperation-specific value.
  • OCS_HAL_PORT_INIT - Selective reset AL_PA
  • OCS_HAL_PORT_SHUTDOWN - N/A
  • OCS_HAL_PORT_SET_LINK_CONFIG - An enum ocs_hal_linkcfg_e value.
cbCallback function to invoke the following operation.
  • OCS_HAL_PORT_INIT/OCS_HAL_PORT_SHUTDOWN - NULL (link events are handled by the OCS_HAL_CB_DOMAIN callbacks).
  • OCS_HAL_PORT_SET_LINK_CONFIG - Invoked after linkcfg mailbox command completes.
argCallback argument invoked after the command completes.
  • OCS_HAL_PORT_INIT/OCS_HAL_PORT_SHUTDOWN - NULL (link events are handled by the OCS_HAL_CB_DOMAIN callbacks).
  • OCS_HAL_PORT_SET_LINK_CONFIG - Invoked after linkcfg mailbox command completes.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 3060 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_port_free ( ocs_hal_t *  hal,
ocs_sli_port_t *  sport 
)

Free port resources.

Description
Issue the UNREG_VPI command to free the assigned VPI context.
Parameters
halHardware context.
sportSLI port object used to connect to the domain.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 3172 of file ocs_hal.c.