# HG changeset patch
# User Florian Pose <fp@igh-essen.com>
# Date 1190024653 0
# Node ID 8bacb27f3aa2c27ca94e0244079d9c22494e424a
# Parent  f188f8a0cafd49c5f2eb85d186037c838c38d6af
Send frame to debug-if and debug-ring only when transmitted
successfully.

diff -r f188f8a0cafd -r 8bacb27f3aa2 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
+	}
 }
 
 /*****************************************************************************/