Beispiel #1
0
static int rtw_resume(struct usb_interface *pusb_intf)
{
	struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
	struct rtw_adapter *padapter = dvobj->if1;
	struct net_device *pnetdev;
	struct pwrctrl_priv *pwrpriv = NULL;
	int ret = -1;
	unsigned long start_time = jiffies;

	DBG_8723A("==> %s (%s:%d)\n", __func__, current->comm, current->pid);

	if (!padapter)
		goto exit;
	pnetdev = padapter->pnetdev;
	pwrpriv = &padapter->pwrctrlpriv;

	down(&pwrpriv->lock);
	rtw_reset_drv_sw23a(padapter);
	pwrpriv->bkeepfwalive = false;

	DBG_8723A("bkeepfwalive(%x)\n", pwrpriv->bkeepfwalive);
	if (pm_netdev_open23a(pnetdev, true) != 0) {
		up(&pwrpriv->lock);
		goto exit;
	}

	netif_device_attach(pnetdev);
	netif_carrier_on(pnetdev);

	up(&pwrpriv->lock);

	if (padapter->pid[1] != 0) {
		DBG_8723A("pid[1]:%d\n", padapter->pid[1]);
		kill_pid(find_vpid(padapter->pid[1]), SIGUSR2, 1);
	}

	rtw23a_roaming(padapter, NULL);

	ret = 0;
exit:
	if (pwrpriv)
		pwrpriv->bInSuspend = false;
	DBG_8723A("<===  %s return %d.............. in %dms\n", __func__,
		  ret, jiffies_to_msecs(jiffies - start_time));

	return ret;
}
Beispiel #2
0
int rtw_hw_resume23a(struct rtw_adapter *padapter)
{
	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
	struct net_device *pnetdev = padapter->pnetdev;

	if (padapter) { /* system resume */
		DBG_8723A("==> rtw_hw_resume23a\n");
		down(&pwrpriv->lock);
		pwrpriv->bips_processing = true;
		rtw_reset_drv_sw23a(padapter);

		if (pm_netdev_open23a(pnetdev, false)) {
			up(&pwrpriv->lock);
			goto error_exit;
		}

		netif_device_attach(pnetdev);
		netif_carrier_on(pnetdev);

		if (!rtw_netif_queue_stopped(pnetdev))
			netif_tx_start_all_queues(pnetdev);
		else
			netif_tx_wake_all_queues(pnetdev);

		pwrpriv->bkeepfwalive = false;

		pwrpriv->rf_pwrstate = rf_on;
		pwrpriv->bips_processing = false;

		up(&pwrpriv->lock);
	} else {
		goto error_exit;
	}
	return 0;
error_exit:
	DBG_8723A("%s, Open net dev failed\n", __func__);
	return -1;
}