mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
wifi: iwlwifi: support V13 of iwl_lari_config_change_cmd
This command is getting a new field for UNII-9 and ieee80211bn enablement. We must read the relevant DSM values and pass them to the firmware, Remember whether we have ACPI or UEFI available in the firmware runtime object and remember the DSM function revision. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20260111193638.9577f0cade21.I82b26f082f152a83eb9990dddf68d7dcc549f227@changeid
This commit is contained in:
parent
1e00423de0
commit
abce13f560
|
|
@ -28,6 +28,8 @@ static const size_t acpi_dsm_size[DSM_FUNC_NUM_FUNCS] = {
|
|||
[DSM_FUNC_ENERGY_DETECTION_THRESHOLD] = sizeof(u32),
|
||||
[DSM_FUNC_RFI_CONFIG] = sizeof(u32),
|
||||
[DSM_FUNC_ENABLE_11BE] = sizeof(u32),
|
||||
[DSM_FUNC_ENABLE_UNII_9] = sizeof(u32),
|
||||
[DSM_FUNC_ENABLE_11BN] = sizeof(u32),
|
||||
};
|
||||
|
||||
static int iwl_acpi_get_handle(struct device *dev, acpi_string method,
|
||||
|
|
@ -177,6 +179,9 @@ static int iwl_acpi_load_dsm_values(struct iwl_fw_runtime *fwrt)
|
|||
return ret;
|
||||
}
|
||||
|
||||
fwrt->dsm_revision = ACPI_DSM_REV;
|
||||
fwrt->dsm_source = BIOS_SOURCE_ACPI;
|
||||
|
||||
IWL_DEBUG_RADIO(fwrt, "ACPI DSM validity bitmap 0x%x\n",
|
||||
(u32)query_func_val);
|
||||
|
||||
|
|
|
|||
|
|
@ -658,6 +658,10 @@ struct iwl_lari_config_change_cmd_v8 {
|
|||
* bit0: enable 11be in China(CB/CN).
|
||||
* bit1: enable 11be in South Korea.
|
||||
* bit 2 - 31: reserved.
|
||||
* @oem_11bn_allow_bitmap: Bitmap of 11bn allowed MCCs. The firmware expects to
|
||||
* get the data from the BIOS.
|
||||
* @oem_unii9_enable: UNII-9 enablement as read from the BIOS
|
||||
* @bios_hdr: bios config header
|
||||
*/
|
||||
struct iwl_lari_config_change_cmd {
|
||||
__le32 config_bitmap;
|
||||
|
|
@ -669,8 +673,16 @@ struct iwl_lari_config_change_cmd {
|
|||
__le32 edt_bitmap;
|
||||
__le32 oem_320mhz_allow_bitmap;
|
||||
__le32 oem_11be_allow_bitmap;
|
||||
/* since version 13 */
|
||||
__le32 oem_11bn_allow_bitmap;
|
||||
/* since version 13 */
|
||||
__le32 oem_unii9_enable;
|
||||
/* since version 13 */
|
||||
struct iwl_bios_config_hdr bios_hdr;
|
||||
} __packed;
|
||||
/* LARI_CHANGE_CONF_CMD_S_VER_12 */
|
||||
/* LARI_CHANGE_CONF_CMD_S_VER_12
|
||||
* LARI_CHANGE_CONF_CMD_S_VER_13
|
||||
*/
|
||||
|
||||
/* Activate UNII-1 (5.2GHz) for World Wide */
|
||||
#define ACTIVATE_5G2_IN_WW_MASK BIT(4)
|
||||
|
|
|
|||
|
|
@ -125,7 +125,9 @@ enum iwl_dsm_funcs {
|
|||
DSM_FUNC_ENERGY_DETECTION_THRESHOLD = 10,
|
||||
DSM_FUNC_RFI_CONFIG = 11,
|
||||
DSM_FUNC_ENABLE_11BE = 12,
|
||||
DSM_FUNC_NUM_FUNCS = 13,
|
||||
DSM_FUNC_ENABLE_11BN = 13,
|
||||
DSM_FUNC_ENABLE_UNII_9 = 14,
|
||||
DSM_FUNC_NUM_FUNCS,
|
||||
};
|
||||
|
||||
enum iwl_dsm_values_srd {
|
||||
|
|
|
|||
|
|
@ -141,6 +141,8 @@ struct iwl_txf_iter_data {
|
|||
* @timestamp.seq: timestamp marking sequence
|
||||
* @timestamp.delay: timestamp marking worker delay
|
||||
* @tpc_enabled: TPC enabled
|
||||
* @dsm_source: one of &enum bios_source. UEFI, ACPI or NONE
|
||||
* @dsm_revision: the revision of the DSM table
|
||||
*/
|
||||
struct iwl_fw_runtime {
|
||||
struct iwl_trans *trans;
|
||||
|
|
@ -215,6 +217,8 @@ struct iwl_fw_runtime {
|
|||
bool uats_valid;
|
||||
u8 uefi_tables_lock_status;
|
||||
struct iwl_phy_specific_cfg phy_filters;
|
||||
enum bios_source dsm_source;
|
||||
u8 dsm_revision;
|
||||
|
||||
#if defined(CONFIG_ACPI) || defined(CONFIG_EFI)
|
||||
u32 dsm_funcs_valid;
|
||||
|
|
|
|||
|
|
@ -738,6 +738,8 @@ static int iwl_uefi_load_dsm_values(struct iwl_fw_runtime *fwrt)
|
|||
data->revision);
|
||||
goto out;
|
||||
}
|
||||
fwrt->dsm_revision = data->revision;
|
||||
fwrt->dsm_source = BIOS_SOURCE_UEFI;
|
||||
|
||||
fwrt->dsm_funcs_valid = data->functions[DSM_FUNC_QUERY];
|
||||
|
||||
|
|
|
|||
|
|
@ -281,6 +281,14 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
|
|||
if (!ret)
|
||||
cmd.oem_11be_allow_bitmap = cpu_to_le32(value);
|
||||
|
||||
ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_11BN, &value);
|
||||
if (!ret)
|
||||
cmd.oem_11bn_allow_bitmap = cpu_to_le32(value);
|
||||
|
||||
ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_UNII_9, &value);
|
||||
if (!ret)
|
||||
cmd.oem_unii9_enable = cpu_to_le32(value);
|
||||
|
||||
if (!cmd.config_bitmap &&
|
||||
!cmd.oem_uhb_allow_bitmap &&
|
||||
!cmd.oem_11ax_allow_bitmap &&
|
||||
|
|
@ -289,9 +297,14 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
|
|||
!cmd.force_disable_channels_bitmap &&
|
||||
!cmd.edt_bitmap &&
|
||||
!cmd.oem_320mhz_allow_bitmap &&
|
||||
!cmd.oem_11be_allow_bitmap)
|
||||
!cmd.oem_11be_allow_bitmap &&
|
||||
!cmd.oem_11bn_allow_bitmap &&
|
||||
!cmd.oem_unii9_enable)
|
||||
return;
|
||||
|
||||
cmd.bios_hdr.table_source = fwrt->dsm_source;
|
||||
cmd.bios_hdr.table_revision = fwrt->dsm_revision;
|
||||
|
||||
IWL_DEBUG_RADIO(mld,
|
||||
"sending LARI_CONFIG_CHANGE, config_bitmap=0x%x, oem_11ax_allow_bitmap=0x%x\n",
|
||||
le32_to_cpu(cmd.config_bitmap),
|
||||
|
|
@ -311,9 +324,28 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
|
|||
IWL_DEBUG_RADIO(mld,
|
||||
"sending LARI_CONFIG_CHANGE, oem_11be_allow_bitmap=0x%x\n",
|
||||
le32_to_cpu(cmd.oem_11be_allow_bitmap));
|
||||
IWL_DEBUG_RADIO(mld,
|
||||
"sending LARI_CONFIG_CHANGE, oem_11bn_allow_bitmap=0x%x\n",
|
||||
le32_to_cpu(cmd.oem_11bn_allow_bitmap));
|
||||
IWL_DEBUG_RADIO(mld,
|
||||
"sending LARI_CONFIG_CHANGE, oem_unii9_enable=0x%x\n",
|
||||
le32_to_cpu(cmd.oem_unii9_enable));
|
||||
|
||||
ret = iwl_mld_send_cmd_pdu(mld, WIDE_ID(REGULATORY_AND_NVM_GROUP,
|
||||
LARI_CONFIG_CHANGE), &cmd);
|
||||
if (iwl_fw_lookup_cmd_ver(mld->fw,
|
||||
WIDE_ID(REGULATORY_AND_NVM_GROUP,
|
||||
LARI_CONFIG_CHANGE), 12) == 12) {
|
||||
int cmd_size = offsetof(typeof(cmd), oem_11bn_allow_bitmap);
|
||||
|
||||
ret = iwl_mld_send_cmd_pdu(mld,
|
||||
WIDE_ID(REGULATORY_AND_NVM_GROUP,
|
||||
LARI_CONFIG_CHANGE),
|
||||
&cmd, cmd_size);
|
||||
} else {
|
||||
ret = iwl_mld_send_cmd_pdu(mld,
|
||||
WIDE_ID(REGULATORY_AND_NVM_GROUP,
|
||||
LARI_CONFIG_CHANGE),
|
||||
&cmd);
|
||||
}
|
||||
if (ret)
|
||||
IWL_DEBUG_RADIO(mld,
|
||||
"Failed to send LARI_CONFIG_CHANGE (%d)\n",
|
||||
|
|
|
|||
|
|
@ -1220,7 +1220,8 @@ static size_t iwl_mvm_get_lari_config_cmd_size(u8 cmd_ver)
|
|||
|
||||
switch (cmd_ver) {
|
||||
case 12:
|
||||
cmd_size = sizeof(struct iwl_lari_config_change_cmd);
|
||||
cmd_size = offsetof(struct iwl_lari_config_change_cmd,
|
||||
oem_11bn_allow_bitmap);
|
||||
break;
|
||||
case 8:
|
||||
cmd_size = sizeof(struct iwl_lari_config_change_cmd_v8);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user