[Feature][ZXW-280]WiFi for MAC is obtained from firmware and set
Only Configure :No
Affected branch: master
Affected module: wifi
Is it affected on both ZXIC and MTK:only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I580ed3a85aca7f1e403375aad4fb33e91d37076f
diff --git a/ap/app/zte_comm/wlan/src/wifi_ap_ctrl.c b/ap/app/zte_comm/wlan/src/wifi_ap_ctrl.c
index 1a14627..14f7110 100755
--- a/ap/app/zte_comm/wlan/src/wifi_ap_ctrl.c
+++ b/ap/app/zte_comm/wlan/src/wifi_ap_ctrl.c
@@ -1491,7 +1491,8 @@
}
}
}
-#if defined(__ESP_8089_CHIP__)
+//zw.wang WiFi for MAC is obtained from firmware and set on 20240508 start
+#if defined(CONFIG_WIFI_EFUSE_MAC)
int wifi_fw_mac_config_ssid(struct wlan_ap_server *ap_svr)
{
char ssid_write_flag[8] = {0};
@@ -1515,11 +1516,12 @@
sc_cfg_set("at_wifi_mac", fake_at_wifi_mac);
get_mac_config_ssid_key_nv();
- wlan_ap_get_para(ap_svr);
- wlan_ap_save_config(ap_svr);
+ //wlan_ap_get_para(ap_svr);
+ //wlan_ap_save_config(ap_svr);
}
return 0;
}
+//zw.wang WiFi for MAC is obtained from firmware and set on 20240508 end
#endif
#ifdef USE_CAP_SUPPORT
diff --git a/ap/app/zte_comm/wlan/src/wlan_config_ssid.c b/ap/app/zte_comm/wlan/src/wlan_config_ssid.c
index 0187a24..663203f 100755
--- a/ap/app/zte_comm/wlan/src/wlan_config_ssid.c
+++ b/ap/app/zte_comm/wlan/src/wlan_config_ssid.c
@@ -341,12 +341,18 @@
//snprintf(mac_cmd, sizeof(mac_cmd), "MAC_A1=%s\n", mac);
wf_log ("set_mac_conf:[%s]", mac_cmd);
wlan_write_file("/etc_rw/aic_macconfig.txt", mac_cmd);
-#elif defined(__ESP_8089_CHIP__)
+//zw.wang WiFi for MAC is obtained from firmware and set on 20240508 start
+#endif
+ return 0;
+}
+static int set_mac_at (char *mac, char *mac2)
+{
+#if defined(CONFIG_WIFI_EFUSE_MAC)
char mac_cmd[128]={0};
int ret = 0;
- snprintf(mac_cmd, sizeof(mac_cmd), "AT+MAC=%s\r", s_mac);//no :
- wf_log ("write mac:[%s]", s_mac);
+ snprintf(mac_cmd, sizeof(mac_cmd), "AT+MAC=%s\r", mac);//no :
+ wf_log ("write mac:[%s]", mac);
ret = get_modem_info(mac_cmd, NULL, NULL);
if (ret != 0) {
@@ -356,7 +362,7 @@
#endif
return 0;
}
-
+//zw.wang WiFi for MAC is obtained from firmware and set on 20240508 end
static VOID setWifiKeyForImei (CHAR* outkey, CHAR* imeistr, UINT32 num)
{
CHAR old_key[WLAN_NV_WPAPSK1_LENGTH] = {0};
@@ -546,6 +552,9 @@
make_user_mac (read_mac);
set_mac_conf(mac, m_mac);
+//zw.wang WiFi for MAC is obtained from firmware and set on 20240508 start
+ set_mac_at(read_mac, m_read_mac);
+//zw.wang WiFi for MAC is obtained from firmware and set on 20240508 end
}
diff --git a/ap/app/zte_comm/wlan/src/wlan_main.c b/ap/app/zte_comm/wlan/src/wlan_main.c
index aad2f8b..bd738d5 100755
--- a/ap/app/zte_comm/wlan/src/wlan_main.c
+++ b/ap/app/zte_comm/wlan/src/wlan_main.c
@@ -2049,7 +2049,7 @@
#endif
#endif
-#if !(defined(__ESP_8089_CHIP__))
+#if !(defined(CONFIG_WIFI_EFUSE_MAC)) //zw.wang WiFi for MAC is obtained from firmware and set on 20240508
send_get_mac_req();
#endif
@@ -2067,7 +2067,7 @@
init_config();
-#if !(defined(__ESP_8089_CHIP__))
+#if !(defined(CONFIG_WIFI_EFUSE_MAC)) //zw.wang WiFi for MAC is obtained from firmware and set on 20240508
get_mac_config_ssid_key_nv();
#endif
@@ -2114,7 +2114,7 @@
return -1;
}
-#if defined(__ESP_8089_CHIP__)
+#if defined(CONFIG_WIFI_EFUSE_MAC) //zw.wang WiFi for MAC is obtained from firmware and set on 20240508
wifi_fw_mac_config_ssid(ap_server);
#endif
diff --git a/ap/app/zte_mdl/Makefile b/ap/app/zte_mdl/Makefile
index 7cd997d..c7a1eac 100755
--- a/ap/app/zte_mdl/Makefile
+++ b/ap/app/zte_mdl/Makefile
@@ -72,6 +72,9 @@
CFLAGS += -D__QRCODE_WIFI__
CFLAGS += -D__USE_AES__
+# zw.wang WiFi for MAC is obtained from firmware and set on 20240508 start
+CFLAGS += -DCONFIG_WIFI_EFUSE_MAC
+# zw.wang WiFi for MAC is obtained from firmware and set on 20240508 end
ifeq ($(WLAN_STA_FUNC),yes)
CFLAGS += -D__STA_FUNC__