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 / tokenring / smctr.c
index a39d7ee..85a7f79 100644 (file)
@@ -29,7 +29,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
@@ -49,9 +48,9 @@
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/trdevice.h>
+#include <linux/bitops.h>
 
 #include <asm/system.h>
-#include <asm/bitops.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/irq.h>
@@ -69,7 +68,7 @@ static const char cardname[] = "smctr";
 
 #define SMCTR_IO_EXTENT   20
 
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 static unsigned int smctr_posid = 0x6ec6;
 #endif
 
@@ -77,7 +76,7 @@ static int ringspeed;
 
 /* SMC Name of the Adapter. */
 static char smctr_name[] = "SMC TokenCard";
-char *smctr_model = "Unknown";
+static char *smctr_model = "Unknown";
 
 /* Use 0 for production, 1 for verification, 2 for debug, and
  * 3 for very verbose debug.
@@ -479,7 +478,7 @@ static int smctr_checksum_firmware(struct net_device *dev)
 
 static int __init smctr_chk_mca(struct net_device *dev)
 {
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
        struct net_local *tp = netdev_priv(dev);
        int current_slot;
        __u8 r1, r2, r3, r4, r5;
@@ -532,7 +531,7 @@ static int __init smctr_chk_mca(struct net_device *dev)
                        dev->irq = 15;
                                break;
        }
-       if (request_irq(dev->irq, smctr_interrupt, SA_SHIRQ, smctr_name, dev)) {
+       if (request_irq(dev->irq, smctr_interrupt, IRQF_SHARED, smctr_name, dev)) {
                release_region(dev->base_addr, SMCTR_IO_EXTENT);
                return -ENODEV;
        }
@@ -626,7 +625,7 @@ static int __init smctr_chk_mca(struct net_device *dev)
        return (0);
 #else
        return (-1);
-#endif /* CONFIG_MCA */
+#endif /* CONFIG_MCA_LEGACY */
 }
 
 static int smctr_chg_rx_mask(struct net_device *dev)
@@ -1062,7 +1061,7 @@ static int __init smctr_chk_isa(struct net_device *dev)
                         goto out2;
          }
 
-        if (request_irq(dev->irq, smctr_interrupt, SA_SHIRQ, smctr_name, dev))
+        if (request_irq(dev->irq, smctr_interrupt, IRQF_SHARED, smctr_name, dev))
                 goto out2;
 
         /* Get 58x Rom Base */
@@ -3617,7 +3616,7 @@ struct net_device __init *smctr_probe(int unit)
                goto out1;
        return dev;
 out1:
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
        { struct net_local *tp = netdev_priv(dev);
          if (tp->slot_num)
                mca_mark_as_unused(tp->slot_num);
@@ -4939,7 +4938,7 @@ static int smctr_send_rq_init(struct net_device *dev)
                 tmf->dc_sc = DC_RPS | SC_RS;
                 tmf->vl    = 4;
 
-                smctr_make_8025_hdr(dev, 0L, tmf, AC_FC_RQ_INIT);
+                smctr_make_8025_hdr(dev, NULL, tmf, AC_FC_RQ_INIT);
 
                 tsv = (MAC_SUB_VECTOR *)((__u32)tmf + sizeof(MAC_HEADER));
                 smctr_make_product_id(dev, tsv);
@@ -5663,11 +5662,11 @@ static int irq[SMCTR_MAX_ADAPTERS];
 
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(io, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i");
-MODULE_PARM(irq, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i");
-MODULE_PARM(ringspeed, "i");
+module_param_array(io, int, NULL, 0);
+module_param_array(irq, int, NULL, 0);
+module_param(ringspeed, int, 0);
 
-static struct net_device *setup_card(int n)
+static struct net_device * __init setup_card(int n)
 {
        struct net_device *dev = alloc_trdev(sizeof(struct net_local));
        int err;
@@ -5685,7 +5684,7 @@ static struct net_device *setup_card(int n)
                goto out1;
        return dev;
  out1:
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
        { struct net_local *tp = netdev_priv(dev);
          if (tp->slot_num)
                mca_mark_as_unused(tp->slot_num);
@@ -5697,9 +5696,8 @@ out:
        free_netdev(dev);
        return ERR_PTR(err);
 }
-                       
 
-int init_module(void)
+int __init init_module(void)
 {
         int i, found = 0;
        struct net_device *dev;
@@ -5725,7 +5723,7 @@ void cleanup_module(void)
                if (dev) {
 
                        unregister_netdev(dev);
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
                        { struct net_local *tp = netdev_priv(dev);
                        if (tp->slot_num)
                                mca_mark_as_unused(tp->slot_num);