1.wifi调整

This commit is contained in:
payton 2024-01-26 18:27:41 +08:00
parent fa05807b6a
commit f2f339a952

View File

@ -2847,6 +2847,7 @@ void sf_wifi_hw_init(void)
char sSSID[128]= {0}; char sSSID[128]= {0};
MLOGI("[%s:%d] s\n", __FUNCTION__, __LINE__); MLOGI("[%s:%d] s\n", __FUNCTION__, __LINE__);
unsigned char wifitype = sf_get_wifi_type(); unsigned char wifitype = sf_get_wifi_type();
int cnt = 0;
//ret = system("modprobe cfg80211"); //ret = system("modprobe cfg80211");
if((WIFI_TYPE_8723DU == wifitype) || (WIFI_TYPE_8723DS == wifitype) || (WIFI_TYPE_8189FS == wifitype)) if((WIFI_TYPE_8723DU == wifitype) || (WIFI_TYPE_8723DS == wifitype) || (WIFI_TYPE_8189FS == wifitype))
@ -2859,11 +2860,52 @@ void sf_wifi_hw_init(void)
else else
{ {
ret = system("modprobe 8723du"); ret = system("modprobe 8723du");
if(ret == 0)
{
printf("Wifi modprobe OK\r\n");
}
else
{
printf("Wifi modprobe ERR\r\n");
}
} }
//sleep(2); //sleep(2);
ret = system("ifconfig lo 127.0.0.1"); 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("ifconfig ap0 192.168.1.1 netmask 255.255.255.0 up");
// ret = system("hostapd -ddd /etc/hostapd/hostapd.conf &"); // ret = system("hostapd -ddd /etc/hostapd/hostapd.conf &");
if (puiPara->strSSID[0] == 0) if (puiPara->strSSID[0] == 0)