mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 18:03:10 -04:00
wifi: iwlwifi: regulatory: add LARI v15 DSM support bitmap
Firmware API v15 extends LARI config with the DSM function-0 support bitmap, and host must provide this information for regulatory handling. Without this, FW cannot use BIOS-reported DSM capability bits. Add oem_supported_dsm_bitmap to the host LARI config command definition and wire it into regulatory command construction. Populate it from DSM query data and keep backward compatibility by using the pre-v15 command size for command version 14. Behavior change: When DSM function-0 data is available, host includes it in the LARI config command sent to FW; older command versions remain compatible. Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com> Link: https://patch.msgid.link/20260723142324.c576a8c7560b.I5cc1277d0ef31409f6a3364342a3f35cd9318ceb@changeid Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
This commit is contained in:
committed by
Miri Korenblit
parent
a47ab1b9c0
commit
01f41f5fd8
@@ -181,6 +181,7 @@ static int iwl_acpi_load_dsm_values(struct iwl_fw_runtime *fwrt)
|
||||
|
||||
fwrt->dsm_revision = ACPI_DSM_REV;
|
||||
fwrt->dsm_source = BIOS_SOURCE_ACPI;
|
||||
fwrt->dsm_values[DSM_FUNC_QUERY] = (u32)query_func_val;
|
||||
|
||||
IWL_DEBUG_RADIO(fwrt, "ACPI DSM validity bitmap 0x%x\n",
|
||||
(u32)query_func_val);
|
||||
@@ -246,7 +247,7 @@ int iwl_acpi_get_dsm(struct iwl_fw_runtime *fwrt,
|
||||
BUILD_BUG_ON(ARRAY_SIZE(fwrt->dsm_values) != DSM_FUNC_NUM_FUNCS);
|
||||
BUILD_BUG_ON(BITS_PER_TYPE(fwrt->dsm_funcs_valid) < DSM_FUNC_NUM_FUNCS);
|
||||
|
||||
if (WARN_ON(func >= ARRAY_SIZE(fwrt->dsm_values) || !func))
|
||||
if (WARN_ON(func >= ARRAY_SIZE(fwrt->dsm_values)))
|
||||
return -EINVAL;
|
||||
|
||||
if (!(fwrt->dsm_funcs_valid & BIT(func))) {
|
||||
|
||||
@@ -697,6 +697,8 @@ struct iwl_lari_config_change_cmd_v8 {
|
||||
* @wcpe_bitmap: bitmap of puncturing enablement per MCC
|
||||
* @bios_wbem_hdr: 320 MHz per-MCC WBEM config header
|
||||
* @reserved: reserved
|
||||
* @oem_supported_dsm_bitmap: DSM function 0 bitmap describing supported
|
||||
* DSM function indices
|
||||
*/
|
||||
struct iwl_lari_config_change_cmd {
|
||||
__le32 config_bitmap;
|
||||
@@ -720,10 +722,13 @@ struct iwl_lari_config_change_cmd {
|
||||
__le32 wcpe_bitmap;
|
||||
struct iwl_bios_config_hdr bios_wbem_hdr;
|
||||
__le32 reserved[10];
|
||||
/* since version 15 */
|
||||
__le32 oem_supported_dsm_bitmap;
|
||||
} __packed;
|
||||
/* LARI_CHANGE_CONF_CMD_S_VER_12
|
||||
* LARI_CHANGE_CONF_CMD_S_VER_13
|
||||
* LARI_CHANGE_CONF_CMD_S_VER_14
|
||||
* LARI_CHANGE_CONF_CMD_S_VER_15
|
||||
*/
|
||||
|
||||
/* Activate UNII-1 (5.2GHz) for World Wide */
|
||||
|
||||
@@ -927,7 +927,7 @@ static int iwl_uefi_load_dsm_values(struct iwl_fw_runtime *fwrt)
|
||||
*/
|
||||
fwrt->dsm_funcs_valid |= BIT(DSM_FUNC_QUERY);
|
||||
|
||||
for (int func = 1; func < ARRAY_SIZE(fwrt->dsm_values); func++) {
|
||||
for (int func = 0; func < ARRAY_SIZE(fwrt->dsm_values); func++) {
|
||||
if (!(fwrt->dsm_funcs_valid & BIT(func))) {
|
||||
IWL_DEBUG_RADIO(fwrt, "DSM func %d not in 0x%x\n",
|
||||
func, fwrt->dsm_funcs_valid);
|
||||
|
||||
@@ -16,8 +16,11 @@
|
||||
static ssize_t iwl_mld_get_lari_config_cmd_size(u8 cmd_ver)
|
||||
{
|
||||
switch (cmd_ver) {
|
||||
case 14:
|
||||
case 15:
|
||||
return sizeof(struct iwl_lari_config_change_cmd);
|
||||
case 14:
|
||||
return offsetof(struct iwl_lari_config_change_cmd,
|
||||
oem_supported_dsm_bitmap);
|
||||
case 13:
|
||||
return offsetof(struct iwl_lari_config_change_cmd,
|
||||
oem_uhb_allow_extension_bitmap);
|
||||
@@ -425,6 +428,10 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
|
||||
if (!ret)
|
||||
cmd.oem_uhb_allow_extension_bitmap = cpu_to_le32(value);
|
||||
|
||||
ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_QUERY, &value);
|
||||
if (!ret)
|
||||
cmd.oem_supported_dsm_bitmap = cpu_to_le32(value);
|
||||
|
||||
cmd.bios_wcpe_hdr.table_source = fwrt->puncturing_source;
|
||||
cmd.bios_wcpe_hdr.table_revision = fwrt->puncturing_revision;
|
||||
cmd.wcpe_bitmap = cpu_to_le32(fwrt->bios_puncturing);
|
||||
@@ -441,7 +448,8 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
|
||||
!cmd.oem_11be_allow_bitmap &&
|
||||
!cmd.oem_11bn_allow_bitmap &&
|
||||
!cmd.oem_unii9_enable &&
|
||||
!cmd.wcpe_bitmap)
|
||||
!cmd.wcpe_bitmap &&
|
||||
!cmd.oem_supported_dsm_bitmap)
|
||||
return;
|
||||
|
||||
cmd.bios_hdr.table_source = fwrt->dsm_source;
|
||||
@@ -478,6 +486,9 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
|
||||
IWL_DEBUG_RADIO(mld,
|
||||
"sending LARI_CONFIG_CHANGE, wcpe_bitmap=0x%x\n",
|
||||
le32_to_cpu(cmd.wcpe_bitmap));
|
||||
IWL_DEBUG_RADIO(mld,
|
||||
"sending LARI_CONFIG_CHANGE, oem_supported_dsm_bitmap=0x%x\n",
|
||||
le32_to_cpu(cmd.oem_supported_dsm_bitmap));
|
||||
|
||||
ret = iwl_mld_send_cmd_pdu(mld,
|
||||
WIDE_ID(REGULATORY_AND_NVM_GROUP,
|
||||
|
||||
Reference in New Issue
Block a user