master/device.c
branchstable-1.3
changeset 1746 72e7507b3f1b
parent 1744 7bc131b92039
--- a/master/device.c	Thu Sep 13 11:08:46 2007 +0000
+++ b/master/device.c	Wed Oct 03 08:58:01 2007 +0000
@@ -168,7 +168,7 @@
 
     for (i = 0; i < EC_TX_RING_SIZE; i++) {
         device->tx_skb[i]->dev = net_dev;
-        eth = (struct ethhdr *) (device->tx_skb[i]->data + ETH_HLEN);
+        eth = (struct ethhdr *) (device->tx_skb[i]->data);
         memcpy(eth->h_source, net_dev->dev_addr, ETH_ALEN);
     }
 }
@@ -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
+	}
 }
 
 /*****************************************************************************/