IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
[pandora-kernel.git] / drivers / net / sunhme.c
index c33ead3..45d07fa 100644 (file)
@@ -13,7 +13,6 @@
  *     argument : macaddr=0x00,0x10,0x20,0x30,0x40,0x50
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -506,7 +505,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp,
                                  unsigned short value)
 {
        int tries = TCVR_WRITE_TRIES;
-       
+
        ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value));
 
        /* Welcome to Sun Microsystems, can I take your order please? */
@@ -1208,7 +1207,7 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr
  * flags, thus:
  *
  *     skb->csum = rxd->rx_flags & 0xffff;
- *     skb->ip_summed = CHECKSUM_HW;
+ *     skb->ip_summed = CHECKSUM_COMPLETE;
  *
  * before sending off the skb to the protocols, and we are good as gold.
  */
@@ -1779,7 +1778,7 @@ static void happy_meal_set_initial_advertisement(struct happy_meal *hp)
 static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status)
 {
        int reset = 0;
-       
+
        /* Only print messages for non-counter related interrupts. */
        if (status & (GREG_STAT_STSTERR | GREG_STAT_TFIFO_UND |
                      GREG_STAT_MAXPKTERR | GREG_STAT_RXERR |
@@ -2075,7 +2074,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
 
                /* This card is _fucking_ hot... */
                skb->csum = ntohs(csum ^ 0xffff);
-               skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = CHECKSUM_COMPLETE;
 
                RXD(("len=%d csum=%4x]", len, csum));
                skb->protocol = eth_type_trans(skb, dev);
@@ -2094,7 +2093,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
        RXD((">"));
 }
 
-static irqreturn_t happy_meal_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t happy_meal_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *) dev_id;
        struct happy_meal *hp  = dev->priv;
@@ -2133,7 +2132,7 @@ out:
 }
 
 #ifdef CONFIG_SBUS
-static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie, struct pt_regs *ptregs)
+static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie)
 {
        struct quattro *qp = (struct quattro *) cookie;
        int i;
@@ -2195,7 +2194,7 @@ static int happy_meal_open(struct net_device *dev)
         */
        if ((hp->happy_flags & (HFLAG_QUATTRO|HFLAG_PCI)) != HFLAG_QUATTRO) {
                if (request_irq(dev->irq, &happy_meal_interrupt,
-                               SA_SHIRQ, dev->name, (void *)dev)) {
+                               IRQF_SHARED, dev->name, (void *)dev)) {
                        HMD(("EAGAIN\n"));
                        printk(KERN_ERR "happy_meal(SBUS): Can't order irq %d to go.\n",
                               dev->irq);
@@ -2269,7 +2268,7 @@ static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev)
        u32 tx_flags;
 
        tx_flags = TXFLAG_OWN;
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                u32 csum_start_off, csum_stuff_off;
 
                csum_start_off = (u32) (skb->h.raw - skb->data);
@@ -2513,7 +2512,7 @@ static u32 hme_get_link(struct net_device *dev)
        return (hp->sw_bmsr & BMSR_LSTATUS);
 }
 
