don't use __devexit_p to wrap sgiseeq_remove
[safe/jmp/linux-2.6] / drivers / net / smc9194.c
index cb2698d..934a120 100644 (file)
@@ -299,7 +299,8 @@ static void smc_hardware_send_packet( struct net_device * dev );
  . to store the packet, I call this routine, which either sends it
  . now, or generates an interrupt when the card is ready for the
  . packet */
-static int  smc_wait_to_send_packet( struct sk_buff * skb, struct net_device *dev );
+static netdev_tx_t  smc_wait_to_send_packet( struct sk_buff * skb,
+                                            struct net_device *dev );
 
 /* this does a soft reset on the device */
 static void smc_reset( int ioaddr );
@@ -487,7 +488,8 @@ static void smc_setmulticast( int ioaddr, int count, struct dev_mc_list * addrs
  . o   (NO): Enable interrupts and let the interrupt handler deal with it.
  . o   (YES):Send it now.
 */
-static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * dev )
+static netdev_tx_t smc_wait_to_send_packet(struct sk_buff *skb,
+                                          struct net_device *dev)
 {
        struct smc_local *lp = netdev_priv(dev);
        unsigned int ioaddr     = dev->base_addr;
@@ -503,7 +505,7 @@ static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * de
                /* THIS SHOULD NEVER HAPPEN. */
                dev->stats.tx_aborted_errors++;
                printk(CARDNAME": Bad Craziness - sent packet while busy.\n" );
-               return 1;
+               return NETDEV_TX_BUSY;
        }
        lp->saved_skb = skb;
 
@@ -512,7 +514,7 @@ static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * de
        if (length < ETH_ZLEN) {
                if (skb_padto(skb, ETH_ZLEN)) {
                        netif_wake_queue(dev);
-                       return 0;
+                       return NETDEV_TX_OK;
                }
                length = ETH_ZLEN;
        }
@@ -534,7 +536,7 @@ static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * de
                lp->saved_skb = NULL;
                /* this IS an error, but, i don't want the skb saved */
                netif_wake_queue(dev);
-               return 0;
+               return NETDEV_TX_OK;
        }
        /* either way, a packet is waiting now */
        lp->packets_waiting++;
@@ -571,12 +573,12 @@ static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * de
                SMC_ENABLE_INT( IM_ALLOC_INT );
                PRINTK2((CARDNAME": memory allocation deferred. \n"));
                /* it's deferred, but I'll handle it later */
-               return 0;
+               return NETDEV_TX_OK;
        }
        /* or YES! I can send the packet now.. */
        smc_hardware_send_packet(dev);
        netif_wake_queue(dev);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
@@ -764,7 +766,7 @@ out:
  . interrupt, so an auto-detect routine can detect it, and find the IRQ,
  ------------------------------------------------------------------------
 */
-int __init smc_findirq( int ioaddr )
+static int __init smc_findirq(int ioaddr)
 {
 #ifndef NO_AUTOPROBE
        int     timeout = 20;
@@ -831,6 +833,17 @@ int __init smc_findirq( int ioaddr )
 #endif
 }
 
+static const struct net_device_ops smc_netdev_ops = {
+       .ndo_open                = smc_open,
+       .ndo_stop               = smc_close,
+       .ndo_start_xmit         = smc_wait_to_send_packet,
+       .ndo_tx_timeout         = smc_timeout,
+       .ndo_set_multicast_list = smc_set_multicast_list,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 /*----------------------------------------------------------------------
  . Function: smc_probe( int ioaddr )
  .
@@ -876,8 +889,6 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
        word memory_info_register;
        word memory_cfg_register;
 
-       DECLARE_MAC_BUF(mac);
-
        /* Grab the region so that no one else tries to probe our ioports. */
        if (!request_region(ioaddr, SMC_IO_EXTENT, DRV_NAME))
                return -EBUSY;
@@ -906,7 +917,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
        SMC_SELECT_BANK(1);
        base_address_register = inw( ioaddr + BASE );
        if ( ioaddr != ( base_address_register >> 3 & 0x3E0 ) )  {
-               printk(CARDNAME ": IOADDR %x doesn't match configuration (%x)."
+               printk(CARDNAME ": IOADDR %x doesn't match configuration (%x). "
                        "Probably not a SMC chip\n",
                        ioaddr, base_address_register >> 3 & 0x3E0 );
                /* well, the base address register didn't match.  Must not have
@@ -1033,10 +1044,10 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
        /*
         . Print the Ethernet address
        */
-       printk("ADDR: %s\n", print_mac(mac, dev->dev_addr));
+       printk("ADDR: %pM\n", dev->dev_addr);
 
        /* set the private data to zero by default */
-       memset(dev->priv, 0, sizeof(struct smc_local));
+       memset(netdev_priv(dev), 0, sizeof(struct smc_local));
 
        /* Grab the IRQ */
        retval = request_irq(dev->irq, &smc_interrupt, 0, DRV_NAME, dev);
@@ -1046,12 +1057,8 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
                goto err_out;
        }
 
-       dev->open                       = smc_open;
-       dev->stop                       = smc_close;
-       dev->hard_start_xmit            = smc_wait_to_send_packet;
-       dev->tx_timeout                 = smc_timeout;
+       dev->netdev_ops                 = &smc_netdev_ops;
        dev->watchdog_timeo             = HZ/20;
-       dev->set_multicast_list         = smc_set_multicast_list;
 
        return 0;
 
@@ -1110,7 +1117,7 @@ static int smc_open(struct net_device *dev)
        int     i;      /* used to set hw ethernet address */
 
        /* clear out all the junk that was put here before... */
-       memset(dev->priv, 0, sizeof(struct smc_local));
+       memset(netdev_priv(dev), 0, sizeof(struct smc_local));
 
        /* reset the hardware */
 
@@ -1166,7 +1173,7 @@ static void smc_timeout(struct net_device *dev)
        smc_enable( dev->base_addr );
        dev->trans_start = jiffies;
        /* clear anything saved */
-       ((struct smc_local *)dev->priv)->saved_skb = NULL;
+       ((struct smc_local *)netdev_priv(dev))->saved_skb = NULL;
        netif_wake_queue(dev);
 }
 
@@ -1272,7 +1279,6 @@ static void smc_rcv(struct net_device *dev)
 
                skb->protocol = eth_type_trans(skb, dev );
                netif_rx(skb);
-               dev->last_rx = jiffies;
                dev->stats.rx_packets++;
                dev->stats.rx_bytes += packet_length;
        } else {