From f2f339a95236b138442b8f13925c39110fde9958 Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 26 Jan 2024 18:27:41 +0800 Subject: [PATCH] =?UTF-8?q?1.wifi=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sf_app/code/source/wifi/sf_wifi_svr.c | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c index 6da65a06a..b3e627c6a 100755 --- a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c +++ b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c @@ -2847,6 +2847,7 @@ void sf_wifi_hw_init(void) char sSSID[128]= {0}; MLOGI("[%s:%d] s\n", __FUNCTION__, __LINE__); unsigned char wifitype = sf_get_wifi_type(); + int cnt = 0; //ret = system("modprobe cfg80211"); if((WIFI_TYPE_8723DU == wifitype) || (WIFI_TYPE_8723DS == wifitype) || (WIFI_TYPE_8189FS == wifitype)) @@ -2859,11 +2860,52 @@ void sf_wifi_hw_init(void) else { ret = system("modprobe 8723du"); + if(ret == 0) + { + printf("Wifi modprobe OK\r\n"); + } + else + { + printf("Wifi modprobe ERR\r\n"); + } } //sleep(2); ret = system("ifconfig lo 127.0.0.1"); + if(ret == 0) + { + printf("Wifi ifconfig OK\r\n"); + } + else + { + printf("Wifi ifconfig ERR\r\n"); + } - sf_getb_mac(SF_WIFI_NETDEV_8189_NAME, smac); + ret = system("mdev -s"); + if(ret == 0) + { + printf("Wifi mdev OK\r\n"); + } + else + { + printf("Wifi mdev ERR\r\n"); + } + + WIFI_HW_RETRY: + ret = sf_getb_mac(SF_WIFI_NETDEV_8189_NAME, smac); + if(ret == 0) + { + printf("Wifi wlan0 OK\r\n"); + } + else + { + sleep(1); + cnt++; + if(cnt < 10) + { + goto WIFI_HW_RETRY; + } + printf("Wifi wlan0 ERR\r\n"); + } // ret = system("ifconfig ap0 192.168.1.1 netmask 255.255.255.0 up"); // ret = system("hostapd -ddd /etc/hostapd/hostapd.conf &"); if (puiPara->strSSID[0] == 0)