Merge branches 'kbuild', 'packaging' and 'misc' of git://git.kernel.org/pub/scm/linux...
[deliverable/linux.git] / drivers / net / xilinx_emaclite.c
index 372572c0adc6d03ced8364c435e83d31772d582b..8018d7d045b044bbd0bb5dfa403e53d47d1bf390 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/of_mdio.h>
 #include <linux/of_net.h>
 #include <linux/phy.h>
+#include <linux/interrupt.h>
 
 #define DRIVER_NAME "xilinx_emaclite"
 
@@ -251,11 +252,11 @@ static void xemaclite_aligned_write(void *src_ptr, u32 *dest_ptr,
        u16 *from_u16_ptr, *to_u16_ptr;
 
        to_u32_ptr = dest_ptr;
-       from_u16_ptr = (u16 *) src_ptr;
+       from_u16_ptr = src_ptr;
        align_buffer = 0;
 
        for (; length > 3; length -= 4) {
-               to_u16_ptr = (u16 *) ((void *) &align_buffer);
+               to_u16_ptr = (u16 *)&align_buffer;
                *to_u16_ptr++ = *from_u16_ptr++;
                *to_u16_ptr++ = *from_u16_ptr++;
 
@@ -647,7 +648,8 @@ static void xemaclite_rx_handler(struct net_device *dev)
        dev->stats.rx_packets++;
        dev->stats.rx_bytes += len;
 
-       netif_rx(skb);          /* Send the packet upstream */
+       if (!skb_defer_rx_timestamp(skb))
+               netif_rx(skb);  /* Send the packet upstream */
 }
 
 /**
@@ -1029,15 +1031,19 @@ static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)
        spin_lock_irqsave(&lp->reset_lock, flags);
        if (xemaclite_send_data(lp, (u8 *) new_skb->data, len) != 0) {
                /* If the Emaclite Tx buffer is busy, stop the Tx queue and
-                * defer the skb for transmission at a later point when the
+                * defer the skb for transmission during the ISR, after the
                 * current transmission is complete */
                netif_stop_queue(dev);
                lp->deferred_skb = new_skb;
+               /* Take the time stamp now, since we can't do this in an ISR. */
+               skb_tx_timestamp(new_skb);
                spin_unlock_irqrestore(&lp->reset_lock, flags);
                return 0;
        }
        spin_unlock_irqrestore(&lp->reset_lock, flags);
 
+       skb_tx_timestamp(new_skb);
+
        dev->stats.tx_bytes += len;
        dev_kfree_skb(new_skb);
 
This page took 0.030706 seconds and 5 git commands to generate.