summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h1
-rw-r--r--CORE/HDD/src/wlan_hdd_main.c23
2 files changed, 20 insertions, 4 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index ba12da36ab51..84f936bbc95f 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -2133,6 +2133,7 @@ struct hdd_context_s
#endif
/* flag to show whether moniotr mode is enabled */
bool is_mon_enable;
+ v_MACADDR_t hw_macaddr;
};
/*---------------------------------------------------------------------------
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 631f435377da..066046c4c891 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -9395,13 +9395,12 @@ void hdd_update_tgt_cfg(void *context, void *param)
if (!vos_is_macaddr_zero(&cfg->hw_macaddr))
{
- hdd_update_macaddr(hdd_ctx->cfg_ini, cfg->hw_macaddr);
+ vos_mem_copy(&hdd_ctx->hw_macaddr, &cfg->hw_macaddr,
+ VOS_MAC_ADDR_SIZE);
}
else {
hddLog(VOS_TRACE_LEVEL_ERROR,
- "%s: Invalid MAC passed from target, using MAC from ini file"
- MAC_ADDRESS_STR, __func__,
- MAC_ADDR_ARRAY(hdd_ctx->cfg_ini->intfMacAddr[0].bytes));
+ "%s: HW MAC is zero", __func__);
}
hdd_ctx->target_fw_version = cfg->target_fw_version;
@@ -16199,6 +16198,22 @@ static int hdd_initialize_mac_address(hdd_context_t *hdd_ctx)
WLAN_MAC_FILE, status);
return -EIO;
}
+ return 0;
+ }
+
+ if (!vos_is_macaddr_zero(&hdd_ctx->hw_macaddr)) {
+ hdd_update_macaddr(hdd_ctx->cfg_ini, hdd_ctx->hw_macaddr);
+ } else {
+ tSirMacAddr customMacAddr;
+
+ hddLog(VOS_TRACE_LEVEL_ERROR,
+ "%s: Invalid MAC passed from target, using MAC from ini"
+ MAC_ADDRESS_STR, __func__,
+ MAC_ADDR_ARRAY(hdd_ctx->cfg_ini->intfMacAddr[0].bytes));
+ vos_mem_copy(&customMacAddr,
+ &hdd_ctx->cfg_ini->intfMacAddr[0].bytes,
+ VOS_MAC_ADDR_SIZE);
+ sme_SetCustomMacAddr(customMacAddr);
}
return 0;
}