qcacld-3.0: Fix the ndi set failure in case of non-random mac

Currently in host driver, for non-random mac addr, ndi mac addr
pointer is null, so, hdd_ndi_set_mode function returns error.

To fix this, dynamic mac address is updated for only randomized mac
in hdd_ndi_set_mode function. Thus, null pointer check is removed
and function does not return the error.

CRs-Fixed: 3243783
Change-Id: I27fff615ec66acfd86bd13449b79b0d36469803f
Cette révision appartient à :
Rahul Gusain
2022-07-14 17:25:50 +05:30
révisé par Madan Koyyalamudi
Parent e991a299ce
révision 5b5098762d

Voir le fichier

@@ -759,18 +759,12 @@ int hdd_ndi_set_mode(const char *iface_name)
return -EFAULT;
}
ndi_mac_addr = &random_ndi_mac.bytes[0];
hdd_update_dynamic_mac(hdd_ctx, &adapter->mac_addr,
(struct qdf_mac_addr *)ndi_mac_addr);
qdf_mem_copy(&adapter->mac_addr, ndi_mac_addr, ETH_ALEN);
qdf_mem_copy(adapter->dev->dev_addr, ndi_mac_addr, ETH_ALEN);
}
if (!ndi_mac_addr) {
hdd_err("ndi mac address is null");
return -EINVAL;
}
hdd_update_dynamic_mac(hdd_ctx, &adapter->mac_addr,
(struct qdf_mac_addr *)ndi_mac_addr);
qdf_mem_copy(&adapter->mac_addr, ndi_mac_addr, ETH_ALEN);
qdf_mem_copy(adapter->dev->dev_addr, ndi_mac_addr, ETH_ALEN);
adapter->device_mode = QDF_NDI_MODE;
hdd_debug("Created NDI with device mode:%d and iface_name:%s",
adapter->device_mode, iface_name);