devices/r8169-2.6.35-ethercat.c
changeset 2278 116355beeea5
parent 2277 ec3420474c5c
child 2582 87e502828b3f
equal deleted inserted replaced
2277:ec3420474c5c 2278:116355beeea5
  3212 	tp->timer.data = (unsigned long) dev;
  3212 	tp->timer.data = (unsigned long) dev;
  3213 	tp->timer.function = rtl8169_phy_timer;
  3213 	tp->timer.function = rtl8169_phy_timer;
  3214 
  3214 
  3215 	// offer device to EtherCAT master module
  3215 	// offer device to EtherCAT master module
  3216 	tp->ecdev = ecdev_offer(dev, ec_poll, THIS_MODULE);
  3216 	tp->ecdev = ecdev_offer(dev, ec_poll, THIS_MODULE);
       
  3217 	tp->ec_watchdog_jiffies = jiffies;
  3217 
  3218 
  3218 	if (!tp->ecdev) {
  3219 	if (!tp->ecdev) {
  3219 		rc = register_netdev(dev);
  3220 		rc = register_netdev(dev);
  3220 		if (rc < 0)
  3221 		if (rc < 0)
  3221 			goto err_out_msi_4;
  3222 			goto err_out_msi_4;
  3242 	if (pci_dev_run_wake(pdev)) {
  3243 	if (pci_dev_run_wake(pdev)) {
  3243 		pm_runtime_set_active(&pdev->dev);
  3244 		pm_runtime_set_active(&pdev->dev);
  3244 		pm_runtime_enable(&pdev->dev);
  3245 		pm_runtime_enable(&pdev->dev);
  3245 	}
  3246 	}
  3246 	pm_runtime_idle(&pdev->dev);
  3247 	pm_runtime_idle(&pdev->dev);
       
  3248 
       
  3249 	if (tp->ecdev && ecdev_open(tp->ecdev)) {
       
  3250 		ecdev_withdraw(tp->ecdev);
       
  3251 		goto err_out_msi_4;
       
  3252 	}
  3247 
  3253 
  3248 out:
  3254 out:
  3249 	return rc;
  3255 	return rc;
  3250 
  3256 
  3251 err_out_msi_4:
  3257 err_out_msi_4:
  4685 			rtl8169_asic_down(ioaddr);
  4691 			rtl8169_asic_down(ioaddr);
  4686 			break;
  4692 			break;
  4687 		}
  4693 		}
  4688 
  4694 
  4689 		/* Work around for rx fifo overflow */
  4695 		/* Work around for rx fifo overflow */
  4690 		if (unlikely(status & RxFIFOOver) &&
  4696 		if (unlikely(!tp->ecdev && (status & RxFIFOOver)) &&
  4691 		(tp->mac_version == RTL_GIGA_MAC_VER_11)) {
  4697 		(tp->mac_version == RTL_GIGA_MAC_VER_11)) {
  4692 			netif_stop_queue(dev);
  4698 			netif_stop_queue(dev);
  4693 			rtl8169_tx_timeout(dev);
  4699 			rtl8169_tx_timeout(dev);
  4694 			break;
  4700 			break;
  4695 		}
  4701 		}