qcacld-3.0: Changes for 11d to not get disabled
Currently, the regulatory callback does not know whether the country setting is due to 11d or user-space. Therefore, even for 11d country setting, 11d gets disabled. Fix this by maintaining variable for country code setting. Change-Id: Icc5f636de7245a9c65df56374cf99fb9c5c15f5f CRs-Fixed: 1077498
This commit is contained in:
@@ -979,6 +979,7 @@ typedef struct sAniSirGlobal {
|
|||||||
enum auth_tx_ack_status auth_ack_status;
|
enum auth_tx_ack_status auth_ack_status;
|
||||||
uint8_t user_configured_nss;
|
uint8_t user_configured_nss;
|
||||||
bool sta_prefer_80MHz_over_160MHz;
|
bool sta_prefer_80MHz_over_160MHz;
|
||||||
|
bool is_11d_hint;
|
||||||
} tAniSirGlobal;
|
} tAniSirGlobal;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@@ -7838,24 +7838,19 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx,
|
|||||||
{
|
{
|
||||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||||
v_REGDOMAIN_t reg_domain_id = 0;
|
v_REGDOMAIN_t reg_domain_id = 0;
|
||||||
bool is_11d_country = false;
|
|
||||||
bool supplicant_priority =
|
bool supplicant_priority =
|
||||||
mac_ctx->roam.configParam.fSupplicantCountryCodeHasPriority;
|
mac_ctx->roam.configParam.fSupplicantCountryCodeHasPriority;
|
||||||
tAniGenericChangeCountryCodeReq *msg = pMsgBuf;
|
tAniGenericChangeCountryCodeReq *msg = pMsgBuf;
|
||||||
|
|
||||||
sms_log(mac_ctx, LOG1, FL(" called"));
|
sms_log(mac_ctx, LOG1, FL(" called"));
|
||||||
|
|
||||||
if (memcmp(msg->countryCode, mac_ctx->scan.countryCode11d,
|
|
||||||
CDS_COUNTRY_CODE_LEN) == 0) {
|
|
||||||
is_11d_country = true;
|
|
||||||
}
|
|
||||||
/* Set the country code given by userspace when 11dOriginal is false
|
/* Set the country code given by userspace when 11dOriginal is false
|
||||||
* when 11doriginal is True,is_11d_country =0 and
|
* when 11doriginal is True,is_11d_country =0 and
|
||||||
* fSupplicantCountryCodeHasPriority = 0, then revert the country code,
|
* fSupplicantCountryCodeHasPriority = 0, then revert the country code,
|
||||||
* and return failure
|
* and return failure
|
||||||
*/
|
*/
|
||||||
if (mac_ctx->roam.configParam.Is11dSupportEnabledOriginal == true
|
if (mac_ctx->roam.configParam.Is11dSupportEnabledOriginal == true
|
||||||
&& !is_11d_country && !supplicant_priority) {
|
&& !mac_ctx->is_11d_hint && !supplicant_priority) {
|
||||||
sms_log(mac_ctx, LOGW,
|
sms_log(mac_ctx, LOGW,
|
||||||
FL("Incorrect country req, nullify this"));
|
FL("Incorrect country req, nullify this"));
|
||||||
|
|
||||||
@@ -7879,37 +7874,14 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* if Supplicant country code has priority, disable 11d */
|
/* if Supplicant country code has priority, disable 11d */
|
||||||
if (!is_11d_country && supplicant_priority)
|
if (supplicant_priority && !mac_ctx->is_11d_hint)
|
||||||
mac_ctx->roam.configParam.Is11dSupportEnabled = false;
|
mac_ctx->roam.configParam.Is11dSupportEnabled = false;
|
||||||
|
|
||||||
|
qdf_mem_copy(mac_ctx->scan.countryCode11d, msg->countryCode,
|
||||||
|
WNI_CFG_COUNTRY_CODE_LEN);
|
||||||
qdf_mem_copy(mac_ctx->scan.countryCodeCurrent, msg->countryCode,
|
qdf_mem_copy(mac_ctx->scan.countryCodeCurrent, msg->countryCode,
|
||||||
WNI_CFG_COUNTRY_CODE_LEN);
|
WNI_CFG_COUNTRY_CODE_LEN);
|
||||||
status = wma_set_reg_domain(mac_ctx, reg_domain_id);
|
|
||||||
if (false == is_11d_country) {
|
|
||||||
/* overwrite the defualt country code */
|
|
||||||
qdf_mem_copy(mac_ctx->scan.countryCodeDefault,
|
|
||||||
mac_ctx->scan.countryCodeCurrent,
|
|
||||||
WNI_CFG_COUNTRY_CODE_LEN);
|
|
||||||
/* set to default domain ID */
|
|
||||||
mac_ctx->scan.domainIdDefault = mac_ctx->scan.domainIdCurrent;
|
|
||||||
}
|
|
||||||
if (status != QDF_STATUS_SUCCESS) {
|
|
||||||
sms_log(mac_ctx, LOGE, FL("fail to set regId %d"),
|
|
||||||
reg_domain_id);
|
|
||||||
return status;
|
|
||||||
} else {
|
|
||||||
/* if 11d has priority, clear currentCountryBssid &
|
|
||||||
* countryCode11d to get set again if we find AP with 11d info
|
|
||||||
* during scan
|
|
||||||
*/
|
|
||||||
if (!supplicant_priority && (false == is_11d_country)) {
|
|
||||||
sms_log(mac_ctx, LOGW,
|
|
||||||
FL("Clearing currentCountryBssid, countryCode11d"));
|
|
||||||
qdf_mem_zero(&mac_ctx->scan.currentCountryBssid,
|
|
||||||
sizeof(struct qdf_mac_addr));
|
|
||||||
qdf_mem_zero(mac_ctx->scan.countryCode11d,
|
|
||||||
sizeof(mac_ctx->scan.countryCode11d));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* get the channels based on new cc */
|
/* get the channels based on new cc */
|
||||||
status = csr_get_channel_and_power_list(mac_ctx);
|
status = csr_get_channel_and_power_list(mac_ctx);
|
||||||
|
|
||||||
@@ -7929,6 +7901,8 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx,
|
|||||||
* Country IE
|
* Country IE
|
||||||
*/
|
*/
|
||||||
mac_ctx->scan.curScanType = eSIR_ACTIVE_SCAN;
|
mac_ctx->scan.curScanType = eSIR_ACTIVE_SCAN;
|
||||||
|
mac_ctx->is_11d_hint = false;
|
||||||
|
|
||||||
sme_disconnect_connected_sessions(mac_ctx);
|
sme_disconnect_connected_sessions(mac_ctx);
|
||||||
sms_log(mac_ctx, LOG1, FL(" returned"));
|
sms_log(mac_ctx, LOG1, FL(" returned"));
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
|
@@ -3716,6 +3716,11 @@ bool csr_learn_11dcountry_information(tpAniSirGlobal pMac,
|
|||||||
else
|
else
|
||||||
pCountryCodeSelected = pMac->scan.countryCodeElected;
|
pCountryCodeSelected = pMac->scan.countryCodeElected;
|
||||||
|
|
||||||
|
if (qdf_mem_cmp(pCountryCodeSelected, pMac->scan.countryCode11d,
|
||||||
|
CDS_COUNTRY_CODE_LEN) == 0)
|
||||||
|
goto free_ie;
|
||||||
|
|
||||||
|
pMac->is_11d_hint = true;
|
||||||
status = csr_get_regulatory_domain_for_country(pMac,
|
status = csr_get_regulatory_domain_for_country(pMac,
|
||||||
pCountryCodeSelected, &domainId, SOURCE_11D);
|
pCountryCodeSelected, &domainId, SOURCE_11D);
|
||||||
if (status != QDF_STATUS_SUCCESS) {
|
if (status != QDF_STATUS_SUCCESS) {
|
||||||
|
Reference in New Issue
Block a user