devices/r8169-2.6.36-ethercat.c
changeset 2589 2b9c78543663
parent 2400 7c9c12c61104
equal deleted inserted replaced
2415:af21f0bdc7c9 2589:2b9c78543663
  2731 	if (!(tp->phy_1000_ctrl_reg & ADVERTISE_1000FULL))
  2731 	if (!(tp->phy_1000_ctrl_reg & ADVERTISE_1000FULL))
  2732 		return;
  2732 		return;
  2733 
  2733 
  2734 	if (!tp->ecdev)
  2734 	if (!tp->ecdev)
  2735 		spin_lock_irq(&tp->lock);
  2735 		spin_lock_irq(&tp->lock);
  2736 	
  2736 
  2737 	if (tp->phy_reset_pending(ioaddr)) {
  2737 	if (tp->phy_reset_pending(ioaddr)) {
  2738 		/*
  2738 		/*
  2739 		 * A busy loop could burn quite a few cycles on nowadays CPU.
  2739 		 * A busy loop could burn quite a few cycles on nowadays CPU.
  2740 		 * Let's delay the execution of the timer for a few ticks.
  2740 		 * Let's delay the execution of the timer for a few ticks.
  2741 		 */
  2741 		 */
  3237 	 */
  3237 	 */
  3238 	if (tp->mac_version == RTL_GIGA_MAC_VER_05)
  3238 	if (tp->mac_version == RTL_GIGA_MAC_VER_05)
  3239 		RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | RxVlan);
  3239 		RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | RxVlan);
  3240 
  3240 
  3241 	device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
  3241 	device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
  3242 	if (tp->ecdev && ecdev_open(tp->ecdev)) {
  3242 
  3243 		ecdev_withdraw(tp->ecdev);
  3243 	if (pci_dev_run_wake(pdev))
  3244 		goto err_out_msi_4;
  3244 		pm_runtime_put_noidle(&pdev->dev);
  3245 	}
  3245 
  3246 
  3246 	if (tp->ecdev) {
  3247 	if(!tp->ecdev) {
  3247 		rc = ecdev_open(tp->ecdev);
  3248 		if (pci_dev_run_wake(pdev))
  3248 		if (rc) {
  3249 			pm_runtime_put_noidle(&pdev->dev);
  3249 			ecdev_withdraw(tp->ecdev);
  3250 	}
  3250 			goto err_out_msi_4;
       
  3251 		}
       
  3252 	}
       
  3253 
  3251 out:
  3254 out:
  3252 	return rc;
  3255 	return rc;
  3253 
  3256 
  3254 err_out_msi_4:
  3257 err_out_msi_4:
  3255 	rtl_disable_msi(pdev, tp);
  3258 	rtl_disable_msi(pdev, tp);
  3352 				dev->name, dev);
  3355 				dev->name, dev);
  3353 		if (retval < 0)
  3356 		if (retval < 0)
  3354 			goto err_release_ring_2;
  3357 			goto err_release_ring_2;
  3355 
  3358 
  3356 		napi_enable(&tp->napi);
  3359 		napi_enable(&tp->napi);
  3357  
       
  3358 	}
  3360 	}
  3359 
  3361 
  3360 	rtl_hw_start(dev);
  3362 	rtl_hw_start(dev);
  3361 
  3363 
  3362 	rtl8169_request_timer(dev);
  3364 	rtl8169_request_timer(dev);
  4807 
  4809 
  4808 	if (!tp->ecdev) {
  4810 	if (!tp->ecdev) {
  4809 		netif_stop_queue(dev);
  4811 		netif_stop_queue(dev);
  4810 
  4812 
  4811 		napi_disable(&tp->napi);
  4813 		napi_disable(&tp->napi);
  4812  
       
  4813 	}
  4814 	}
  4814 
  4815 
  4815 core_down:
  4816 core_down:
  4816 	if (!tp->ecdev)
  4817 	if (!tp->ecdev)
  4817 		spin_lock_irq(&tp->lock);
  4818 		spin_lock_irq(&tp->lock);
  4968 static int rtl8169_suspend(struct device *device)
  4969 static int rtl8169_suspend(struct device *device)
  4969 {
  4970 {
  4970 	struct pci_dev *pdev = to_pci_dev(device);
  4971 	struct pci_dev *pdev = to_pci_dev(device);
  4971 	struct net_device *dev = pci_get_drvdata(pdev);
  4972 	struct net_device *dev = pci_get_drvdata(pdev);
  4972 	struct rtl8169_private *tp = netdev_priv(dev);
  4973 	struct rtl8169_private *tp = netdev_priv(dev);
  4973 	
  4974 
  4974 	if (tp->ecdev)
  4975 	if (tp->ecdev)
  4975  		return -EBUSY;
  4976  		return -EBUSY;
  4976 
  4977 
  4977 	rtl8169_net_suspend(dev);
  4978 	rtl8169_net_suspend(dev);
  4978 
  4979