sky2: version 1.28
[safe/jmp/linux-2.6] / drivers / net / ksz884x.c
index 3487695..cc0bc8a 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/if_vlan.h>
 #include <linux/crc32.h>
 #include <linux/sched.h>
+#include <linux/slab.h>
 
 
 /* DMA Registers */
@@ -4683,7 +4684,7 @@ static void send_packet(struct sk_buff *skb, struct net_device *dev)
                int frag;
                skb_frag_t *this_frag;
 
-               dma_buf->len = skb->len - skb->data_len;
+               dma_buf->len = skb_headlen(skb);
 
                dma_buf->dma = pci_map_single(
                        hw_priv->pdev, skb->data, dma_buf->len,
@@ -5053,8 +5054,6 @@ static inline int rx_proc(struct net_device *dev, struct ksz_hw* hw,
        priv->stats.rx_bytes += packet_len;
 
        /* Notify upper layer for received packet. */
-       dev->last_rx = jiffies;
-
        rx_status = netif_rx(skb);
 
        return 0;
@@ -6318,7 +6317,7 @@ static int netdev_set_eeprom(struct net_device *dev,
        int len;
 
        if (eeprom->magic != EEPROM_MAGIC)
-               return 1;
+               return -EINVAL;
 
        len = (eeprom->offset + eeprom->len + 1) / 2;
        for (i = eeprom->offset / 2; i < len; i++)