-static struct ethtool_ops hme_ethtool_ops = {
+static const struct ethtool_ops hme_ethtool_ops = {
        .get_settings           = hme_get_settings,
        .set_settings           = hme_set_settings,
        .get_drvinfo            = hme_get_drvinfo,
@@ -2523,7 +2522,7 @@ static struct ethtool_ops hme_ethtool_ops = {
 static int hme_version_printed;
 
 #ifdef CONFIG_SBUS
-void __init quattro_get_ranges(struct quattro *qp)
+void __devinit quattro_get_ranges(struct quattro *qp)
 {
        struct sbus_dev *sdev = qp->quattro_dev;
        int err;
@@ -2539,7 +2538,7 @@ void __init quattro_get_ranges(struct quattro *qp)
        qp->nranges = (err / sizeof(struct linux_prom_ranges));
 }
 
-static void __init quattro_apply_ranges(struct quattro *qp, struct happy_meal *hp)
+static void __devinit quattro_apply_ranges(struct quattro *qp, struct happy_meal *hp)
 {
        struct sbus_dev *sdev = hp->happy_dev;
        int rng;
@@ -2566,7 +2565,7 @@ static void __init quattro_apply_ranges(struct quattro *qp, struct happy_meal *h
  *
  * Return NULL on failure.
  */
-static struct quattro * __init quattro_sbus_find(struct sbus_dev *goal_sdev)
+static struct quattro * __devinit quattro_sbus_find(struct sbus_dev *goal_sdev)
 {
        struct sbus_dev *sdev;
        struct quattro *qp;
@@ -2609,7 +2608,7 @@ static void __init quattro_sbus_register_irqs(void)
 
                err = request_irq(sdev->irqs[0],
                                  quattro_sbus_interrupt,
-                                 SA_SHIRQ, "Quattro",
+                                 IRQF_SHARED, "Quattro",
                                  qp);
                if (err != 0) {
                        printk(KERN_ERR "Quattro: Fatal IRQ registery error %d.\n", err);
@@ -2618,7 +2617,7 @@ static void __init quattro_sbus_register_irqs(void)
        }
 }
 
-static void __devexit quattro_sbus_free_irqs(void)
+static void quattro_sbus_free_irqs(void)
 {
        struct quattro *qp;
 
@@ -2662,7 +2661,7 @@ static struct quattro * __init quattro_pci_find(struct pci_dev *pdev)
 #endif /* CONFIG_PCI */
 
 #ifdef CONFIG_SBUS
-static int __init happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe)
+static int __devinit happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe)
 {
        struct device_node *dp = sdev->ofdev.node;
        struct quattro *qp = NULL;
@@ -3003,7 +3002,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
                printk(KERN_ERR "happymeal(PCI): Some PCI device info missing\n");
                return -ENODEV;
        }
-       
+
        strcpy(prom_name, pcp->prom_node->name);
 #else
        if (is_quattro_p(pdev))
@@ -3047,7 +3046,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
                hp->qfe_parent = qp;
                hp->qfe_ent = qfe_slot;
                qp->happy_meals[qfe_slot] = dev;
-       }               
+       }
 
        hpreg_res = pci_resource_start(pdev, 0);
        err = -ENODEV;
@@ -3091,7 +3090,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
                get_hme_mac_nonsparc(pdev, &dev->dev_addr[0]);
 #endif
        }
-       
+
        /* Layout registers. */
        hp->gregs      = (hpreg_base + 0x0000UL);
        hp->etxregs    = (hpreg_base + 0x2000UL);
@@ -3202,7 +3201,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
                    qpdev->device == PCI_DEVICE_ID_DEC_21153)
                        printk("DEC 21153 PCI Bridge\n");
                else
-                       printk("unknown bridge %04x.%04x\n", 
+                       printk("unknown bridge %04x.%04x\n",
                                qpdev->vendor, qpdev->device);
        }
 
@@ -3256,12 +3255,7 @@ static void __devexit happy_meal_pci_remove(struct pci_dev *pdev)
 }
 
 static struct pci_device_id happymeal_pci_ids[] = {
-       {
-         .vendor       = PCI_VENDOR_ID_SUN,
-         .device       = PCI_DEVICE_ID_SUN_HAPPYMEAL,
-         .subvendor    = PCI_ANY_ID,
-         .subdevice    = PCI_ANY_ID,
-       },
+       { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) },
        { }                     /* Terminating entry */
 };
 
@@ -3276,7 +3270,7 @@ static struct pci_driver hme_pci_driver = {
 
 static int __init happy_meal_pci_init(void)
 {
-       return pci_module_init(&hme_pci_driver);
+       return pci_register_driver(&hme_pci_driver);
 }
 
 static void happy_meal_pci_exit(void)