Merge branch 'linux-2.6' into for-2.6.22
[sfrench/cifs-2.6.git] / drivers / net / macmace.c
index 696d5513e558252d120b868a7446eb98b5e0932b..27911c07558d928b82c82d2a295927da6e4da8e8 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/delay.h>
 #include <linux/string.h>
 #include <linux/crc32.h>
+#include <linux/bitrev.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/irq.h>
@@ -77,23 +78,10 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev);
 static struct net_device_stats *mace_stats(struct net_device *dev);
 static void mace_set_multicast(struct net_device *dev);
 static int mace_set_address(struct net_device *dev, void *addr);
-static irqreturn_t mace_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-static irqreturn_t mace_dma_intr(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t mace_interrupt(int irq, void *dev_id);
+static irqreturn_t mace_dma_intr(int irq, void *dev_id);
 static void mace_tx_timeout(struct net_device *dev);
 
-/* Bit-reverse one byte of an ethernet hardware address. */
-
-static int bitrev(int b)
-{
-       int d = 0, i;
-
-       for (i = 0; i < 8; ++i, b >>= 1) {
-               d = (d << 1) | (b & 1);
-       }
-
-       return d;
-}
-
 /*
  * Load a receive DMA channel with a base address and ring length
  */
@@ -219,12 +207,12 @@ struct net_device *mace_probe(int unit)
        addr = (void *)MACE_PROM;
 
        for (j = 0; j < 6; ++j) {
-               u8 v=bitrev(addr[j<<4]);
+               u8 v = bitrev8(addr[j<<4]);
                checksum ^= v;
                dev->dev_addr[j] = v;
        }
        for (; j < 8; ++j) {
-               checksum ^= bitrev(addr[j<<4]);
+               checksum ^= bitrev8(addr[j<<4]);
        }
 
        if (checksum != 0xFF) {
@@ -432,8 +420,7 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
        mp->stats.tx_bytes += skb->len;
 
        /* We need to copy into our xmit buffer to take care of alignment and caching issues */
-
-       memcpy((void *) mp->tx_ring, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, mp->tx_ring, skb->len);
 
        /* load the Tx DMA and fire it off */
 
@@ -573,7 +560,7 @@ static void mace_recv_interrupt(struct net_device *dev)
  * Process the chip interrupt
  */
 
-static irqreturn_t mace_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t mace_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *) dev_id;
        struct mace_data *mp = (struct mace_data *) dev->priv;
@@ -633,7 +620,6 @@ static void mace_dma_rx_frame(struct net_device *dev, struct mace_frame *mf)
        skb_reserve(skb,2);
        memcpy(skb_put(skb, mf->len), mf->data, mf->len);
 
-       skb->dev = dev;
        skb->protocol = eth_type_trans(skb, dev);
        netif_rx(skb);
        dev->last_rx = jiffies;
@@ -645,7 +631,7 @@ static void mace_dma_rx_frame(struct net_device *dev, struct mace_frame *mf)
  * The PSC has passed us a DMA interrupt event.
  */
 
-static irqreturn_t mace_dma_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t mace_dma_intr(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *) dev_id;
        struct mace_data *mp = (struct mace_data *) dev->priv;