#include "ocs_hal.h"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 (0ull) |
| #define | HAL_FWREV_MAX (~0ull) |
| #define | SLI4_ASIC_TYPE_ANY 0 |
| #define | SLI4_ASIC_REV_ANY 0 |
Functions | |
| static int32_t | ocs_hal_workaround_match (ocs_hal_t *hal, hal_workaround_t *w) |
| Function prototypes. More... | |
| static uint64_t | parse_fw_version (const char *fwrev_string) |
| Parse the firmware version (name) 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 (~0ull) |
Definition at line 52 of file ocs_hal_workaround.c.
| #define HAL_FWREV_ZERO (0ull) |
Definition at line 51 of file ocs_hal_workaround.c.
| #define SLI4_ASIC_REV_ANY 0 |
Definition at line 55 of file ocs_hal_workaround.c.
| #define SLI4_ASIC_TYPE_ANY 0 |
Definition at line 54 of file ocs_hal_workaround.c.
| enum hal_workaround_e |
Internal definition of workarounds.
Definition at line 61 of file ocs_hal_workaround.c.
|
static |
Function prototypes.
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 217 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 237 of file ocs_hal_workaround.c.
|
static |
Parse the firmware version (name)
Parse a string of the form a.b.c.d, returning a uint64_t packed as defined by the HAL_FWREV() macro
| fwrev_string | pointer to the firmware string |
Definition at line 181 of file ocs_hal_workaround.c.
|
static |
Definition at line 93 of file ocs_hal_workaround.c.