1.WiFi启动优化

This commit is contained in:
payton 2024-02-01 13:49:29 +08:00
parent 0c2cd94819
commit 3c244b24ea
2 changed files with 58 additions and 12 deletions

View File

@ -977,4 +977,5 @@ void appSvrResponseSocketSet(SINT32 socket);
SINT32 appSvrResponseSocketGet(void); SINT32 appSvrResponseSocketGet(void);
void sf_set_phone_shot_status(const PHONE_SHOT_E status); void sf_set_phone_shot_status(const PHONE_SHOT_E status);
const PHONE_SHOT_E sf_get_phone_shot_status(void); const PHONE_SHOT_E sf_get_phone_shot_status(void);
int sf_load_wifi_ko(void);
#endif /*__SF_WIFI_SERVER__*/ #endif /*__SF_WIFI_SERVER__*/

View File

@ -2857,18 +2857,18 @@ void sf_wifi_hw_init(void)
{ {
ret = system("modprobe 8189fs"); ret = system("modprobe 8189fs");
} }
else // else
{ // {
ret = system("modprobe 8723du"); // ret = system("modprobe 8723du");
if(ret == 0) // if(ret == 0)
{ // {
printf("Wifi modprobe OK\r\n"); // printf("Wifi modprobe OK\r\n");
} // }
else // else
{ // {
printf("Wifi modprobe ERR\r\n"); // 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) if(ret == 0)
@ -3055,3 +3055,48 @@ void sf_wifi_app_start(void)
pthread_create(&tid,NULL,(void*)sf_wifi_sevrer_init,(void *)NULL); pthread_create(&tid,NULL,(void*)sf_wifi_sevrer_init,(void *)NULL);
} }
BOOL sf_system_check_wifi_ko(void)
{
char command[30] = "lsmod | grep 8723du";
FILE *fp = popen(command, "r");
char result[256];
fgets(result, sizeof(result), fp);
pclose(fp);
if (result[0] == '\0') {
MLOGI("rtk_btusb module is not loaded.\n");
return FALSE;
} else {
MLOGI("rtk_btusb module is loaded.\n");
return TRUE;
}
}
int sf_load_wifi_ko(void)
{
int ret = 0;
MLOGI("start.\n");
if (sf_system_check_wifi_ko() == TRUE)
{
return TRUE;
}
ret = system("insmod /lib/custom/lib/modules/4.19.91/kernel/net/wireless/cfg80211.ko");
if(ret == 0)
{
printf("Wifi cfg80211 OK\r\n");
}
else
{
printf("Wifi cfg80211 ERR\r\n");
}
ret = system("insmod /lib/custom/lib/modules/4.19.91/extra/net/rtl8723du/8723du.ko");
if(ret == 0)
{
printf("Wifi rtl8723du OK\r\n");
}
else
{
printf("Wifi rtl8723du ERR\r\n");
}
return ret;
}