Commit 3ce88247 authored by Miri Korenblit's avatar Miri Korenblit Committed by Luca Coelho

iwlwifi:mvm: Add support for version 2 of the LARI_CONFIG_CHANGE command.

Add support for version 2 of the LARI_CONFIG_CHANGE command.
this is needed to support UHB enable/disable from BIOS
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210142629.8a0c951bfdea.I850f29d3ff3931388447bda635dfbc742ea1df61@changeidSigned-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent abc599ef
...@@ -415,14 +415,25 @@ enum iwl_lari_config_masks { ...@@ -415,14 +415,25 @@ enum iwl_lari_config_masks {
}; };
/** /**
* struct iwl_lari_config_change_cmd - change LARI configuration * struct iwl_lari_config_change_cmd_v1 - change LARI configuration
* @config_bitmap: bit map of the config commands. each bit will trigger a * @config_bitmap: bit map of the config commands. each bit will trigger a
* different predefined FW config operation * different predefined FW config operation
*/ */
struct iwl_lari_config_change_cmd { struct iwl_lari_config_change_cmd_v1 {
__le32 config_bitmap; __le32 config_bitmap;
} __packed; /* LARI_CHANGE_CONF_CMD_S_VER_1 */ } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_1 */
/**
* struct iwl_lari_config_change_cmd_v2 - change LARI configuration
* @config_bitmap: bit map of the config commands. each bit will trigger a
* different predefined FW config operation
* @oem_uhb_allow_bitmap: bitmap of UHB enabled MCC sets
*/
struct iwl_lari_config_change_cmd_v2 {
__le32 config_bitmap;
__le32 oem_uhb_allow_bitmap;
} __packed; /* LARI_CHANGE_CONF_CMD_S_VER_2 */
/** /**
* struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete * struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete
* @status: PNVM image loading status * @status: PNVM image loading status
......
...@@ -1196,7 +1196,7 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm) ...@@ -1196,7 +1196,7 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)
{ {
u8 ret; u8 ret;
int cmd_ret; int cmd_ret;
struct iwl_lari_config_change_cmd cmd = {}; struct iwl_lari_config_change_cmd_v2 cmd = {};
if (iwl_mvm_eval_dsm_indonesia_5g2(mvm) == DSM_VALUE_INDONESIA_ENABLE) if (iwl_mvm_eval_dsm_indonesia_5g2(mvm) == DSM_VALUE_INDONESIA_ENABLE)
cmd.config_bitmap |= cmd.config_bitmap |=
...@@ -1214,11 +1214,18 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm) ...@@ -1214,11 +1214,18 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)
/* apply more config masks here */ /* apply more config masks here */
if (cmd.config_bitmap) { if (cmd.config_bitmap) {
IWL_DEBUG_RADIO(mvm, "sending LARI_CONFIG_CHANGE\n"); size_t cmd_size = iwl_fw_lookup_cmd_ver(mvm->fw,
REGULATORY_AND_NVM_GROUP,
LARI_CONFIG_CHANGE, 1) == 2 ?
sizeof(struct iwl_lari_config_change_cmd_v2) :
sizeof(struct iwl_lari_config_change_cmd_v1);
IWL_DEBUG_RADIO(mvm,
"sending LARI_CONFIG_CHANGE, config_bitmap=0x%x\n",
le32_to_cpu(cmd.config_bitmap));
cmd_ret = iwl_mvm_send_cmd_pdu(mvm, cmd_ret = iwl_mvm_send_cmd_pdu(mvm,
WIDE_ID(REGULATORY_AND_NVM_GROUP, WIDE_ID(REGULATORY_AND_NVM_GROUP,
LARI_CONFIG_CHANGE), LARI_CONFIG_CHANGE),
0, sizeof(cmd), &cmd); 0, cmd_size, &cmd);
if (cmd_ret < 0) if (cmd_ret < 0)
IWL_DEBUG_RADIO(mvm, IWL_DEBUG_RADIO(mvm,
"Failed to send LARI_CONFIG_CHANGE (%d)\n", "Failed to send LARI_CONFIG_CHANGE (%d)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment