Skip to content

Commit c3e5f5f

Browse files
Miriam-Racheljmberg-intel
authored andcommitted
wifi: iwlwifi: add support for activating UNII-1 in WW via BIOS
There is a requirement from OEMs to support a new bit in DSM function 8, which will indicate that this device is an indoor one, and that it should activate UNII-1 (5.2GHz) sub band in the World Wide Geo Profile. Add support for this by reading this bit from BIOS and sending it to the FW. Signed-off-by: Miri Korenblit <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20231011130030.86d4ad178042.Ief40acc08b5482ff147fd17e74e36f1933e43def@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 7b404c5 commit c3e5f5f

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ struct iwl_lari_config_change_cmd_v6 {
605605

606606
/**
607607
* struct iwl_lari_config_change_cmd_v7 - change LARI configuration
608+
* This structure is used also for lari cmd version 8.
608609
* @config_bitmap: Bitmap of the config commands. Each bit will trigger a
609610
* different predefined FW config operation.
610611
* @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
@@ -614,9 +615,12 @@ struct iwl_lari_config_change_cmd_v6 {
614615
* @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
615616
* per country, one to indicate whether to override and the other to
616617
* indicate allow/disallow unii4 channels.
617-
* @chan_state_active_bitmap: Bitmap for overriding channel state to active.
618-
* Each bit represents a country or region to activate, according to the
619-
* BIOS definitions.
618+
* @chan_state_active_bitmap: Bitmap to enable different bands per country
619+
* or region.
620+
* Each bit represents a country or region, and a band to activate
621+
* according to the BIOS definitions.
622+
* For LARI cmd version 7 - bits 0:3 are supported.
623+
* For LARI cmd version 8 - bits 0:4 are supported.
620624
* @force_disable_channels_bitmap: Bitmap of disabled bands/channels.
621625
* Each bit represents a set of channels in a specific band that should be
622626
* disabled
@@ -631,7 +635,12 @@ struct iwl_lari_config_change_cmd_v7 {
631635
__le32 chan_state_active_bitmap;
632636
__le32 force_disable_channels_bitmap;
633637
__le32 edt_bitmap;
634-
} __packed; /* LARI_CHANGE_CONF_CMD_S_VER_7 */
638+
} __packed;
639+
/* LARI_CHANGE_CONF_CMD_S_VER_7 */
640+
/* LARI_CHANGE_CONF_CMD_S_VER_8 */
641+
642+
/* Activate UNII-1 (5.2GHz) for World Wide */
643+
#define ACTIVATE_5G2_IN_WW_MASK BIT(4)
635644

636645
/**
637646
* struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete

drivers/net/wireless/intel/iwlwifi/mvm/fw.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,9 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)
12331233
int ret;
12341234
u32 value;
12351235
struct iwl_lari_config_change_cmd_v7 cmd = {};
1236+
u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw,
1237+
WIDE_ID(REGULATORY_AND_NVM_GROUP,
1238+
LARI_CONFIG_CHANGE), 1);
12361239

12371240
cmd.config_bitmap = iwl_acpi_get_lari_config_bitmap(&mvm->fwrt);
12381241

@@ -1250,8 +1253,11 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)
12501253
ret = iwl_acpi_get_dsm_u32(mvm->fwrt.dev, 0,
12511254
DSM_FUNC_ACTIVATE_CHANNEL,
12521255
&iwl_guid, &value);
1253-
if (!ret)
1256+
if (!ret) {
1257+
if (cmd_ver < 8)
1258+
value &= ~ACTIVATE_5G2_IN_WW_MASK;
12541259
cmd.chan_state_active_bitmap = cpu_to_le32(value);
1260+
}
12551261

12561262
ret = iwl_acpi_get_dsm_u32(mvm->fwrt.dev, 0,
12571263
DSM_FUNC_ENABLE_6E,
@@ -1279,11 +1285,9 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)
12791285
cmd.force_disable_channels_bitmap ||
12801286
cmd.edt_bitmap) {
12811287
size_t cmd_size;
1282-
u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw,
1283-
WIDE_ID(REGULATORY_AND_NVM_GROUP,
1284-
LARI_CONFIG_CHANGE),
1285-
1);
1288+
12861289
switch (cmd_ver) {
1290+
case 8:
12871291
case 7:
12881292
cmd_size = sizeof(struct iwl_lari_config_change_cmd_v7);
12891293
break;

0 commit comments

Comments
 (0)