From 9683861d8978d5e0d7d7d55c69be52ff361b61e2 Mon Sep 17 00:00:00 2001 From: Santhosh Gillella Date: Tue, 19 Jun 2018 15:49:29 -0500 Subject: [PATCH] : Rework reading MAC address from UTAG In WLAN driver for Helium family, QC has updated hdd_context_t structure and removed intfMacAddr variable. As a result, with Motorola MAC address changes, compilation was failing. Replaced intfMacAddr with new provisioned and derived variables to read and use MAC address from UTAG properly. Updated the MOT OUI with latest MOT OUI values. Change-Id: I78e942aefc5b802e6297402c796d5d002b6d955a Reviewed-on: https://gerrit.mot.com/1196122 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth Chakravarthy Submit-Approved: Yun Ma --- core/hdd/src/wlan_hdd_cfg.c | 12 +++++++----- core/hdd/src/wlan_hdd_main.c | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 570ed019f625..b8d8277475ee 100755 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -120,8 +120,9 @@ QDF_STATUS hdd_update_mac_serial(struct hdd_context *hdd_ctx) qdf_status = QDF_STATUS_E_FAILURE; goto config_exit; } - qdf_mem_copy(&hdd_ctx->config->intfMacAddr[0].bytes[0], + qdf_mem_copy(&pHddCtx->derived_mac_addr[0].bytes, (uint8_t *)computedMac, QDF_MAC_ADDR_SIZE); + pHddCtx->num_derived_addr++; config_exit: qdf_mem_free(computedMac); @@ -140,9 +141,9 @@ QDF_STATUS hdd_generate_random_mac_from_serialno(char *serialNo, int serialnoLen hashBuf = (char*)qdf_mem_malloc(16); /*Motorola OUI*/ - macAddr[0] = 0xA4; - macAddr[1] = 0x07; - macAddr[2] = 0xd6; + macAddr[0] = 0x38; + macAddr[1] = 0x80; + macAddr[2] = 0xDF; md5 = crypto_alloc_shash("md5", 0, 0); if (IS_ERR(md5)) { @@ -581,8 +582,9 @@ QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx) macTable[0].name = "Intf0MacAddress"; macTable[0].value = &buffer_temp[0]; update_mac_from_string(hdd_ctx, &macTable[0], MACADDRESSUSED); + pHddCtx->num_provisioned_addr = MACADDRESSUSED; qdf_mem_copy(&customMacAddr, - &hdd_ctx->config->intfMacAddr[0].bytes[0], + &pHddCtx->provisioned_mac_addr[0].bytes[0], sizeof(tSirMacAddr)); sme_set_custom_mac_addr(customMacAddr); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 1576d18dfaad..50a8e44d98b3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -13862,7 +13862,7 @@ static int hdd_initialize_mac_address(struct hdd_context *hdd_ctx) status = hdd_update_mac_serial(hdd_ctx); if (QDF_IS_STATUS_SUCCESS(status)) - return; + return 0; #endif hdd_info("using default MAC address");