Skip to content

Commit 48443a4

Browse files
panjaneyjmberg-intel
authored andcommitted
wifi: iwlwifi: Add support for LARI_CONFIG_CHANGE_CMD v11
Add support for enable/disable 11be for china and South Korea by reading DSM function 12 from UEFI or ACPI and sending it to the FW. Signed-off-by: Anjaneyulu <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20240512152312.037613d03c87.I4e5ee63c0dbdd4bd6c48daee7b0c88462b702423@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 6584b9d commit 48443a4

File tree

4 files changed

+65
-6
lines changed

4 files changed

+65
-6
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static const size_t acpi_dsm_size[DSM_FUNC_NUM_FUNCS] = {
2727
[DSM_FUNC_FORCE_DISABLE_CHANNELS] = sizeof(u32),
2828
[DSM_FUNC_ENERGY_DETECTION_THRESHOLD] = sizeof(u32),
2929
[DSM_FUNC_RFI_CONFIG] = sizeof(u32),
30+
[DSM_FUNC_ENABLE_11BE] = sizeof(u32),
3031
};
3132

3233
static int iwl_acpi_get_handle(struct device *dev, acpi_string method,

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

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ enum iwl_regulatory_and_nvm_subcmd_ids {
2323
* &struct iwl_lari_config_change_cmd_v4,
2424
* &struct iwl_lari_config_change_cmd_v5,
2525
* &struct iwl_lari_config_change_cmd_v6,
26-
* &struct iwl_lari_config_change_cmd_v7 or
26+
* &struct iwl_lari_config_change_cmd_v7,
27+
* &struct iwl_lari_config_change_cmd_v10 or
2728
* &struct iwl_lari_config_change_cmd
2829
*/
2930
LARI_CONFIG_CHANGE = 0x1,
@@ -648,7 +649,7 @@ struct iwl_lari_config_change_cmd_v7 {
648649
/* LARI_CHANGE_CONF_CMD_S_VER_9 */
649650

650651
/**
651-
* struct iwl_lari_config_change_cmd - change LARI configuration
652+
* struct iwl_lari_config_change_cmd_v10 - change LARI configuration
652653
* @config_bitmap: Bitmap of the config commands. Each bit will trigger a
653654
* different predefined FW config operation.
654655
* @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
@@ -674,7 +675,7 @@ struct iwl_lari_config_change_cmd_v7 {
674675
* bit1: enable 320Mhz in South Korea.
675676
* bit 2 - 31: reserved.
676677
*/
677-
struct iwl_lari_config_change_cmd {
678+
struct iwl_lari_config_change_cmd_v10 {
678679
__le32 config_bitmap;
679680
__le32 oem_uhb_allow_bitmap;
680681
__le32 oem_11ax_allow_bitmap;
@@ -686,6 +687,51 @@ struct iwl_lari_config_change_cmd {
686687
} __packed;
687688
/* LARI_CHANGE_CONF_CMD_S_VER_10 */
688689

690+
/**
691+
* struct iwl_lari_config_change_cmd - change LARI configuration
692+
* @config_bitmap: Bitmap of the config commands. Each bit will trigger a
693+
* different predefined FW config operation.
694+
* @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
695+
* @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
696+
* per country, one to indicate whether to override and the other to
697+
* indicate the value to use.
698+
* @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
699+
* per country, one to indicate whether to override and the other to
700+
* indicate allow/disallow unii4 channels.
701+
* For LARI cmd version 11 - bits 0:5 are supported.
702+
* @chan_state_active_bitmap: Bitmap to enable different bands per country
703+
* or region.
704+
* Each bit represents a country or region, and a band to activate
705+
* according to the BIOS definitions.
706+
* For LARI cmd version 11 - bits 0:4 are supported.
707+
* @force_disable_channels_bitmap: Bitmap of disabled bands/channels.
708+
* Each bit represents a set of channels in a specific band that should be
709+
* disabled
710+
* @edt_bitmap: Bitmap of energy detection threshold table.
711+
* Disable/enable the EDT optimization method for different band.
712+
* @oem_320mhz_allow_bitmap: 320Mhz bandwidth enablement bitmap per MCC.
713+
* bit0: enable 320Mhz in Japan.
714+
* bit1: enable 320Mhz in South Korea.
715+
* bit 2 - 31: reserved.
716+
* @oem_11be_allow_bitmap: Bitmap of 11be allowed MCCs. No need to mask out the
717+
* unsupported bits
718+
* bit0: enable 11be in China(CB/CN).
719+
* bit1: enable 11be in South Korea.
720+
* bit 2 - 31: reserved.
721+
*/
722+
struct iwl_lari_config_change_cmd {
723+
__le32 config_bitmap;
724+
__le32 oem_uhb_allow_bitmap;
725+
__le32 oem_11ax_allow_bitmap;
726+
__le32 oem_unii4_allow_bitmap;
727+
__le32 chan_state_active_bitmap;
728+
__le32 force_disable_channels_bitmap;
729+
__le32 edt_bitmap;
730+
__le32 oem_320mhz_allow_bitmap;
731+
__le32 oem_11be_allow_bitmap;
732+
} __packed;
733+
/* LARI_CHANGE_CONF_CMD_S_VER_11 */
734+
689735
/* Activate UNII-1 (5.2GHz) for World Wide */
690736
#define ACTIVATE_5G2_IN_WW_MASK BIT(4)
691737

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,12 @@ static size_t iwl_get_lari_config_cmd_size(u8 cmd_ver)
497497
size_t cmd_size;
498498

499499
switch (cmd_ver) {
500-
case 10:
500+
case 11:
501501
cmd_size = sizeof(struct iwl_lari_config_change_cmd);
502502
break;
503+
case 10:
504+
cmd_size = sizeof(struct iwl_lari_config_change_cmd_v10);
505+
break;
503506
case 9:
504507
case 8:
505508
case 7:
@@ -580,14 +583,19 @@ int iwl_fill_lari_config(struct iwl_fw_runtime *fwrt,
580583
if (!ret)
581584
cmd->oem_320mhz_allow_bitmap = cpu_to_le32(value);
582585

586+
ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_11BE, &value);
587+
if (!ret)
588+
cmd->oem_11be_allow_bitmap = cpu_to_le32(value);
589+
583590
if (cmd->config_bitmap ||
584591
cmd->oem_uhb_allow_bitmap ||
585592
cmd->oem_11ax_allow_bitmap ||
586593
cmd->oem_unii4_allow_bitmap ||
587594
cmd->chan_state_active_bitmap ||
588595
cmd->force_disable_channels_bitmap ||
589596
cmd->edt_bitmap ||
590-
cmd->oem_320mhz_allow_bitmap) {
597+
cmd->oem_320mhz_allow_bitmap ||
598+
cmd->oem_11be_allow_bitmap) {
591599
IWL_DEBUG_RADIO(fwrt,
592600
"sending LARI_CONFIG_CHANGE, config_bitmap=0x%x, oem_11ax_allow_bitmap=0x%x\n",
593601
le32_to_cpu(cmd->config_bitmap),
@@ -605,6 +613,9 @@ int iwl_fill_lari_config(struct iwl_fw_runtime *fwrt,
605613
"sending LARI_CONFIG_CHANGE, edt_bitmap=0x%x, oem_320mhz_allow_bitmap=0x%x\n",
606614
le32_to_cpu(cmd->edt_bitmap),
607615
le32_to_cpu(cmd->oem_320mhz_allow_bitmap));
616+
IWL_DEBUG_RADIO(fwrt,
617+
"sending LARI_CONFIG_CHANGE, oem_11be_allow_bitmap=0x%x\n",
618+
le32_to_cpu(cmd->oem_11be_allow_bitmap));
608619
} else {
609620
return 1;
610621
}

drivers/net/wireless/intel/iwlwifi/fw/regulatory.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ enum iwl_dsm_funcs {
115115
DSM_FUNC_FORCE_DISABLE_CHANNELS = 9,
116116
DSM_FUNC_ENERGY_DETECTION_THRESHOLD = 10,
117117
DSM_FUNC_RFI_CONFIG = 11,
118-
DSM_FUNC_NUM_FUNCS = 12,
118+
DSM_FUNC_ENABLE_11BE = 12,
119+
DSM_FUNC_NUM_FUNCS = 13,
119120
};
120121

121122
enum iwl_dsm_values_srd {

0 commit comments

Comments
 (0)