summaryrefslogtreecommitdiff
path: root/platform/msm_shared/dev_tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'platform/msm_shared/dev_tree.c')
-rw-r--r--platform/msm_shared/dev_tree.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/platform/msm_shared/dev_tree.c b/platform/msm_shared/dev_tree.c
index 52aa420e..0142c049 100644
--- a/platform/msm_shared/dev_tree.c
+++ b/platform/msm_shared/dev_tree.c
@@ -1220,7 +1220,7 @@ int dev_tree_add_mem_info(void *fdt, uint32_t offset, uint64_t addr, uint64_t si
/* Top level function that updates the device tree. */
int update_device_tree(void *fdt, const char *cmdline,
- void *ramdisk, uint32_t ramdisk_size)
+ void *ramdisk, uint32_t ramdisk_size, unsigned char* mac)
{
int ret = 0;
uint32_t offset;
@@ -1298,6 +1298,24 @@ int update_device_tree(void *fdt, const char *cmdline,
}
}
+ /* make sure local-mac-address is set for WCN device */
+ offset = fdt_node_offset_by_compatible(fdt, -1, "qcom,wcnss-wlan");
+
+ if (mac != NULL && offset != -FDT_ERR_NOTFOUND)
+ {
+ if (fdt_getprop(fdt, offset, "local-mac-address", NULL) == NULL)
+ {
+ dprintf(INFO, "Setting mac address in DT: %x:%x:%x:%x:%x:%x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ ret = fdt_setprop(fdt, offset, "local-mac-address", mac, 6);
+ if (ret)
+ {
+ dprintf(CRITICAL, "ERROR: cannot set local-mac-address\n");
+ return ret;
+ }
+ }
+ }
+
fdt_pack(fdt);
return ret;