wifi: iwlwifi: support BIOS override for 5G9 in CA also in LARI version 8
PATCH 1/1 wifi: iwlwifi: support BIOS override for 5G9 in CA also in LARI version 8
From: Miri Korenblit <[email protected]>
commit b1e8102a4048003097c7054cbc00bbda91a5ced7 upstream
Commit 6b3e87cc0ca5 ("iwlwifi: Add support for LARI_CONFIG_CHANGE_CMD cmd v9")
added a few bits to iwl_lari_config_change_cmd::oem_unii4_allow_bitmap if the FW has LARI version >= 9.
But we also need to send those bits for version 8 if the FW is capable of this feature (indicated with capability bits)
Add the FW capability bit, and set the additional bits in the cmd when the version is 8 and the FW capability bit is set.
--- drivers/net/wireless/intel/iwlwifi/fw/file.h | 4 ++- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 37 ++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/file.h +3 -1
@@ -372,6 +372,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;* channels even when these are not enabled. * @IWL_UCODE_TLV_CAPA_DUMP_COMPLETE_SUPPORT: Support for indicating dump collection * complete to FW. +* @IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA: supports (de)activating 5G9 +* for CA from BIOS. * * @NUM_IWL_UCODE_TLV_CAPA: number of bits used */
@@ -468,7 +470,7 @@ enum iwl_ucode_tlv_capa {IWL_UCODE_TLV_CAPA_OFFLOAD_BTM_SUPPORT = (__force iwl_ucode_tlv_capa_t )113 ,IWL_UCODE_TLV_CAPA_STA_EXP_MFP_SUPPORT = (__force iwl_ucode_tlv_capa_t )114 ,IWL_UCODE_TLV_CAPA_SNIFF_VALIDATE_SUPPORT = (__force iwl_ucode_tlv_capa_t )116 , - +IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA = (__force iwl_ucode_tlv_capa_t )123 , #ifdef __CHECKER__ /* sparse says it cannot increment the previous enum member */#define NUM_IWL_UCODE_TLV_CAPA 128
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +35 -2
@@ -1195,11 +1195,30 @@ static u8 iwl_mvm_eval_dsm_rfi(struct iwl_mvm *mvm)return DSM_VALUE_RFI_DISABLE ; } +enum iwl_dsm_unii4_bitmap { +DSM_VALUE_UNII4_US_OVERRIDE_MSK =BIT (0 ), +DSM_VALUE_UNII4_US_EN_MSK =BIT (1 ), +DSM_VALUE_UNII4_ETSI_OVERRIDE_MSK =BIT (2 ), +DSM_VALUE_UNII4_ETSI_EN_MSK =BIT (3 ), +DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK =BIT (4 ), +DSM_VALUE_UNII4_CANADA_EN_MSK =BIT (5 ), +}; + +#define DSM_UNII4_ALLOW_BITMAP (DSM_VALUE_UNII4_US_OVERRIDE_MSK |\ + DSM_VALUE_UNII4_US_EN_MSK |\ + DSM_VALUE_UNII4_ETSI_OVERRIDE_MSK |\ + DSM_VALUE_UNII4_ETSI_EN_MSK |\ + DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK |\ + DSM_VALUE_UNII4_CANADA_EN_MSK) +static void iwl_mvm_lari_cfg (struct iwl_mvm *mvm) {int ret;u32 value;struct iwl_lari_config_change_cmd_v6 cmd = {}; +u8 cmd_ver =iwl_fw_lookup_cmd_ver (mvm->fw, +WIDE_ID (REGULATORY_AND_NVM_GROUP , +LARI_CONFIG_CHANGE ),1 ); cmd.config_bitmap =iwl_acpi_get_lari_config_bitmap (&mvm->fwrt);
@@ -1211,8 +1230,22 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm) ret =iwl_acpi_get_dsm_u32 (mvm->fwrt.dev,0 ,DSM_FUNC_ENABLE_UNII4_CHAN , &iwl_guid, &value); -if (!ret) - cmd.oem_unii4_allow_bitmap =cpu_to_le32 (value); +if (!ret) { +u32 _value =cpu_to_le32 (value); + + _value &=DSM_UNII4_ALLOW_BITMAP ; + +/* Since version 9, bits 4 and 5 are supported +* regardless of this capability. +*/ +if (cmd_ver <9 && + !fw_has_capa (&mvm->fw->ucode_capa, +IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA )) + _value &= ~(DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK | +DSM_VALUE_UNII4_CANADA_EN_MSK ); + + cmd.oem_unii4_allow_bitmap =cpu_to_le32 (_value); + } ret = iwl_acpi_get_dsm_u32(mvm->fwrt.dev, 0, DSM_FUNC_ACTIVATE_CHANNEL,
Signature · 1 line
2.48.1
Hello stable kernel maintainers,
Quoted 20 lines · Emmanuel Grumbach
From: Miri Korenblit <[email protected]>
commit
b1e8102a4048003097c7054cbc00bbda91a5ced7upstreamCommit
6b3e87cc0ca5("iwlwifi: Add support forLARI_CONFIG_CHANGE_CMDcmd v9")
added a few bits toiwl_lari_config_change_cmd::oem_unii4_allow_bitmap
if the FW has LARI version >= 9.
But we also need to send those bits for version 8 if the FW is capable
of this feature (indicated with capability bits)
Add the FW capability bit, and set the additional bits in the cmd when
the version is 8 and the FW capability bit is set.Signed-off-by Miri Korenblit <[email protected]>Reviewed-by Johannes Berg <[email protected]>
Quoted 7 lines
Signed-off-by Johannes Berg <[email protected]>Signed-off-by Emmanuel Grumbach <[email protected]>---
drivers/net/wireless/intel/iwlwifi/fw/file.h | 4 ++- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 37
++++++++++++++++++--2 files changed, 38 insertions(+), 3 deletions(-)
I didn't want to alter the commit log of this patch, but this patch has a bigger impact that just enabling a feature in the firmware. It checks that the firmware actually supports that feature and this fixes crashes that were reported on certain device / platform combinations that made wifi unusable.
Sasha Levin
maintainer[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: b1e8102a4048003097c7054cbc00bbda91a5ced7
WARNING: Author mismatch between patch and upstream commit:
Backport author: Emmanuel Grumbach<[email protected]> Commit author: Miri Korenblit<[email protected]>
Status in newer kernel trees:
6.13.y | Not found
6.12.y | Not found
Note: The patch differs from the upstream commit:
---
1: b1e8102a40480 < -: ------------- wifi: iwlwifi: support BIOS override for 5G9 in CA also in LARI version 8 -: ------------- > 1: 16be59b9ee600 wifi: iwlwifi: support BIOS override for 5G9 in CA also in LARI version 8
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success |