ARM: 6124/1: ep93xx: SPI driver platform support code
[safe/jmp/linux-2.6] / drivers / net / 3c507.c
index 96b8665..77cf090 100644 (file)
@@ -56,6 +56,7 @@ static const char version[] =
 #include <linux/errno.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/if_ether.h>
 #include <linux/skbuff.h>
 #include <linux/slab.h>
 #include <linux/init.h>
@@ -284,7 +285,8 @@ static unsigned short init_words[] = {
 
 static int     el16_probe1(struct net_device *dev, int ioaddr);
 static int     el16_open(struct net_device *dev);
-static int     el16_send_packet(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t el16_send_packet(struct sk_buff *skb,
+                                   struct net_device *dev);
 static irqreturn_t el16_interrupt(int irq, void *dev_id);
 static void el16_rx(struct net_device *dev);
 static int     el16_close(struct net_device *dev);
@@ -398,7 +400,7 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
 
        irq = inb(ioaddr + IRQ_CONFIG) & 0x0f;
 
-       irqval = request_irq(irq, &el16_interrupt, 0, DRV_NAME, dev);
+       irqval = request_irq(irq, el16_interrupt, 0, DRV_NAME, dev);
        if (irqval) {
                pr_cont("\n");
                pr_err("3c507: unable to get IRQ %d (irqval=%d).\n", irq, irqval);
@@ -509,7 +511,8 @@ static void el16_tx_timeout (struct net_device *dev)
 }
 
 
-static int el16_send_packet (struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t el16_send_packet (struct sk_buff *skb,
+                                    struct net_device *dev)
 {
        struct net_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
@@ -537,7 +540,7 @@ static int el16_send_packet (struct sk_buff *skb, struct net_device *dev)
 
        /* You might need to clean up and record Tx statistics here. */
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*     The typical workload of the driver:
@@ -732,8 +735,7 @@ static void init_82586_mem(struct net_device *dev)
        memcpy_toio(lp->base, init_words + 5, sizeof(init_words) - 10);
 
        /* Fill in the station address. */
-       memcpy_toio(lp->base+SA_OFFSET, dev->dev_addr,
-                  sizeof(dev->dev_addr));
+       memcpy_toio(lp->base+SA_OFFSET, dev->dev_addr, ETH_ALEN);
 
        /* The Tx-block list is written as needed.  We just set up the values. */
        lp->tx_cmd_link = IDLELOOP + 4;
@@ -834,8 +836,8 @@ static void el16_rx(struct net_device *dev)
                void __iomem *data_frame = lp->base + data_buffer_addr;
                ushort pkt_len = readw(data_frame);
 
-               if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22
-                       || (pkt_len & 0xC000) != 0xC000) {
+               if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22 ||
+                   (pkt_len & 0xC000) != 0xC000) {
                        pr_err("%s: Rx frame at %#x corrupted, "
                               "status %04x cmd %04x next %04x "
                               "data-buf @%04x %04x.\n",