devices/r8169-2.6.31-ethercat.c
changeset 2589 2b9c78543663
parent 1995 7d748d9cf9e8
equal deleted inserted replaced
2415:af21f0bdc7c9 2589:2b9c78543663
  2215 		       dev->dev_addr[4], dev->dev_addr[5], xid, dev->irq);
  2215 		       dev->dev_addr[4], dev->dev_addr[5], xid, dev->irq);
  2216 	}
  2216 	}
  2217 
  2217 
  2218 	rtl8169_init_phy(dev, tp);
  2218 	rtl8169_init_phy(dev, tp);
  2219 	device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
  2219 	device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
  2220 	if (tp->ecdev && ecdev_open(tp->ecdev)) {
  2220 
  2221 		ecdev_withdraw(tp->ecdev);
  2221 	if (tp->ecdev) {
  2222 		goto err_out_msi_5;
  2222 		rc = ecdev_open(tp->ecdev);
  2223 	}
  2223 		if (rc) {
  2224 
  2224 			ecdev_withdraw(tp->ecdev);
       
  2225 			goto err_out_msi_5;
       
  2226 		}
       
  2227 	}
  2225 
  2228 
  2226 out:
  2229 out:
  2227 	return rc;
  2230 	return rc;
  2228 
  2231 
  2229 err_out_msi_5:
  2232 err_out_msi_5:
  3908 static int rtl8169_suspend(struct device *device)
  3911 static int rtl8169_suspend(struct device *device)
  3909 {
  3912 {
  3910 	struct pci_dev *pdev = to_pci_dev(device);
  3913 	struct pci_dev *pdev = to_pci_dev(device);
  3911 	struct net_device *dev = pci_get_drvdata(pdev);
  3914 	struct net_device *dev = pci_get_drvdata(pdev);
  3912 	struct rtl8169_private *tp = netdev_priv(dev);
  3915 	struct rtl8169_private *tp = netdev_priv(dev);
  3913 	
  3916 
  3914 	if (tp->ecdev)
  3917 	if (tp->ecdev)
  3915  		return -EBUSY;
  3918  		return -EBUSY;
  3916 
  3919 
  3917 	rtl8169_net_suspend(dev);
  3920 	rtl8169_net_suspend(dev);
  3918 
  3921 
  3922 static int rtl8169_resume(struct device *device)
  3925 static int rtl8169_resume(struct device *device)
  3923 {
  3926 {
  3924 	struct pci_dev *pdev = to_pci_dev(device);
  3927 	struct pci_dev *pdev = to_pci_dev(device);
  3925 	struct net_device *dev = pci_get_drvdata(pdev);
  3928 	struct net_device *dev = pci_get_drvdata(pdev);
  3926 	struct rtl8169_private *tp = netdev_priv(dev);
  3929 	struct rtl8169_private *tp = netdev_priv(dev);
  3927  
  3930 
  3928 	if (tp->ecdev)
  3931 	if (tp->ecdev)
  3929 		return -EBUSY;
  3932 		return -EBUSY;
  3930 
  3933 
  3931 	if (!netif_running(dev))
  3934 	if (!netif_running(dev))
  3932 		goto out;
  3935 		goto out;