wifi打开重启概率性sdio失败

diff --git a/wifi/wifi.c b/wifi/wifi.c 
old mode 100755 
new mode 100644 
index 4dcadb4..72f207c 
--- a/wifi/wifi.c 
+++ b/wifi/wifi.c 
@@ -83,10 +83,10 @@ static char primary_iface[PROPERTY_VALUE_MAX]; 
#elif defined RTL_8723BS_WIFI_USED 
/* rtl8723BS sdio+bt wifi */ 
#ifndef WIFI_DRIVER_MODULE_PATH 
- #define WIFI_DRIVER_MODULE_PATH "/system/vendor/modules/8723bs.ko" 
+ #define WIFI_DRIVER_MODULE_PATH "/system/vendor/modules/8723bs-vq0.ko" 
#endif 
#ifndef WIFI_DRIVER_MODULE_NAME 
- #define WIFI_DRIVER_MODULE_NAME "8723bs" 
+ #define WIFI_DRIVER_MODULE_NAME "8723bs_vq0" 
#endif 
#ifndef WIFI_DRIVER_MODULE_ARG 
#define WIFI_DRIVER_MODULE_ARG "ifname=wlan0 if2name=p2p0" 
@@ -268,7 +268,7 @@ int is_wifi_driver_loaded() { 
#endif 


-#define TIME_COUNT 20 // 200ms*20 = 4 seconds for completion 
+#define TIME_COUNT 100 // 200ms*20 = 4 seconds for completion 
#if defined(RTL_WIFI_VENDOR) 
int wifi_load_driver() 

@@ -282,11 +282,17 @@ int wifi_load_driver() 
FILE *fp = NULL; 

ALOGD("Start to insmod %s.ko\n", WIFI_DRIVER_MODULE_NAME); 

+ //usleep(20000);// 20ms 
if (insmod(DRIVER_MODULE_PATH, DRIVER_MODULE_ARG) < 0) { 
ALOGE("insmod %s ko failed!", WIFI_DRIVER_MODULE_NAME); 
rmmod(DRIVER_MODULE_NAME); //it may be load driver already,try remove it. 
- return -1; 
+ usleep(20000);// 20ms 
+ if (insmod(DRIVER_MODULE_PATH, DRIVER_MODULE_ARG) < 0) { 
+ ALOGE("insmod %s ko second failed!", WIFI_DRIVER_MODULE_NAME); 
+ rmmod(DRIVER_MODULE_NAME); //it may be load driver already,try remove it. 
+ return -1; 
+ } 
+ //return -1; 


do{ 
@@ -311,9 +317,23 @@ int wifi_load_driver() 
break; 

usleep(200000);// 200ms 
+ if(count==20) 
+ { 
+ ALOGE("count=20, register netdevice wlan0 failed.insmod 8723bs-vq0.ko again one"); 
+ rmmod(DRIVER_MODULE_NAME); 
+ usleep(10000); 
+ insmod(DRIVER_MODULE_PATH, DRIVER_MODULE_ARG); 
+ } 
+ if(count==80) 
+ { 
+ ALOGE("count=80, register netdevice wlan0 failed.insmod 8723bs-vq0.ko again two"); 
+ rmmod(DRIVER_MODULE_NAME); 
+ usleep(10000); 
+ insmod(DRIVER_MODULE_PATH, DRIVER_MODULE_ARG); 
+ } 

} while (count++ <= TIME_COUNT); 


if(count > TIME_COUNT) { 
ALOGE("timeout, register netdevice wlan0 failed."); 
property_set(DRIVER_PROP_NAME, "timeout");

你可能感兴趣的:(android驱动)