diff options
| author | Anjaneyulu <[email protected]> | 2025-02-05 12:55:33 +0000 |
|---|---|---|
| committer | Johannes Berg <[email protected]> | 2025-02-11 10:59:46 +0000 |
| commit | ca47dcc0d0ffd177cbe7cf172c32bef4b0ae3f3a (patch) | |
| tree | 58a86655ab3dbc6e7667ddee2d8e5c388ae30200 /drivers/net/wireless/intel/iwlwifi/fw/regulatory.c | |
| parent | wifi: b43: Replace outdated firmware URL (diff) | |
| download | kernel-ca47dcc0d0ffd177cbe7cf172c32bef4b0ae3f3a.tar.gz kernel-ca47dcc0d0ffd177cbe7cf172c32bef4b0ae3f3a.zip | |
wifi: iwlwifi: mvm: rename and move iwl_mvm_eval_dsm_rfi() to iwl_rfi_is_enabled_in_bios()
Renamed iwl_mvm_eval_dsm_rfi() to iwl_rfi_is_enabled_in_bios() to better
reflect the function's operation. Additionally, moved the function to the
regulatory.c file for better organization. optimize local variable
usage in it.
Signed-off-by: Anjaneyulu <[email protected]>
Reviewed-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://patch.msgid.link/20250205145347.b7ac9d05234e.Ieb623d7e8dca6bb6a5733682b31e4ff1e39373f0@changeid
Signed-off-by: Johannes Berg <[email protected]>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/fw/regulatory.c')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/regulatory.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c index ea435ee94312..63320689e05d 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c @@ -674,3 +674,34 @@ bool iwl_puncturing_is_allowed_in_bios(u32 puncturing, u16 mcc) } } IWL_EXPORT_SYMBOL(iwl_puncturing_is_allowed_in_bios); + +bool iwl_rfi_is_enabled_in_bios(struct iwl_fw_runtime *fwrt) +{ + /* default behaviour is disabled */ + u32 value = 0; + int ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_RFI_CONFIG, &value); + + if (ret < 0) { + IWL_DEBUG_RADIO(fwrt, "Failed to get DSM RFI, ret=%d\n", ret); + return false; + } + + value &= DSM_VALUE_RFI_DISABLE; + /* RFI BIOS CONFIG value can be 0 or 3 only. + * i.e 0 means DDR and DLVR enabled. 3 means DDR and DLVR disabled. + * 1 and 2 are invalid BIOS configurations, So, it's not possible to + * disable ddr/dlvr separately. + */ + if (!value) { + IWL_DEBUG_RADIO(fwrt, "DSM RFI is evaluated to enable\n"); + return true; + } else if (value == DSM_VALUE_RFI_DISABLE) { + IWL_DEBUG_RADIO(fwrt, "DSM RFI is evaluated to disable\n"); + } else { + IWL_DEBUG_RADIO(fwrt, + "DSM RFI got invalid value, value=%d\n", value); + } + + return false; +} +IWL_EXPORT_SYMBOL(iwl_rfi_is_enabled_in_bios); |
