qcacld-3.0: Fix hdd_pre_enable_configure() layering violation

Currently hdd_pre_enable_configure() calls cfg_set_str() to update
WNI_CFG_STA_ID in the cfg database. Buf cfg_set_str() is an internal
MAC API which should not be called by HDD, and this code fails to
compile when strict parameter checking is enabled because HDD is
passing a tHalHandle to a function which expects a tpAniSirGlobal.
Update hdd_pre_enable_configure() to instead call sme_cfg_set_str().

Change-Id: Ic3f249f18319c3e54786938f76fe61b2af37f25f
CRs-Fixed: 2254950
This commit is contained in:
Jeff Johnson 2018-06-01 17:05:43 -07:00 • committed by nshrivas
commit bae59f9607

View file

@ -9768,7 +9768,6 @@ static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx)
{
int ret;
QDF_STATUS status;
tSirRetStatus hal_status;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
cdp_register_pause_cb(soc, wlan_hdd_txrx_pause_cb);
@ -9848,13 +9847,12 @@ static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx)
* Set the MAC Address Currently this is used by HAL to add self sta.
* Remove this once self sta is added as part of session open.
*/
hal_status = cfg_set_str(hdd_ctx->hHal, WNI_CFG_STA_ID,
hdd_ctx->config->intfMacAddr[0].bytes,
sizeof(hdd_ctx->config->intfMacAddr[0]));
status = sme_cfg_set_str(hdd_ctx->hHal, WNI_CFG_STA_ID,
hdd_ctx->config->intfMacAddr[0].bytes,
sizeof(hdd_ctx->config->intfMacAddr[0]));
if (!IS_SIR_STATUS_SUCCESS(hal_status)) {
hdd_err("Failed to set MAC Address. HALStatus is %08d [x%08x]",
hal_status, hal_status);
if (QDF_IS_STATUS_ERROR(status)) {
hdd_err("Failed to set MAC Address, status %d", status);
ret = -EINVAL;
goto out;
}