Commit b1e8102a authored by Miri Korenblit's avatar Miri Korenblit Committed by Johannes Berg
Browse files

wifi: iwlwifi: support BIOS override for 5G9 in CA also in LARI version 8



Commit 6b3e87cc ("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.

Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241226174257.dc5836f84514.I1e38f94465a36731034c94b9811de10cb6ee5921@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent a581a028
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -398,6 +398,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;
 * @IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT: Support secure LTF measurement.
 * @IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS: Support monitor mode on otherwise
 *	passive channels
 * @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
 */
@@ -498,6 +500,7 @@ enum iwl_ucode_tlv_capa {
	IWL_UCODE_TLV_CAPA_CHINA_22_REG_SUPPORT		= (__force iwl_ucode_tlv_capa_t)117,
	IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT		= (__force iwl_ucode_tlv_capa_t)121,
	IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS	= (__force iwl_ucode_tlv_capa_t)122,
	IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA	= (__force iwl_ucode_tlv_capa_t)123,
	NUM_IWL_UCODE_TLV_CAPA
/*
 * This construction make both sparse (which cannot increment the previous
+10 −4
Original line number Diff line number Diff line
@@ -552,11 +552,17 @@ int iwl_fill_lari_config(struct iwl_fw_runtime *fwrt,

	ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_UNII4_CHAN, &value);
	if (!ret) {
		if (cmd_ver < 9)
			value &= DSM_UNII4_ALLOW_BITMAP_CMD_V8;
		else
		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(&fwrt->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);
	}

+5 −6
Original line number Diff line number Diff line
@@ -144,11 +144,10 @@ enum iwl_dsm_unii4_bitmap {
	DSM_VALUE_UNII4_CANADA_EN_MSK		= BIT(5),
};

#define DSM_UNII4_ALLOW_BITMAP_CMD_V8 (DSM_VALUE_UNII4_US_OVERRIDE_MSK | \
#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)
#define DSM_UNII4_ALLOW_BITMAP (DSM_UNII4_ALLOW_BITMAP_CMD_V8 | \
				DSM_VALUE_UNII4_ETSI_EN_MSK		|\
				DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK	|\
				DSM_VALUE_UNII4_CANADA_EN_MSK)