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
-
| hal | Hardware context. |
| ctrl | Specifies the operation:
- OCS_HAL_PORT_INIT
- OCS_HAL_PORT_SHUTDOWN
- OCS_HAL_PORT_SET_LINK_CONFIG
|
| value | Operation-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.
|
| cb | Callback 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.
|
| arg | Callback 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.