Преглед на файлове

qcacld-3.0: Populate the remaining addresses from tha wlan_mac.bin address

Currently if only one address is provided in wlan_mac.bin, it is updated
for interface wlan0. It will be copied to interface p2p0 if a specific
configuration is present. softap0 retains its mac address either generated
from serial number or given through Firmware ready event. This doesn't
guarentee a unique mac address to both these interfaces.
Regardless of configuration Both softap0 and p2p0 should have a unique
mac address with locally administered bit set.

Change-Id: I64299f5c2e2376c8dbdb26ea34ba0187d5d1f28d
CRs-Fixed: 2066086
Nachiket Kukade преди 7 години
родител
ревизия
e4d8644dac
променени са 3 файла, в които са добавени 6 реда и са изтрити 1 реда
  1. 1 0
      core/hdd/inc/wlan_hdd_main.h
  2. 4 0
      core/hdd/src/wlan_hdd_cfg.c
  3. 1 1
      core/hdd/src/wlan_hdd_main.c

+ 1 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -2226,6 +2226,7 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
 			   bool reinit);
 int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool ftm_mode);
 int hdd_start_adapter(hdd_adapter_t *adapter);
+void hdd_populate_random_mac_addr(hdd_context_t *hdd_ctx, uint32_t num);
 
 /**
  * hdd_get_bss_entry() - Get the bss entry matching the chan, bssid and ssid

+ 4 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -6154,6 +6154,7 @@ QDF_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx)
 	char *line, *buffer = NULL;
 	char *temp = NULL;
 	char *name, *value;
+	int max_mac_addr = QDF_MAX_CONCURRENCY_PERSONA;
 	tCfgIniEntry macTable[QDF_MAX_CONCURRENCY_PERSONA];
 	tSirMacAddr customMacAddr;
 
@@ -6229,6 +6230,9 @@ QDF_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx)
 	}
 
 	update_mac_from_string(pHddCtx, &macTable[0], i);
+	hdd_debug("Populating remaining %d Mac addreses",
+		   max_mac_addr - i);
+	hdd_populate_random_mac_addr(pHddCtx, max_mac_addr - i);
 
 	qdf_mem_copy(&customMacAddr,
 		     &pHddCtx->config->intfMacAddr[0].bytes[0],

+ 1 - 1
core/hdd/src/wlan_hdd_main.c

@@ -8453,7 +8453,7 @@ static uint8_t *hdd_get_platform_wlan_mac_buff(struct device *dev,
  *
  * Return: None
  */
-static void hdd_populate_random_mac_addr(hdd_context_t *hdd_ctx, uint32_t num)
+void hdd_populate_random_mac_addr(hdd_context_t *hdd_ctx, uint32_t num)
 {
 	uint32_t start_idx = QDF_MAX_CONCURRENCY_PERSONA - num;
 	uint32_t iter;