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