Ejemplo n.º 1
0
static int __init rtw_drv_entry(void)
{
	int ret = 0;

/*depends on sunxi power control */
#if defined CONFIG_MMC_SUNXI_POWER_CONTROL
    unsigned int mod_sel = mmc_pm_get_mod_type();
	if(mod_sel == SUNXI_SDIO_WIFI_NUM_RTL8189ES) {
		rtl8189es_sdio_powerup();
  		sunximmc_rescan_card(SDIOID, 1);
		printk("[rtl8189es] %s: power up, rescan card.\n", __FUNCTION__);  		
	} else {
		ret = -1;
		printk("[rtl8189es] %s: mod_sel = %d is incorrect.\n", __FUNCTION__, mod_sel);
	}
#endif
	if(ret != 0)
		goto exit;

//	DBG_871X(KERN_INFO "+%s", __func__);
	RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("+rtw_drv_entry\n"));
	DBG_871X(KERN_NOTICE DRV_NAME " driver version " DRIVERVERSION "\n");
	
	rtw_suspend_lock_init();

#if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT)
	//init global variable
	_rtw_mutex_init(&drvpriv.h2c_fwcmd_mutex);
	_rtw_mutex_init(&drvpriv.setch_mutex);
	_rtw_mutex_init(&drvpriv.setbw_mutex);
	_rtw_mutex_init(&drvpriv.hw_init_mutex);
#endif
	
	drvpriv.drv_registered = _TRUE;

	ret = sdio_register_driver(&drvpriv.r871xs_drv);

exit:
//	DBG_871X(KERN_INFO "-%s: ret=%d", __func__, ret);
	RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("-rtw_drv_entry: ret=%d\n", ret));

	return ret;
}
Ejemplo n.º 2
0
/*
 * Return:
 *	0:	power on successfully
 *	others:	power on failed
 */
int platform_wifi_power_on(void)
{
	int ret = 0;
#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL
	unsigned int mod_sel = mmc_pm_get_mod_type();
#endif // CONFIG_MMC_SUNXI_POWER_CONTROL


#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL
	if (mod_sel == SUNXI_SDIO_WIFI_NUM_RTL8189ES) {
		rtl8189es_sdio_powerup();
		sunximmc_rescan_card(SDIOID, 1);
		printk("[rtl8189es] %s: power up, rescan card.\n", __FUNCTION__);
	} else {
		ret = -1;
		printk("[rtl8189es] %s: mod_sel = %d is incorrect.\n", __FUNCTION__, mod_sel);
	}
#endif // CONFIG_MMC_SUNXI_POWER_CONTROL

	return ret;
}