net: spread __net_init, __net_exit
[safe/jmp/linux-2.6] / drivers / net / sonic.c
index 687c141..9599ce7 100644 (file)
@@ -50,29 +50,6 @@ static int sonic_open(struct net_device *dev)
        if (sonic_debug > 2)
                printk("sonic_open: initializing sonic driver.\n");
 
-       /*
-        * We don't need to deal with auto-irq stuff since we
-        * hardwire the sonic interrupt.
-        */
-/*
- * XXX Horrible work around:  We install sonic_interrupt as fast interrupt.
- * This means that during execution of the handler interrupt are disabled
- * covering another bug otherwise corrupting data.  This doesn't mean
- * this glue works ok under all situations.
- *
- * Note (dhd): this also appears to prevent lockups on the Macintrash
- * when more than one Ethernet card is installed (knock on wood)
- *
- * Note (fthain): whether the above is still true is anyones guess. Certainly
- * the buffer handling algorithms will not tolerate re-entrance without some
- * mutual exclusion added. Anyway, the memcpy has now been eliminated from the
- * rx code to make this a faster "fast interrupt".
- */
-       if (request_irq(dev->irq, &sonic_interrupt, SONIC_IRQ_FLAG, "sonic", dev)) {
-               printk(KERN_ERR "\n%s: unable to get IRQ %d .\n", dev->name, dev->irq);
-               return -EAGAIN;
-       }
-
        for (i = 0; i < SONIC_NUM_RRS; i++) {
                struct sk_buff *skb = dev_alloc_skb(SONIC_RBSIZE + 2);
                if (skb == NULL) {
@@ -169,8 +146,6 @@ static int sonic_close(struct net_device *dev)
                }
        }
 
-       free_irq(dev->irq, dev);        /* release the IRQ */
-
        return 0;
 }
 
@@ -236,7 +211,7 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
        length = skb->len;
        if (length < ETH_ZLEN) {
                if (skb_padto(skb, ETH_ZLEN))
-                       return 0;
+                       return NETDEV_TX_OK;
                length = ETH_ZLEN;
        }
 
@@ -248,7 +223,7 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
        if (!laddr) {
                printk(KERN_ERR "%s: failed to map tx DMA buffer.\n", dev->name);
                dev_kfree_skb(skb);
-               return 1;
+               return NETDEV_TX_BUSY;
        }
 
        sonic_tda_put(dev, entry, SONIC_TD_STATUS, 0);       /* clear status */
@@ -290,7 +265,7 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
 
        dev->trans_start = jiffies;
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
@@ -475,7 +450,6 @@ static void sonic_rx(struct net_device *dev)
                        skb_trim(used_skb, pkt_len);
                        used_skb->protocol = eth_type_trans(used_skb, dev);
                        netif_rx(used_skb);
-                       dev->last_rx = jiffies;
                        lp->stats.rx_packets++;
                        lp->stats.rx_bytes += pkt_len;