Merged 8139too-2.6.32-ethercat.c from stable-1.5.
authorFlorian Pose <fp@igh-essen.com>
Mon, 09 Jan 2012 09:51:17 +0100
changeset 2205 a2fe325bb62c
parent 2195 d9146c0ff00f
child 2206 983aa34ca11d
Merged 8139too-2.6.32-ethercat.c from stable-1.5.
devices/8139too-2.6.32-ethercat.c
--- a/devices/8139too-2.6.32-ethercat.c	Thu Jan 05 16:53:08 2012 +0100
+++ b/devices/8139too-2.6.32-ethercat.c	Mon Jan 09 09:51:17 2012 +0100
@@ -1789,43 +1789,41 @@
 		if (len < ETH_ZLEN)
 			memset(tp->tx_buf[entry], 0, ETH_ZLEN);
 		skb_copy_and_csum_dev(skb, tp->tx_buf[entry]);
-		if (!tp->ecdev) dev_kfree_skb(skb);
+		if (!tp->ecdev) {
+			dev_kfree_skb(skb);
+		}
 	} else {
-		if (!tp->ecdev) dev_kfree_skb(skb);
+		if (!tp->ecdev) {
+			dev_kfree_skb(skb);
+		}
 		dev->stats.tx_dropped++;
 		return NETDEV_TX_OK;
 	}
 
-	if (tp->ecdev) {
-		wmb();
-		RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
-			tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
- 
-		dev->trans_start = jiffies;
- 
-		tp->cur_tx++;
-	} else {
+	if (!tp->ecdev) {
 		spin_lock_irqsave(&tp->lock, flags);
-		/*
-		 * Writing to TxStatus triggers a DMA transfer of the data
-		 * copied to tp->tx_buf[entry] above. Use a memory barrier
-		 * to make sure that the device sees the updated data.
-		 */
-		wmb();
-		RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
-			   tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
-
-		dev->trans_start = jiffies;
-
-		tp->cur_tx++;
-
+	}
+	/*
+	 * Writing to TxStatus triggers a DMA transfer of the data
+	 * copied to tp->tx_buf[entry] above. Use a memory barrier
+	 * to make sure that the device sees the updated data.
+	 */
+	wmb();
+	RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
+		   tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
+
+	dev->trans_start = jiffies;
+
+	tp->cur_tx++;
+
+	if (!tp->ecdev) {
 		if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx)
 			netif_stop_queue (dev);
 		spin_unlock_irqrestore(&tp->lock, flags);
 
 		if (netif_msg_tx_queued(tp))
 			pr_debug("%s: Queued Tx packet size %u to slot %d.\n",
-				dev->name, len, entry);
+					dev->name, len, entry);
 	}
 
 	return NETDEV_TX_OK;