Send frame to debug-if and debug-ring only when transmitted
authorFlorian Pose <fp@igh-essen.com>
Mon, 17 Sep 2007 10:24:13 +0000
changeset 725 8bacb27f3aa2
parent 724 f188f8a0cafd
child 726 5e230b4fe1a0
Send frame to debug-if and debug-ring only when transmitted
successfully.
master/device.c
--- a/master/device.c	Mon Sep 17 09:08:49 2007 +0000
+++ b/master/device.c	Mon Sep 17 10:24:13 2007 +0000
@@ -288,17 +288,17 @@
         ec_print_data(skb->data + ETH_HLEN, size);
     }
 
-#ifdef EC_DEBUG_IF
-    ec_debug_send(&device->dbg, skb->data, ETH_HLEN + size);
-#endif
-#ifdef EC_DEBUG_RING
-    ec_device_debug_ring_append(
-            device, TX, skb->data + ETH_HLEN, size);
-#endif
-
     // start sending
-    device->dev->hard_start_xmit(skb, device->dev);
-    device->tx_count++;
+    if (device->dev->hard_start_xmit(skb, device->dev) == NETDEV_TX_OK) {
+		device->tx_count++;
+#ifdef EC_DEBUG_IF
+		ec_debug_send(&device->dbg, skb->data, ETH_HLEN + size);
+#endif
+#ifdef EC_DEBUG_RING
+		ec_device_debug_ring_append(
+				device, TX, skb->data + ETH_HLEN, size);
+#endif
+	}
 }
 
 /*****************************************************************************/