Beispiel #1
0
/* rmmod module & unplug(SurpriseRemoved) will call r871xu_dev_remove() => how to recognize both */
static void rtw_dev_remove(struct usb_interface *pusb_intf)
{
    struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
    struct adapter *padapter = dvobj->if1;


    DBG_88E("+rtw_dev_remove\n");
    RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("+dev_remove()\n"));

    if (!pusb_intf->unregistering)
        padapter->bSurpriseRemoved = true;

    rtw_pm_set_ips(padapter, IPS_NONE);
    rtw_pm_set_lps(padapter, PS_MODE_ACTIVE);

    LeaveAllPowerSaveMode(padapter);

    rtw_usb_if1_deinit(padapter);

    usb_dvobj_deinit(pusb_intf);

    RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("-dev_remove()\n"));
    DBG_88E("-r871xu_dev_remove, done\n");

    return;
}
Beispiel #2
0
void linked_info_dump(struct adapter *padapter, u8 benable)
{
	struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);

	if (padapter->bLinkInfoDump == benable)
		return;

	DBG_871X("%s %s\n", __func__, (benable) ? "enable" : "disable");

	if (benable) {
		pwrctrlpriv->org_power_mgnt = pwrctrlpriv->power_mgnt;/* keep org value */
		rtw_pm_set_lps(padapter, PS_MODE_ACTIVE);

		pwrctrlpriv->ips_org_mode = pwrctrlpriv->ips_mode;/* keep org value */
		rtw_pm_set_ips(padapter, IPS_NONE);
	} else {
		rtw_pm_set_ips(padapter, pwrctrlpriv->ips_org_mode);

		rtw_pm_set_lps(padapter, pwrctrlpriv->ips_org_mode);
	}
	padapter->bLinkInfoDump = benable;
}
static void rtw_gspi_if1_deinit(PADAPTER if1)
{
	struct net_device *pnetdev = if1->pnetdev;
	struct mlme_priv *pmlmepriv = &if1->mlmepriv;


#if defined(CONFIG_HAS_EARLYSUSPEND ) || defined(CONFIG_ANDROID_POWER)
	rtw_unregister_early_suspend(&if1->pwrctrlpriv);
#endif

	rtw_pm_set_ips(if1, IPS_NONE);
	rtw_pm_set_lps(if1, PS_MODE_ACTIVE);

	LeaveAllPowerSaveMode(if1);

	if (check_fwstate(pmlmepriv, _FW_LINKED))
		disconnect_hdl(if1, NULL);

#ifdef CONFIG_AP_MODE
	free_mlme_ap_info(if1);
	#ifdef CONFIG_HOSTAPD_MLME
	hostapd_mode_unload(if1);
#endif
#endif

	if(if1->DriverState != DRIVER_DISAPPEAR) {
		if(pnetdev) {
			unregister_netdev(pnetdev); //will call netdev_close()
			rtw_proc_remove_one(pnetdev);
				}
			}

	rtw_cancel_all_timer(if1);

	rtw_dev_unload(if1);
	DBG_871X("+r871xu_dev_remove, hw_init_completed=%d\n", if1->hw_init_completed);

	rtw_handle_dualmac(if1, 0);

#ifdef CONFIG_IOCTL_CFG80211
	rtw_wdev_free(if1->rtw_wdev);
#endif

	rtw_free_drv_sw(if1);

	if(pnetdev)
		rtw_free_netdev(pnetdev);
}
static int /*__devexit*/  rtw_dev_remove(struct spi_device *spi)
{
	struct dvobj_priv *dvobj = spi_get_drvdata(spi);
	PADAPTER padapter = dvobj->if1;

_func_enter_;

	RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("+rtw_dev_remove\n"));

	dvobj->processing_dev_remove = _TRUE;
	rtw_unregister_netdevs(dvobj);	

#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
	rtw_unregister_early_suspend(dvobj_to_pwrctl(dvobj));
#endif

	rtw_pm_set_ips(padapter, IPS_NONE);
	rtw_pm_set_lps(padapter, PS_MODE_ACTIVE);

	LeaveAllPowerSaveMode(padapter);

#ifdef CONFIG_CONCURRENT_MODE
	rtw_drv_if2_stop(dvobj->if2);
#endif

	rtw_gspi_if1_deinit(padapter);

#ifdef CONFIG_CONCURRENT_MODE
	rtw_drv_if2_free(dvobj->if2);
#endif

	gspi_dvobj_deinit(spi);

	RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("-rtw_dev_remove\n"));

_func_exit_;

	return 0;
}