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");
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值