Go to the source code of this file.
This file contains all HAL runtime workaround code. Based on the asic type, asic revision, and range of fw revisions, a particular workaround may be enabled.
A workaround may consist of overriding a particular HAL/SLI4 value that was initialized during ocs_hal_setup() (for example the MAX_QUEUE overrides for mis-reported queue sizes). Or if required, elements of the ocs_hal_workaround_t structure may be set to control specific runtime behavior.
It is intended that the controls in ocs_hal_workaround_t be defined functionally. So we would have the driver look like: "if (hal->workaround.enable_xxx) then ...", rather than what we might previously see as "if this is a BE3, then do xxx"
Definition in file ocs_hal_workaround.c.
Data Structures | |
| struct | hal_workaround_t |
| Internal workaround structure instance. More... | |
Macros | |
| #define | HAL_FWREV_ZERO (0) |
| #define | HAL_FWREV_MAX UINT32_MAX |
| #define | SLI4_ASIC_TYPE_ANY 0 |
| #define | SLI4_ASIC_REV_ANY 0 |
Enumerations | |
| enum | hal_workaround_e { HAL_WORKAROUND_TEST = 1, HAL_WORKAROUND_DEC_CQ_COUNT, HAL_WORKAROUND_MULTI_PROTOCOL, HAL_WORKAROUND_FORCE_NODIF, HAL_WORKAROUND_FW_VERSION_TOO_LOW } |
| Internal definition of workarounds. More... | |
Functions | |
| static uint32_t | parse_fw_version (const char *fwrev_string) |
| Parse the firmware version (name) More... | |
| static int32_t | ocs_hal_workaround_match (ocs_hal_t *hal, hal_workaround_t *w) |
| Test for a workaround match. More... | |
| void | ocs_hal_workaround_setup (struct ocs_hal_s *hal) |
| Setup HAL runtime workarounds. More... | |
Variables | |
| static hal_workaround_t | hal_workarounds [] |
| #define HAL_FWREV_MAX UINT32_MAX |
Definition at line 53 of file ocs_hal_workaround.c.
| #define HAL_FWREV_ZERO (0) |
Definition at line 52 of file ocs_hal_workaround.c.
| #define SLI4_ASIC_REV_ANY 0 |
Definition at line 56 of file ocs_hal_workaround.c.
| #define SLI4_ASIC_TYPE_ANY 0 |
Definition at line 55 of file ocs_hal_workaround.c.
| enum hal_workaround_e |
Internal definition of workarounds.
| Enumerator | |
|---|---|
| HAL_WORKAROUND_TEST | |
| HAL_WORKAROUND_DEC_CQ_COUNT | |
| HAL_WORKAROUND_MULTI_PROTOCOL | |
| HAL_WORKAROUND_FORCE_NODIF | |
| HAL_WORKAROUND_FW_VERSION_TOO_LOW | |
Definition at line 62 of file ocs_hal_workaround.c.
|
static |
Test for a workaround match.
Looks at the asic type, asic revision, and fw revision, and returns TRUE if match.
| hal | Pointer to the HAL structure |
| w | Pointer to a workaround structure entry |
Definition at line 153 of file ocs_hal_workaround.c.
| void ocs_hal_workaround_setup | ( | struct ocs_hal_s * | hal | ) |
Setup HAL runtime workarounds.
The function is called at the end of ocs_hal_setup() to setup any runtime workarounds based on the HAL/SLI setup.
| hal | Pointer to HAL structure |
Definition at line 173 of file ocs_hal_workaround.c.
|
static |
Parse the firmware version (name)
Parse a string of the form a.b.c.d, returning a uint32_t packed as defined by the HAL_FWREV() macro
| fwrev_string | pointer to the firmware string |
Definition at line 117 of file ocs_hal_workaround.c.
|
static |
Definition at line 84 of file ocs_hal_workaround.c.