bcm63xx_enet: timeout off by one in do_mdio_op()
[safe/jmp/linux-2.6] / drivers / net / lance.c
index d83d401..dcda303 100644 (file)
@@ -300,7 +300,8 @@ static unsigned char lance_need_isa_bounce_buffers = 1;
 
 static int lance_open(struct net_device *dev);
 static void lance_init_ring(struct net_device *dev, gfp_t mode);
-static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t lance_start_xmit(struct sk_buff *skb,
+                                   struct net_device *dev);
 static int lance_rx(struct net_device *dev);
 static irqreturn_t lance_interrupt(int irq, void *dev_id);
 static int lance_close(struct net_device *dev);
@@ -454,6 +455,18 @@ out:
 }
 #endif
 
+static const struct net_device_ops lance_netdev_ops = {
+       .ndo_open               = lance_open,
+       .ndo_start_xmit         = lance_start_xmit,
+       .ndo_stop               = lance_close,
+       .ndo_get_stats          = lance_get_stats,
+       .ndo_set_multicast_list = set_multicast_list,
+       .ndo_tx_timeout         = lance_tx_timeout,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int options)
 {
        struct lance_private *lp;
@@ -714,12 +727,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
                printk(version);
 
        /* The LANCE-specific entries in the device structure. */
-       dev->open = lance_open;
-       dev->hard_start_xmit = lance_start_xmit;
-       dev->stop = lance_close;
-       dev->get_stats = lance_get_stats;
-       dev->set_multicast_list = set_multicast_list;
-       dev->tx_timeout = lance_tx_timeout;
+       dev->netdev_ops = &lance_netdev_ops;
        dev->watchdog_timeo = TX_TIMEOUT;
 
        err = register_netdev(dev);
@@ -942,7 +950,8 @@ static void lance_tx_timeout (struct net_device *dev)
 }
 
 
-static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t lance_start_xmit(struct sk_buff *skb,
+                                   struct net_device *dev)
 {
        struct lance_private *lp = dev->ml_priv;
        int ioaddr = dev->base_addr;
@@ -1009,7 +1018,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 out:
        spin_unlock_irqrestore(&lp->devlock, flags);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /* The LANCE interrupt handler. */