diff options
author | Furquan Shaikh <furquan@google.com> | 2021-03-13 22:54:16 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-03-17 07:56:13 +0000 |
commit | 7fe5d3d382e25fbdd5026c8e0231dc5a10b57931 (patch) | |
tree | f97fe6e53afe9ff6f61eee4303cd8b5377c7e87d /src/mainboard/google/zork/variants | |
parent | 31f6320afeedfe622b0af51360078be28d26e378 (diff) | |
download | coreboot-7fe5d3d382e25fbdd5026c8e0231dc5a10b57931.tar.xz |
sar: Fix semantics of `get_wifi_sar_cbfs_filename()`
Currently, if `get_wifi_sar_cbfs_filename()` returns NULL, then
`get_wifi_sar_limits()` assumes that the default filename is used for
CBFS SAR file. This prevents a board from supporting different models
using the same firmware -- some which require SAR support and some
which don't.
This change updates the logic in `get_wifi_sar_limits()` to return
early if filename is not provided by the mainboard. In order to
maintain the same logic as before, current mainboards are updated to
return WIFI_SAR_CBFS_DEFAULT_FILENAME instead of NULL in default
case.
Change-Id: I68b5bdd213767a3cd81fe41ace66540acd68e26a
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51485
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/zork/variants')
-rw-r--r-- | src/mainboard/google/zork/variants/vilboz/variant.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/mainboard/google/zork/variants/vilboz/variant.c b/src/mainboard/google/zork/variants/vilboz/variant.c index e75d8fcd8a..57563ccaa0 100644 --- a/src/mainboard/google/zork/variants/vilboz/variant.c +++ b/src/mainboard/google/zork/variants/vilboz/variant.c @@ -60,29 +60,23 @@ void variant_devtree_update(void) const char *get_wifi_sar_cbfs_filename(void) { - const char *filename = NULL; int sar_config; sar_config = variant_gets_sar_config(); switch (sar_config) { case 1: - filename = "wifi_sar-vilboz-0.hex"; - break; + return "wifi_sar-vilboz-0.hex"; case 3: /* TODO: Set default first. It will be replaced after the new table is generated. */ - filename = "wifi_sar_defaults.hex"; - break; + return WIFI_SAR_CBFS_DEFAULT_FILENAME; case 5: - filename = "wifi_sar-vilboz-1.hex"; - break; case 7: - filename = "wifi_sar-vilboz-1.hex"; - break; + return "wifi_sar-vilboz-1.hex"; + default: + return WIFI_SAR_CBFS_DEFAULT_FILENAME; } - - return filename; } |