devices/r8169-2.6.32-ethercat.c
changeset 2589 2b9c78543663
parent 1973 4d6774893746
equal deleted inserted replaced
2415:af21f0bdc7c9 2589:2b9c78543663
  2702 	if (!(tp->phy_1000_ctrl_reg & ADVERTISE_1000FULL))
  2702 	if (!(tp->phy_1000_ctrl_reg & ADVERTISE_1000FULL))
  2703 		return;
  2703 		return;
  2704 
  2704 
  2705 	if (!tp->ecdev)
  2705 	if (!tp->ecdev)
  2706 		spin_lock_irq(&tp->lock);
  2706 		spin_lock_irq(&tp->lock);
  2707 	
  2707 
  2708 	if (tp->phy_reset_pending(ioaddr)) {
  2708 	if (tp->phy_reset_pending(ioaddr)) {
  2709 		/*
  2709 		/*
  2710 		 * A busy loop could burn quite a few cycles on nowadays CPU.
  2710 		 * A busy loop could burn quite a few cycles on nowadays CPU.
  2711 		 * Let's delay the execution of the timer for a few ticks.
  2711 		 * Let's delay the execution of the timer for a few ticks.
  2712 		 */
  2712 		 */
  3226 	 */
  3226 	 */
  3227 	if (tp->mac_version == RTL_GIGA_MAC_VER_05)
  3227 	if (tp->mac_version == RTL_GIGA_MAC_VER_05)
  3228 		RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | RxVlan);
  3228 		RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | RxVlan);
  3229 
  3229 
  3230 	device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
  3230 	device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
  3231 	if (tp->ecdev && ecdev_open(tp->ecdev)) {
  3231 
  3232 		ecdev_withdraw(tp->ecdev);
  3232 	if (tp->ecdev) {
  3233 		goto err_out_msi_5;
  3233 		rc = ecdev_open(tp->ecdev);
       
  3234 		if (rc) {
       
  3235 			ecdev_withdraw(tp->ecdev);
       
  3236 			goto err_out_msi_5;
       
  3237 		}
  3234 	}
  3238 	}
  3235 
  3239 
  3236 out:
  3240 out:
  3237 	return rc;
  3241 	return rc;
  3238 
  3242 
  3317 				dev->name, dev);
  3321 				dev->name, dev);
  3318 		if (retval < 0)
  3322 		if (retval < 0)
  3319 			goto err_release_ring_2;
  3323 			goto err_release_ring_2;
  3320 
  3324 
  3321 		napi_enable(&tp->napi);
  3325 		napi_enable(&tp->napi);
  3322  
       
  3323 	}
  3326 	}
  3324 
  3327 
  3325 	rtl_hw_start(dev);
  3328 	rtl_hw_start(dev);
  3326 
  3329 
  3327 	rtl8169_request_timer(dev);
  3330 	rtl8169_request_timer(dev);
  4763 
  4766 
  4764 	if (!tp->ecdev) {
  4767 	if (!tp->ecdev) {
  4765 		netif_stop_queue(dev);
  4768 		netif_stop_queue(dev);
  4766 
  4769 
  4767 		napi_disable(&tp->napi);
  4770 		napi_disable(&tp->napi);
  4768  
       
  4769 	}
  4771 	}
  4770 
  4772 
  4771 core_down:
  4773 core_down:
  4772 	if (!tp->ecdev)
  4774 	if (!tp->ecdev)
  4773 		spin_lock_irq(&tp->lock);
  4775 		spin_lock_irq(&tp->lock);
  4923 static int rtl8169_suspend(struct device *device)
  4925 static int rtl8169_suspend(struct device *device)
  4924 {
  4926 {
  4925 	struct pci_dev *pdev = to_pci_dev(device);
  4927 	struct pci_dev *pdev = to_pci_dev(device);
  4926 	struct net_device *dev = pci_get_drvdata(pdev);
  4928 	struct net_device *dev = pci_get_drvdata(pdev);
  4927 	struct rtl8169_private *tp = netdev_priv(dev);
  4929 	struct rtl8169_private *tp = netdev_priv(dev);
  4928 	
  4930 
  4929 	if (tp->ecdev)
  4931 	if (tp->ecdev)
  4930  		return -EBUSY;
  4932  		return -EBUSY;
  4931 
  4933 
  4932 	rtl8169_net_suspend(dev);
  4934 	rtl8169_net_suspend(dev);
  4933 
  4935