qlcnic: fix caching window register
[safe/jmp/linux-2.6] / drivers / net / seeq8005.c
index 2fbc8f1..d2fce98 100644 (file)
@@ -37,7 +37,6 @@ static const char version[] =
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/delay.h>
@@ -81,7 +80,8 @@ struct net_local {
 static int seeq8005_probe1(struct net_device *dev, int ioaddr);
 static int seeq8005_open(struct net_device *dev);
 static void seeq8005_timeout(struct net_device *dev);
-static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t seeq8005_send_packet(struct sk_buff *skb,
+                                       struct net_device *dev);
 static irqreturn_t seeq8005_interrupt(int irq, void *dev_id);
 static void seeq8005_rx(struct net_device *dev);
 static int seeq8005_close(struct net_device *dev);
@@ -143,6 +143,17 @@ out:
        return ERR_PTR(err);
 }
 
+static const struct net_device_ops seeq8005_netdev_ops = {
+       .ndo_open               = seeq8005_open,
+       .ndo_stop               = seeq8005_close,
+       .ndo_start_xmit         = seeq8005_send_packet,
+       .ndo_tx_timeout         = seeq8005_timeout,
+       .ndo_set_multicast_list = set_multicast_list,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 /* This is the real probe routine.  Linux has a history of friendly device
    probes on the ISA bus.  A good device probes avoids doing writes, and
    verifies that the correct device exists and functions.  */
@@ -323,7 +334,7 @@ static int __init seeq8005_probe1(struct net_device *dev, int ioaddr)
 
 #if 0
        {
-                int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", dev);
+                int irqval = request_irq(dev->irq, seeq8005_interrupt, 0, "seeq8005", dev);
                 if (irqval) {
                         printk ("%s: unable to get IRQ %d (irqval=%d).\n", dev->name,
                                         dev->irq, irqval);
@@ -332,12 +343,8 @@ static int __init seeq8005_probe1(struct net_device *dev, int ioaddr)
                 }
        }
 #endif
-       dev->open               = seeq8005_open;
-       dev->stop               = seeq8005_close;
-       dev->hard_start_xmit    = seeq8005_send_packet;
-       dev->tx_timeout         = seeq8005_timeout;
+       dev->netdev_ops = &seeq8005_netdev_ops;
        dev->watchdog_timeo     = HZ/20;
-       dev->set_multicast_list = set_multicast_list;
        dev->flags &= ~IFF_MULTICAST;
 
        return 0;
@@ -359,7 +366,7 @@ static int seeq8005_open(struct net_device *dev)
        struct net_local *lp = netdev_priv(dev);
 
        {
-                int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", dev);
+                int irqval = request_irq(dev->irq, seeq8005_interrupt, 0, "seeq8005", dev);
                 if (irqval) {
                         printk ("%s: unable to get IRQ %d (irqval=%d).\n", dev->name,
                                         dev->irq, irqval);
@@ -383,18 +390,19 @@ static void seeq8005_timeout(struct net_device *dev)
                   tx_done(dev) ? "IRQ conflict" : "network cable problem");
        /* Try to restart the adaptor. */
        seeq8005_init(dev, 1);
-       dev->trans_start = jiffies;
+       dev->trans_start = jiffies; /* prevent tx timeout */
        netif_wake_queue(dev);
 }
 
-static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t seeq8005_send_packet(struct sk_buff *skb,
+                                       struct net_device *dev)
 {
        short length = skb->len;
        unsigned char *buf;
 
        if (length < ETH_ZLEN) {
                if (skb_padto(skb, ETH_ZLEN))
-                       return 0;
+                       return NETDEV_TX_OK;
                length = ETH_ZLEN;
        }
        buf = skb->data;
@@ -403,12 +411,11 @@ static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev)
        netif_stop_queue(dev);
 
        hardware_send_packet(dev, buf, length);
-       dev->trans_start = jiffies;
        dev->stats.tx_bytes += length;
        dev_kfree_skb (skb);
        /* You might need to clean up and record Tx statistics here. */
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
@@ -571,7 +578,6 @@ static void seeq8005_rx(struct net_device *dev)
        /* If any worth-while packets have been received, netif_rx()
           has done a mark_bh(NET_BH) for us and will work on them
           when we get to the bottom-half routine. */
-       return;
 }
 
 /* The inverse routine to net_open(). */
@@ -744,12 +750,3 @@ void __exit cleanup_module(void)
 }
 
 #endif /* MODULE */
-
-/*
- * Local variables:
- *  compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c skeleton.c"
- *  version-control: t
- *  kept-new-versions: 5
- *  tab-width: 4
- * End:
- */