From b16b4608c385b72bafe79b3ae8a9415fe337f9d1 Mon Sep 17 00:00:00 2001 From: Lincoln Tran Date: Tue, 9 Feb 2021 16:23:30 -0800 Subject: [PATCH] qcacmn: Fix reg rule parsing order Currently, reg rules are processed in the order of LPI, SP, VLP. The order from halphy is SP, LPI, VLP. Update the processing order so correct reg rules are passed north. Change-Id: I5bb22a1dcd3f1c95d8f4498b03d6cc6eedcfe44c CRs-fixed: 2874752 --- wmi/src/wmi_unified_tlv.c | 57 ++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 6ece3a610c..390fefb857 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -11937,7 +11937,7 @@ static QDF_STATUS extract_reg_chan_list_ext_update_event_tlv( wmi_unified_t wmi_handle, uint8_t *evt_buf, struct cur_regulatory_info *reg_info, uint32_t len) { - uint32_t i, j; + uint32_t i; WMI_REG_CHAN_LIST_CC_EXT_EVENTID_param_tlvs *param_buf; wmi_reg_chan_list_cc_event_ext_fixed_param *ext_chan_list_event_hdr; wmi_regulatory_rule_ext_struct *ext_wmi_reg_rule; @@ -12162,23 +12162,53 @@ static QDF_STATUS extract_reg_chan_list_ext_update_event_tlv( ext_wmi_reg_rule); ext_wmi_reg_rule += num_5g_reg_rules; - for (i = 0; i < REG_CURRENT_MAX_AP_TYPE; i++) { - reg_info->reg_rules_6g_ap_ptr[i] = - create_ext_reg_rules_from_wmi(num_6g_reg_rules_ap[i], + reg_info->reg_rules_6g_ap_ptr[REG_STANDARD_POWER_AP] = + create_ext_reg_rules_from_wmi(num_6g_reg_rules_ap + [REG_STANDARD_POWER_AP], ext_wmi_reg_rule); + ext_wmi_reg_rule += num_6g_reg_rules_ap[REG_STANDARD_POWER_AP]; - ext_wmi_reg_rule += num_6g_reg_rules_ap[i]; + reg_info->reg_rules_6g_ap_ptr[REG_INDOOR_AP] = + create_ext_reg_rules_from_wmi(num_6g_reg_rules_ap + [REG_INDOOR_AP], + ext_wmi_reg_rule); + ext_wmi_reg_rule += num_6g_reg_rules_ap[REG_INDOOR_AP]; + + reg_info->reg_rules_6g_ap_ptr[REG_VERY_LOW_POWER_AP] = + create_ext_reg_rules_from_wmi(num_6g_reg_rules_ap + [REG_VERY_LOW_POWER_AP], + ext_wmi_reg_rule); + ext_wmi_reg_rule += num_6g_reg_rules_ap[REG_VERY_LOW_POWER_AP]; + + for (i = 0; i < REG_MAX_CLIENT_TYPE; i++) { + reg_info->reg_rules_6g_client_ptr[REG_STANDARD_POWER_AP][i] = + create_ext_reg_rules_from_wmi( + num_6g_reg_rules_client + [REG_STANDARD_POWER_AP][i], + ext_wmi_reg_rule); + + ext_wmi_reg_rule += + num_6g_reg_rules_client[REG_STANDARD_POWER_AP][i]; } - for (j = 0; j < REG_CURRENT_MAX_AP_TYPE; j++) { - for (i = 0; i < REG_MAX_CLIENT_TYPE; i++) { - reg_info->reg_rules_6g_client_ptr[j][i] = - create_ext_reg_rules_from_wmi( - num_6g_reg_rules_client[j][i], - ext_wmi_reg_rule); + for (i = 0; i < REG_MAX_CLIENT_TYPE; i++) { + reg_info->reg_rules_6g_client_ptr[REG_INDOOR_AP][i] = + create_ext_reg_rules_from_wmi( + num_6g_reg_rules_client[REG_INDOOR_AP][i], + ext_wmi_reg_rule); - ext_wmi_reg_rule += num_6g_reg_rules_client[j][i]; - } + ext_wmi_reg_rule += num_6g_reg_rules_client[REG_INDOOR_AP][i]; + } + + for (i = 0; i < REG_MAX_CLIENT_TYPE; i++) { + reg_info->reg_rules_6g_client_ptr[REG_VERY_LOW_POWER_AP][i] = + create_ext_reg_rules_from_wmi( + num_6g_reg_rules_client + [REG_VERY_LOW_POWER_AP][i], + ext_wmi_reg_rule); + + ext_wmi_reg_rule += + num_6g_reg_rules_client[REG_VERY_LOW_POWER_AP][i]; } reg_info->client_type = ext_chan_list_event_hdr->client_type; @@ -12216,6 +12246,7 @@ static QDF_STATUS extract_reg_chan_list_ext_update_event_tlv( reg_info->domain_code_6g_super_id = ext_chan_list_event_hdr->domain_code_6g_super_id; + wmi_debug("super domain id %d", reg_info->domain_code_6g_super_id); wmi_debug("processed regulatory extended channel list"); return QDF_STATUS_SUCCESS;