mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
qcacld-3.0: Validate hostapd country code
Hostapd is expected to use country code already programmed in the driver. Therefore, validate the country code sent by hostapd. Enable SAP 11d only if country code from hostapd is same as driver country code. Change-Id: I88d6603f4e696c86ffb85b798221d750f71b741b CRs-Fixed: 2359333
This commit is contained in:
parent
60ae163d3e
commit
05b103ff39
2 changed files with 8 additions and 40 deletions
|
|
@ -4875,19 +4875,16 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
|
|||
goto error;
|
||||
}
|
||||
|
||||
pConfig->ieee80211d = 1;
|
||||
qdf_mem_copy(pConfig->countryCode, &pIe[2], 3);
|
||||
status = ucfg_reg_set_country(hdd_ctx->pdev,
|
||||
pConfig->countryCode);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
hdd_err("Failed to set country");
|
||||
if (!qdf_mem_cmp(hdd_ctx->reg.alpha2, &pIe[2],
|
||||
REG_ALPHA2_LEN))
|
||||
pConfig->ieee80211d = 1;
|
||||
else
|
||||
pConfig->ieee80211d = 0;
|
||||
}
|
||||
} else {
|
||||
pConfig->countryCode[0] = hdd_ctx->reg.alpha2[0];
|
||||
pConfig->countryCode[1] = hdd_ctx->reg.alpha2[1];
|
||||
} else
|
||||
pConfig->ieee80211d = 0;
|
||||
}
|
||||
|
||||
pConfig->countryCode[0] = hdd_ctx->reg.alpha2[0];
|
||||
pConfig->countryCode[1] = hdd_ctx->reg.alpha2[1];
|
||||
|
||||
ret = wlan_hdd_sap_cfg_dfs_override(adapter);
|
||||
if (ret < 0)
|
||||
|
|
|
|||
|
|
@ -525,21 +525,6 @@ wlansap_set_scan_acs_channel_params(tsap_config_t *pconfig,
|
|||
QDF_TRACE_ERROR(QDF_MODULE_ID_SAP, "Invalid MAC context");
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
/*
|
||||
* If concurrent session is running that is already associated
|
||||
* then we just follow that sessions country info (whether
|
||||
* present or not doesn't matter as we have to follow whatever
|
||||
* STA session does)
|
||||
*/
|
||||
if ((0 == sme_get_concurrent_operation_channel(MAC_HANDLE(mac))) &&
|
||||
pconfig->ieee80211d) {
|
||||
/* Setting the region/country information */
|
||||
status = ucfg_reg_set_country(mac->pdev,
|
||||
pconfig->countryCode);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Failed to set country"));
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
@ -703,20 +688,6 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
/* If concurrent session is running that is already associated
|
||||
* then we just follow that sessions country info (whether
|
||||
* present or not doesn't matter as we have to follow whatever
|
||||
* STA session does) */
|
||||
if ((0 == sme_get_concurrent_operation_channel(MAC_HANDLE(pmac))) &&
|
||||
pConfig->ieee80211d) {
|
||||
/* Setting the region/country information */
|
||||
qdf_status = ucfg_reg_set_country(pmac->pdev,
|
||||
pConfig->countryCode);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Failed to set country"));
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the DFS Test Mode setting to pmac for
|
||||
* access in lower layers
|
||||
|
|
|
|||
Loading…
Reference in a new issue