Commit 5fde0fcb authored by Pagadala Yesu Anjaneyulu's avatar Pagadala Yesu Anjaneyulu Committed by Miri Korenblit
Browse files

wifi: iwlwifi: mask reserved bits in chan_state_active_bitmap



Mask the reserved bits as firmware will assert if reserved bits are set.

Fixes: ef7ddf4e ("wifi: iwlwifi: Add support for LARI_CONFIG_CHANGE_CMD v12")
Signed-off-by: default avatarPagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250709065608.7a72c70bdc9d.Ic9be0a3fc3aabde0c4b88568f3bb7b76e375f8d4@changeid
parent e5d110fe
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
 * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
 * Copyright (C) 2012-2014, 2018-2025 Intel Corporation
 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
 * Copyright (C) 2016-2017 Intel Deutschland GmbH
 */
@@ -754,7 +754,7 @@ struct iwl_lari_config_change_cmd_v10 {
 *	according to the BIOS definitions.
 *	For LARI cmd version 11 - bits 0:4 are supported.
 *	For LARI cmd version 12 - bits 0:6 are supported and bits 7:31 are
 *	reserved. No need to mask out the reserved bits.
 *	reserved.
 * @force_disable_channels_bitmap: Bitmap of disabled bands/channels.
 *	Each bit represents a set of channels in a specific band that should be
 *	disabled
@@ -787,6 +787,7 @@ struct iwl_lari_config_change_cmd {
/* Activate UNII-1 (5.2GHz) for World Wide */
#define ACTIVATE_5G2_IN_WW_MASK			BIT(4)
#define CHAN_STATE_ACTIVE_BITMAP_CMD_V11	0x1F
#define CHAN_STATE_ACTIVE_BITMAP_CMD_V12	0x7F

/**
 * struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete
+1 −0
Original line number Diff line number Diff line
@@ -614,6 +614,7 @@ int iwl_fill_lari_config(struct iwl_fw_runtime *fwrt,

	ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ACTIVATE_CHANNEL, &value);
	if (!ret) {
		value &= CHAN_STATE_ACTIVE_BITMAP_CMD_V12;
		if (cmd_ver < 8)
			value &= ~ACTIVATE_5G2_IN_WW_MASK;

+3 −1
Original line number Diff line number Diff line
@@ -251,8 +251,10 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
			cpu_to_le32(value &= DSM_UNII4_ALLOW_BITMAP);

	ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ACTIVATE_CHANNEL, &value);
	if (!ret)
	if (!ret) {
		value &= CHAN_STATE_ACTIVE_BITMAP_CMD_V12;
		cmd.chan_state_active_bitmap = cpu_to_le32(value);
	}

	ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_6E, &value);
	if (!ret)