Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / drivers / net / dgrs.c
index 45492c1..fa4f094 100644 (file)
@@ -97,8 +97,8 @@
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
+#include <linux/bitops.h>
 
-#include <asm/bitops.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
 #include <asm/uaccess.h>
@@ -454,7 +454,7 @@ do_plx_dma(
  *     up some state variables to let the host CPU continue doing
  *     other things until a DMA completion interrupt comes along.
  */
-void
+static void
 dgrs_rcv_frame(
        struct net_device       *dev0,
        DGRS_PRIV       *priv0,
@@ -993,7 +993,7 @@ dgrs_download(struct net_device *dev0)
        int             is;
        unsigned long   i;
 
-       static int      iv2is[16] = {
+       static const int iv2is[16] = {
                                0, 0, 0, ES4H_IS_INT3,
                                0, ES4H_IS_INT5, 0, ES4H_IS_INT7,
                                0, 0, ES4H_IS_INT10, ES4H_IS_INT11,
@@ -1150,7 +1150,7 @@ dgrs_download(struct net_device *dev0)
 /*
  *     Probe (init) a board
  */
-int __init 
+static int __init 
 dgrs_probe1(struct net_device *dev)
 {
        DGRS_PRIV       *priv = (DGRS_PRIV *) dev->priv;
@@ -1191,7 +1191,7 @@ dgrs_probe1(struct net_device *dev)
        if (priv->plxreg)
                OUTL(dev->base_addr + PLX_LCL2PCI_DOORBELL, 1);
        
-       rc = request_irq(dev->irq, &dgrs_intr, SA_SHIRQ, "RightSwitch", dev);
+       rc = request_irq(dev->irq, &dgrs_intr, IRQF_SHARED, "RightSwitch", dev);
        if (rc)
                goto err_out;
 
@@ -1228,7 +1228,7 @@ err_out:
                return rc;
 }
 
-int __init 
+static int __init 
 dgrs_initclone(struct net_device *dev)
 {
        DGRS_PRIV       *priv = (DGRS_PRIV *) dev->priv;
@@ -1311,8 +1311,8 @@ dgrs_found_device(
                *privN = *priv;
 
                        /* ... and zero out VM areas */
-               privN->vmem = 0;
-               privN->vplxdma = 0;
+               privN->vmem = NULL;
+               privN->vplxdma = NULL;
                        /* ... and zero out IRQ */
                devN->irq = 0;
                        /* ... and base MAC address off address of 1st port */
@@ -1458,6 +1458,8 @@ static struct pci_driver dgrs_pci_driver = {
        .probe = dgrs_pci_probe,
        .remove = __devexit_p(dgrs_pci_remove),
 };
+#else
+static struct pci_driver dgrs_pci_driver = {};
 #endif
 
 
@@ -1534,14 +1536,14 @@ static int      iptrap[4] = { -1 };
 static __u32   ipxnet = -1;
 static int     nicmode = -1;
 
-MODULE_PARM(debug, "i");
-MODULE_PARM(dma, "i");
-MODULE_PARM(hashexpire, "i");
-MODULE_PARM(spantree, "i");
-MODULE_PARM(ipaddr, "1-4i");
-MODULE_PARM(iptrap, "1-4i");
-MODULE_PARM(ipxnet, "i");
-MODULE_PARM(nicmode, "i");
+module_param(debug, int, 0);
+module_param(dma, int, 0);
+module_param(hashexpire, int, 0);
+module_param(spantree, int, 0);
+module_param_array(ipaddr, int, NULL, 0);
+module_param_array(iptrap, int, NULL, 0);
+module_param(ipxnet, int, 0);
+module_param(nicmode, int, 0);
 MODULE_PARM_DESC(debug, "Digi RightSwitch enable debugging (0-1)");
 MODULE_PARM_DESC(dma, "Digi RightSwitch enable BM DMA (0-1)");
 MODULE_PARM_DESC(nicmode, "Digi RightSwitch operating mode (1: switch, 2: multi-NIC)");
@@ -1549,7 +1551,7 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwitch operating mode (1: switch, 2: multi-
 static int __init dgrs_init_module (void)
 {
        int     i;
-       int eisacount = 0, pcicount = 0;
+       int     err;
 
        /*
         *      Command line variable overrides
@@ -1591,16 +1593,14 @@ static int __init dgrs_init_module (void)
         *      Find and configure all the cards
         */
 #ifdef CONFIG_EISA
-       eisacount = eisa_driver_register(&dgrs_eisa_driver);
-       if (eisacount < 0)
-               return eisacount;
-#endif
-#ifdef CONFIG_PCI
-       pcicount = pci_register_driver(&dgrs_pci_driver);
-       if (pcicount < 0)
-               return pcicount;
+       err = eisa_driver_register(&dgrs_eisa_driver);
+       if (err)
+               return err;
 #endif
-       return (eisacount + pcicount) == 0 ? -ENODEV : 0;
+       err = pci_register_driver(&dgrs_pci_driver);
+       if (err)
+               return err;
+       return 0;
 }
 
 static void __exit dgrs_cleanup_module (void)