devices/8139too-2.6.31-ethercat.c
changeset 2589 2b9c78543663
parent 1581 e51cf2af3ff9
equal deleted inserted replaced
2415:af21f0bdc7c9 2589:2b9c78543663
   645 	struct delayed_work	thread;
   645 	struct delayed_work	thread;
   646 
   646 
   647 	struct mii_if_info	mii;
   647 	struct mii_if_info	mii;
   648 	unsigned int		regs_len;
   648 	unsigned int		regs_len;
   649 	unsigned long		fifo_copy_timeout;
   649 	unsigned long		fifo_copy_timeout;
   650     
   650 
   651 	ec_device_t *ecdev;
   651 	ec_device_t *ecdev;
   652 };
   652 };
   653 
   653 
   654 MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
   654 MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>");
   655 MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
   655 MODULE_DESCRIPTION("RealTek RTL-8139 EtherCAT driver");
  1132 
  1132 
  1133 	/* Put the chip into low-power mode. */
  1133 	/* Put the chip into low-power mode. */
  1134 	if (rtl_chip_info[tp->chipset].flags & HasHltClk)
  1134 	if (rtl_chip_info[tp->chipset].flags & HasHltClk)
  1135 		RTL_W8 (HltClk, 'H');	/* 'R' would leave the clock running. */
  1135 		RTL_W8 (HltClk, 'H');	/* 'R' would leave the clock running. */
  1136 
  1136 
  1137 	if (tp->ecdev && ecdev_open(tp->ecdev)) {
  1137 	if (tp->ecdev) {
  1138 		ecdev_withdraw(tp->ecdev);
  1138 		i = ecdev_open(tp->ecdev);
  1139 		goto err_out;
  1139 		if (i) {
       
  1140 			ecdev_withdraw(tp->ecdev);
       
  1141 			goto err_out;
       
  1142 		}
  1140 	}
  1143 	}
  1141 
  1144 
  1142 	return 0;
  1145 	return 0;
  1143 
  1146 
  1144 err_out:
  1147 err_out:
  1797 
  1800 
  1798 	if (tp->ecdev) {
  1801 	if (tp->ecdev) {
  1799 		wmb();
  1802 		wmb();
  1800 		RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
  1803 		RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
  1801 			tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
  1804 			tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
  1802  
  1805 
  1803 		dev->trans_start = jiffies;
  1806 		dev->trans_start = jiffies;
  1804  
  1807 
  1805 		tp->cur_tx++;
  1808 		tp->cur_tx++;
  1806 	} else {
  1809 	} else {
  1807 		spin_lock_irqsave(&tp->lock, flags);
  1810 		spin_lock_irqsave(&tp->lock, flags);
  1808 		/*
  1811 		/*
  1809 		 * Writing to TxStatus triggers a DMA transfer of the data
  1812 		 * Writing to TxStatus triggers a DMA transfer of the data