void r871x_dev_unload(_adapter *padapter) { struct net_device *pnetdev = (struct net_device*)padapter->pnetdev; RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("+r871x_dev_unload\n")); if (padapter->bup == _TRUE) { #if 0 //s1. if (pnetdev) { netif_carrier_off(pnetdev); netif_stop_queue(pnetdev); } RT_TRACE(_module_hci_intfs_c_,_drv_err_,("@ r871x_dev_unload:complelte s1!\n")); //s2. // indicate-disconnect if necssary (free all assoc-resources) // dis-assoc from assoc_sta (optional) rtw_indicate_disconnect(padapter); rtw_free_network_queue(padapter,_TRUE); #endif padapter->bDriverStopped = _TRUE; RT_TRACE(_module_hci_intfs_c_,_drv_err_,("@ r871x_dev_unload:complete s2!\n")); //s3. rtl871x_intf_stop(padapter); RT_TRACE(_module_hci_intfs_c_,_drv_err_,("@ r871x_dev_unload:complete s3!\n")); //s4. rtw_stop_drv_threads(padapter); RT_TRACE(_module_hci_intfs_c_,_drv_err_,("@ r871x_dev_unload:complete s4!\n")); //s5. if (padapter->bSurpriseRemoved == _FALSE) { rtl871x_hal_deinit(padapter); padapter->bSurpriseRemoved = _TRUE; } RT_TRACE(_module_hci_intfs_c_,_drv_err_,("@ r871x_dev_unload:complelt s5!\n")); //s6. if (padapter->dvobj_deinit) { padapter->dvobj_deinit(padapter); // call sd_dvobj_deinit() } else { RT_TRACE(_module_hci_intfs_c_,_drv_err_,("Initialize hcipriv.hci_priv_init error!!!\n")); } RT_TRACE(_module_hci_intfs_c_,_drv_err_,("@ r871x_dev_unload:complete s6!\n")); padapter->bup = _FALSE; } else { RT_TRACE(_module_hci_intfs_c_,_drv_err_,("r871x_dev_unload():padapter->bup == _FALSE\n" )); } RT_TRACE(_module_hci_intfs_c_,_drv_err_,("-r871x_dev_unload\n")); }
static int r871x_suspend(struct usb_interface *pusb_intf, pm_message_t state) { struct net_device *pnetdev = usb_get_intfdata(pusb_intf); struct _adapter *padapter = netdev_priv(pnetdev); netdev_info(pnetdev, "Suspending...\n"); if (!pnetdev || !netif_running(pnetdev)) { netdev_info(pnetdev, "Unable to suspend\n"); return 0; } padapter->bSuspended = true; rtl871x_intf_stop(padapter); if (pnetdev->netdev_ops->ndo_stop) pnetdev->netdev_ops->ndo_stop(pnetdev); mdelay(10); netif_device_detach(pnetdev); return 0; }
void pnp_sleep_wk(void *context) { _irqL irqL; _adapter *padapter = (_adapter *)context; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct pwrctrl_priv *pwrctrl = &padapter->pwrctrlpriv; _enter_critical(&pmlmepriv->lock, &irqL ); if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) { indicate_disconnect(padapter); //will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not } _exit_critical(&pmlmepriv->lock, &irqL ); RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("\npnp_sleep_wk:fwstate:%d\n", pmlmepriv->fw_state)); pwrctrl->pnp_bstop_trx=_TRUE; //delay 1 second then cancel IRP //msleep_os(1000); //cancel irp // 1. tx/rx irp // 2.int irp // 3.reg read/write irp rtl871x_intf_stop(padapter); msleep_os(1000); //Turn off LDO rtl871x_hal_deinit(padapter); padapter->hw_init_completed = _FALSE; NdisMSetInformationComplete(padapter->hndis_adapter, NDIS_STATUS_SUCCESS); }
void r871x_dev_unload(struct _adapter *padapter) { if (padapter->bup) { /*s1.*/ padapter->bDriverStopped = true; /*s3.*/ rtl871x_intf_stop(padapter); /*s4.*/ r8712_stop_drv_threads(padapter); /*s5.*/ if (!padapter->bSurpriseRemoved) { padapter->hw_init_completed = false; rtl8712_hal_deinit(padapter); } /*s6.*/ if (padapter->dvobj_deinit) padapter->dvobj_deinit(padapter); padapter->bup = false; } }
void r871x_dev_unload(struct _adapter *padapter) { if (padapter->bup == true) { padapter->bDriverStopped = true; rtl871x_intf_stop(padapter); r8712_stop_drv_threads(padapter); if (padapter->bSurpriseRemoved == false) { padapter->hw_init_completed = false; rtl8712_hal_deinit(padapter); } if (padapter->dvobj_deinit) padapter->dvobj_deinit(padapter); padapter->bup = false; } }