Example #1
0
int eu8188_load_driver()
{
    char mod_path[SYSFS_PATH_MAX];
    
    snprintf(mod_path, SYSFS_PATH_MAX, "%s/%s.ko",WIFI_DRIVER_MODULE_DIR,EU8188_DRIVER_KO2);
    wifi_insmod(mod_path, DRIVER_MODULE_ARG);

	snprintf(mod_path, SYSFS_PATH_MAX, "%s/%s.ko",WIFI_DRIVER_MODULE_DIR,EU8188_DRIVER_KO);
    if(wifi_insmod(mod_path, DRIVER_MODULE_ARG) !=0){
    	printf("failed to insmod EU8188_DRIVER_KO : \n");
    	wpa_printf(MSG_DEBUG, "%s: failed to insmod EU8188_DRIVER_KO \n", __func__);
    	return -1;
    }
    
    printf("SUCCESS to insmod rtl8188eu driver! \n");
    
    return 0;
}
Example #2
0
int META_WIFI_init(void)
{
    int count = 100;
	
    if(1 == wifi_init){
    	ERR("wifi is already initilized.\n");
    	return true;
    }
#if 0
    if (!wifi_is_loaded()){
        ERR("[META_WIFI] loading wifi driver ... ...\n");    	
        if (wifi_insmod(DRIVER_MODULE_PATH, DRIVER_MODULE_ARG) < 0) {
            ERR("[META_WIFI] failed to load wifi driver!!!\n");    	        	
            goto error;
        }
    }
#endif    
    usleep(200000); 
		
    wifi_set_power(1);


    sched_yield();
    
    while (count-- > 0) {
        if (ifc_init() == 0) {
            if (ifc_up("wlan0") == 0) {
                ifc_close();
                break;
            }
            ERR("[META_WIFI] ifc_up(wlan0) failed\n");
            ifc_close();
        } else {
            ERR("[META_WIFI] ifc_init() failed\n");
        }
        usleep(100000);
    }
    if (count == 0)
        goto error;

    if (wifi_skfd == -1)
        wifi_skfd = openNetHandle();

    if (wifi_skfd < 0) {
        META_WIFI_deinit();
        goto error;
    }

    wifi_init = 1;

    return true;

error:
    wifi_set_power(0);
    return false;
}