Functions | |
| ocs_hal_rtn_e | ocs_hal_command (ocs_hal_t *hal, uint8_t *cmd, uint32_t opts, void *cb, void *arg) |
| Issue a SLI command. More... | |
| static ocs_hal_io_t * | _ocs_hal_io_alloc (ocs_hal_t *hal) |
| Lockless allocate a HAL IO object. More... | |
| ocs_hal_io_t * | ocs_hal_io_alloc (ocs_hal_t *hal) |
| Allocate a HAL IO object. More... | |
| ocs_hal_io_t * | ocs_hal_io_activate_port_owned (ocs_hal_t *hal, ocs_hal_io_t *io) |
| Allocate/Activate a port owned HAL IO object. More... | |
| static void | ocs_hal_io_free_move_correct_list (ocs_hal_t *hal, ocs_hal_io_t *io) |
| When an IO is freed, depending on the exchange busy flag, and other workarounds, move it to the correct list. More... | |
| static void | ocs_hal_io_free_common (ocs_hal_t *hal, ocs_hal_io_t *io) |
| Free a HAL IO object. Perform cleanup common to port and host-owned IOs. More... | |
| static void | ocs_hal_io_free_port_owned (void *arg) |
| Free a HAL IO object associated with a port-owned XRI. More... | |
| static void | ocs_hal_io_free_internal (void *arg) |
| Free a previously-allocated HAL IO object. Called when IO refcount goes to zero (host-owned IOs only). More... | |
| int32_t | ocs_hal_io_free (ocs_hal_t *hal, ocs_hal_io_t *io) |
| Free a previously-allocated HAL IO object. More... | |
| uint8_t | ocs_hal_io_inuse (ocs_hal_t *hal, ocs_hal_io_t *io) |
| Check if given HAL IO is in-use. More... | |
| ocs_hal_rtn_e | ocs_hal_srrs_send (ocs_hal_t *hal, ocs_hal_io_type_e type, ocs_hal_io_t *io, ocs_dma_t *send, uint32_t len, ocs_dma_t *receive, ocs_remote_node_t *rnode, ocs_hal_io_param_t *iparam, ocs_hal_srrs_cb_t cb, void *arg) |
| Send a Single Request/Response Sequence (SRRS). More... | |
| ocs_hal_rtn_e | ocs_hal_io_send (ocs_hal_t *hal, ocs_hal_io_type_e type, ocs_hal_io_t *io, uint32_t len, ocs_hal_io_param_t *iparam, ocs_remote_node_t *rnode, void *cb, void *arg) |
| Send a read, write, or response IO. More... | |
| ocs_hal_rtn_e | ocs_hal_io_init_sges (ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_io_type_e type) |
| Initialize the scatter gather list entries of an IO. More... | |
| ocs_hal_rtn_e | ocs_hal_io_add_seed_sge (ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_dif_info_t *dif_info) |
| Add a T10 PI seed scatter gather list entry. More... | |
| ocs_hal_rtn_e | ocs_hal_io_add_sge (ocs_hal_t *hal, ocs_hal_io_t *io, uintptr_t addr, uint32_t length) |
| Add a scatter gather list entry to an IO. More... | |
| ocs_hal_rtn_e | ocs_hal_io_add_dif_sge (ocs_hal_t *hal, ocs_hal_io_t *io, uintptr_t addr) |
| Add a T10 DIF scatter gather list entry to an IO. More... | |
| ocs_hal_rtn_e | ocs_hal_io_abort (ocs_hal_t *hal, ocs_hal_io_t *io_to_abort, uint32_t send_abts, void *cb, void *arg) |
| Abort a previously-started IO. More... | |
| int32_t | ocs_hal_io_get_xid (ocs_hal_t *hal, ocs_hal_io_t *io) |
| Return the OX_ID/RX_ID of the IO. More... | |
| ocs_hal_rtn_e | ocs_hal_get_sfp (ocs_hal_t *hal, uint16_t page, ocs_hal_sfp_cb_t cb, void *arg) |
| Function to retrieve the SFP information. More... | |
| ocs_hal_rtn_e | ocs_hal_get_port_protocol (ocs_hal_t *hal, uint32_t pci_func, ocs_get_port_protocol_cb_t cb, void *ul_arg) |
| Get the current port protocol. More... | |
| ocs_hal_rtn_e | ocs_hal_set_port_protocol (ocs_hal_t *hal, ocs_hal_port_protocol_e new_protocol, uint32_t pci_func, ocs_set_port_protocol_cb_t cb, void *ul_arg) |
| Set the port protocol. More... | |
| ocs_hal_rtn_e | ocs_hal_get_profile_list (ocs_hal_t *hal, ocs_get_profile_list_cb_t cb, void *ul_arg) |
| Get a list of available profiles. More... | |
| int32_t | ocs_hal_get_active_profile (ocs_hal_t *hal, ocs_get_active_profile_cb_t cb, void *ul_arg) |
| Get the currently active profile. More... | |
| int32_t | ocs_hal_get_nvparms (ocs_hal_t *hal, ocs_get_nvparms_cb_t cb, void *ul_arg) |
| Read non-volatile parms. More... | |
| int32_t | ocs_hal_set_nvparms (ocs_hal_t *hal, ocs_set_nvparms_cb_t cb, uint8_t *wwpn, uint8_t *wwnn, uint8_t hard_alpa, uint32_t preferred_d_id, void *ul_arg) |
| Write non-volatile parms. More... | |
| int32_t | ocs_hal_set_active_profile (ocs_hal_t *hal, ocs_set_active_profile_cb_t cb, uint32_t profile_id, void *ul_arg) |
| Set the currently active profile. More... | |
|
inlinestatic |
| ocs_hal_rtn_e ocs_hal_command | ( | ocs_hal_t * | hal, |
| uint8_t * | cmd, | ||
| uint32_t | opts, | ||
| void * | cb, | ||
| void * | arg | ||
| ) |
Issue a SLI command.
| hal | Hardware context. |
| cmd | Buffer containing a formatted command and results. |
| opts | Command options:
|
| cb | Function callback used for asynchronous mode. May be NULL. Prototype is (*cb)(void *arg, uint8_t *cmd). Note: If the callback function pointer is NULL, the results of the command are silently discarded, allowing this pointer to exist solely on the stack. |
| arg | Argument passed to an asynchronous callback. |
| int32_t ocs_hal_get_active_profile | ( | ocs_hal_t * | hal, |
| ocs_get_active_profile_cb_t | cb, | ||
| void * | ul_arg | ||
| ) |
Get the currently active profile.
| hal | Hardware context. |
| cb | Callback function to be called when the command completes. |
| ul_arg | An argument that is passed to the callback function. |
| int32_t ocs_hal_get_nvparms | ( | ocs_hal_t * | hal, |
| ocs_get_nvparms_cb_t | cb, | ||
| void * | ul_arg | ||
| ) |
Read non-volatile parms.
| hal | Hardware context. |
| cb | Callback function to be called when the command completes. |
| ul_arg | An argument that is passed to the callback function. |
| ocs_hal_rtn_e ocs_hal_get_port_protocol | ( | ocs_hal_t * | hal, |
| uint32_t | pci_func, | ||
| ocs_get_port_protocol_cb_t | cb, | ||
| void * | ul_arg | ||
| ) |
Get the current port protocol.
| hal | Hardware context. |
| pci_func | PCI function to query for current protocol. |
| cb | Callback function to be called when the command completes. |
| ul_arg | An argument that is passed to the callback function. |
| ocs_hal_rtn_e ocs_hal_get_profile_list | ( | ocs_hal_t * | hal, |
| ocs_get_profile_list_cb_t | cb, | ||
| void * | ul_arg | ||
| ) |
Get a list of available profiles.
| hal | Hardware context. |
| cb | Callback function to be called when the command completes. |
| ul_arg | An argument that is passed to the callback function. |
| ocs_hal_rtn_e ocs_hal_get_sfp | ( | ocs_hal_t * | hal, |
| uint16_t | page, | ||
| ocs_hal_sfp_cb_t | cb, | ||
| void * | arg | ||
| ) |
Function to retrieve the SFP information.
| hal | Hardware context. |
| page | The page of SFP data to retrieve (0xa0 or 0xa2). |
| cb | Function call upon completion of sending the data (may be NULL). |
| arg | Argument to pass to IO completion function. |
| ocs_hal_rtn_e ocs_hal_io_abort | ( | ocs_hal_t * | hal, |
| ocs_hal_io_t * | io_to_abort, | ||
| uint32_t | send_abts, | ||
| void * | cb, | ||
| void * | arg | ||
| ) |
Abort a previously-started IO.
| hal | Hardware context. |
| io_to_abort | The IO to abort. |
| send_abts | Boolean to have the hardware automatically generate an ABTS. |
| cb | Function call upon completion of the abort (may be NULL). |
| arg | Argument to pass to abort completion function. |
| ocs_hal_io_t* ocs_hal_io_activate_port_owned | ( | ocs_hal_t * | hal, |
| ocs_hal_io_t * | io | ||
| ) |
Allocate/Activate a port owned HAL IO object.
| hal | Hardware context. |
| io | Pointer HAL IO to activate/allocate. |
| ocs_hal_rtn_e ocs_hal_io_add_dif_sge | ( | ocs_hal_t * | hal, |
| ocs_hal_io_t * | io, | ||
| uintptr_t | addr | ||
| ) |
| ocs_hal_rtn_e ocs_hal_io_add_seed_sge | ( | ocs_hal_t * | hal, |
| ocs_hal_io_t * | io, | ||
| ocs_hal_dif_info_t * | dif_info | ||
| ) |
| ocs_hal_rtn_e ocs_hal_io_add_sge | ( | ocs_hal_t * | hal, |
| ocs_hal_io_t * | io, | ||
| uintptr_t | addr, | ||
| uint32_t | length | ||
| ) |
| ocs_hal_io_t* ocs_hal_io_alloc | ( | ocs_hal_t * | hal | ) |
| int32_t ocs_hal_io_free | ( | ocs_hal_t * | hal, |
| ocs_hal_io_t * | io | ||
| ) |
Free a previously-allocated HAL IO object.
| hal | Hardware context. |
| io | Pointer to the HAL IO object. |
|
inlinestatic |
|
static |
|
static |
When an IO is freed, depending on the exchange busy flag, and other workarounds, move it to the correct list.
| hal | Hardware context. |
| io | Pointer to the IO object to move. |
|
static |
| int32_t ocs_hal_io_get_xid | ( | ocs_hal_t * | hal, |
| ocs_hal_io_t * | io | ||
| ) |
| ocs_hal_rtn_e ocs_hal_io_init_sges | ( | ocs_hal_t * | hal, |
| ocs_hal_io_t * | io, | ||
| ocs_hal_io_type_e | type | ||
| ) |
| uint8_t ocs_hal_io_inuse | ( | ocs_hal_t * | hal, |
| ocs_hal_io_t * | io | ||
| ) |
Check if given HAL IO is in-use.
| hal | Hardware context. |
| io | Pointer to the HAL IO object. |
| ocs_hal_rtn_e ocs_hal_io_send | ( | ocs_hal_t * | hal, |
| ocs_hal_io_type_e | type, | ||
| ocs_hal_io_t * | io, | ||
| uint32_t | len, | ||
| ocs_hal_io_param_t * | iparam, | ||
| ocs_remote_node_t * | rnode, | ||
| void * | cb, | ||
| void * | arg | ||
| ) |
Send a read, write, or response IO.
| hal | Hardware context. |
| type | Type of IO (target read, target response, and so on). |
| io | Previously-allocated HAL IO object. |
| len | Length, in bytes, of data to send. |
| iparam | IO parameters. |
| rnode | Destination of data (that is, a remote node). |
| cb | Function call upon completion of sending data (may be NULL). |
| arg | Argument to pass to IO completion function. |
| int32_t ocs_hal_set_active_profile | ( | ocs_hal_t * | hal, |
| ocs_set_active_profile_cb_t | cb, | ||
| uint32_t | profile_id, | ||
| void * | ul_arg | ||
| ) |
Set the currently active profile.
| hal | Hardware context. |
| profile_id | Profile ID to activate. |
| cb | Callback function to be called when the command completes. |
| ul_arg | An argument that is passed to the callback function. |
| int32_t ocs_hal_set_nvparms | ( | ocs_hal_t * | hal, |
| ocs_set_nvparms_cb_t | cb, | ||
| uint8_t * | wwpn, | ||
| uint8_t * | wwnn, | ||
| uint8_t | hard_alpa, | ||
| uint32_t | preferred_d_id, | ||
| void * | ul_arg | ||
| ) |
Write non-volatile parms.
| hal | Hardware context. |
| cb | Callback function to be called when the command completes. |
| wwpn | Port's WWPN in big-endian order, or NULL to use default. |
| wwnn | Port's WWNN in big-endian order, or NULL to use default. |
| hard_alpa | A hard AL_PA address setting used during loop initialization. If no hard AL_PA is required, set to 0. |
| preferred_d_id | A preferred D_ID address setting that may be overridden with the CONFIG_LINK mailbox command. If there is no preference, set to 0. |
| ul_arg | An argument that is passed to the callback function. |
| ocs_hal_rtn_e ocs_hal_set_port_protocol | ( | ocs_hal_t * | hal, |
| ocs_hal_port_protocol_e | new_protocol, | ||
| uint32_t | pci_func, | ||
| ocs_set_port_protocol_cb_t | cb, | ||
| void * | ul_arg | ||
| ) |
Set the port protocol.
On successful completion this function will have allocated two regular memory areas and one dma area which will need to get freed later in the callbacks.
| hal | Hardware context. |
| new_protocol | New protocol to use. |
| pci_func | PCI function to configure. |
| cb | Callback function to be called when the command completes. |
| ul_arg | An argument that is passed to the callback function. |
| ocs_hal_rtn_e ocs_hal_srrs_send | ( | ocs_hal_t * | hal, |
| ocs_hal_io_type_e | type, | ||
| ocs_hal_io_t * | io, | ||
| ocs_dma_t * | send, | ||
| uint32_t | len, | ||
| ocs_dma_t * | receive, | ||
| ocs_remote_node_t * | rnode, | ||
| ocs_hal_io_param_t * | iparam, | ||
| ocs_hal_srrs_cb_t | cb, | ||
| void * | arg | ||
| ) |
Send a Single Request/Response Sequence (SRRS).
| hal | Hardware context. |
| type | Type of sequence (ELS request/response, FC-CT). |
| io | Previously-allocated HAL IO object. |
| send | DMA memory holding data to send (for example, ELS request, BLS response). |
| len | Length, in bytes, of data to send. |
| receive | Optional DMA memory to hold a response. |
| rnode | Destination of data (that is, a remote node). |
| iparam | IO parameters (ELS response and FC-CT). |
| cb | Function call upon completion of sending the data (may be NULL). |
| arg | Argument to pass to IO completion function. |