Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.86d4ad178042.Ief40acc08b5482ff147fd17e74e36f1933e43def@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Miri Korenblit and committed by
Johannes Berg
c3e5f5f6 7b404c5c

+22 -9
+13 -4
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
··· 605 605 606 606 /** 607 607 * struct iwl_lari_config_change_cmd_v7 - change LARI configuration 608 + * This structure is used also for lari cmd version 8. 608 609 * @config_bitmap: Bitmap of the config commands. Each bit will trigger a 609 610 * different predefined FW config operation. 610 611 * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets. ··· 615 614 * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits 616 615 * per country, one to indicate whether to override and the other to 617 616 * indicate allow/disallow unii4 channels. 618 - * @chan_state_active_bitmap: Bitmap for overriding channel state to active. 619 - * Each bit represents a country or region to activate, according to the 620 - * BIOS definitions. 617 + * @chan_state_active_bitmap: Bitmap to enable different bands per country 618 + * or region. 619 + * Each bit represents a country or region, and a band to activate 620 + * according to the BIOS definitions. 621 + * For LARI cmd version 7 - bits 0:3 are supported. 622 + * For LARI cmd version 8 - bits 0:4 are supported. 621 623 * @force_disable_channels_bitmap: Bitmap of disabled bands/channels. 622 624 * Each bit represents a set of channels in a specific band that should be 623 625 * disabled ··· 635 631 __le32 chan_state_active_bitmap; 636 632 __le32 force_disable_channels_bitmap; 637 633 __le32 edt_bitmap; 638 - } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_7 */ 634 + } __packed; 635 + /* LARI_CHANGE_CONF_CMD_S_VER_7 */ 636 + /* LARI_CHANGE_CONF_CMD_S_VER_8 */ 637 + 638 + /* Activate UNII-1 (5.2GHz) for World Wide */ 639 + #define ACTIVATE_5G2_IN_WW_MASK BIT(4) 639 640 640 641 /** 641 642 * struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete
+9 -5
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
··· 1233 1233 int ret; 1234 1234 u32 value; 1235 1235 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); 1236 1239 1237 1240 cmd.config_bitmap = iwl_acpi_get_lari_config_bitmap(&mvm->fwrt); 1238 1241 ··· 1253 1250 ret = iwl_acpi_get_dsm_u32(mvm->fwrt.dev, 0, 1254 1251 DSM_FUNC_ACTIVATE_CHANNEL, 1255 1252 &iwl_guid, &value); 1256 - if (!ret) 1253 + if (!ret) { 1254 + if (cmd_ver < 8) 1255 + value &= ~ACTIVATE_5G2_IN_WW_MASK; 1257 1256 cmd.chan_state_active_bitmap = cpu_to_le32(value); 1257 + } 1258 1258 1259 1259 ret = iwl_acpi_get_dsm_u32(mvm->fwrt.dev, 0, 1260 1260 DSM_FUNC_ENABLE_6E, ··· 1285 1279 cmd.force_disable_channels_bitmap || 1286 1280 cmd.edt_bitmap) { 1287 1281 size_t cmd_size; 1288 - u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, 1289 - WIDE_ID(REGULATORY_AND_NVM_GROUP, 1290 - LARI_CONFIG_CHANGE), 1291 - 1); 1282 + 1292 1283 switch (cmd_ver) { 1284 + case 8: 1293 1285 case 7: 1294 1286 cmd_size = sizeof(struct iwl_lari_config_change_cmd_v7); 1295 1287 break;