vserver 1.9.5.x5
[linux-2.6.git] / drivers / net / 3c515.c
index fc86a35..ad46ab8 100644 (file)
@@ -34,7 +34,7 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " becker@scyld.com and others\n";
 /* "Knobs" that adjust features and parameters. */
 /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
    Setting to > 1512 effectively disables this feature. */
-static const int rx_copybreak = 200;
+static int rx_copybreak = 200;
 
 /* Allow setting MTU to a larger size, bypassing the normal ethernet setup. */
 static const int mtu = 1500;
@@ -72,9 +72,9 @@ static int max_interrupt_work = 20;
 #include <linux/interrupt.h>
 #include <linux/timer.h>
 #include <linux/ethtool.h>
+#include <linux/bitops.h>
 
 #include <asm/uaccess.h>
-#include <asm/bitops.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 
@@ -87,15 +87,6 @@ MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
 MODULE_DESCRIPTION("3Com 3c515 Corkscrew driver");
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
-MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i");
-MODULE_PARM(rx_copybreak, "i");
-MODULE_PARM(max_interrupt_work, "i");
-MODULE_PARM_DESC(debug, "3c515 debug level (0-6)");
-MODULE_PARM_DESC(options, "3c515: Bits 0-2: media type, bit 3: full duplex, bit 4: bus mastering");
-MODULE_PARM_DESC(rx_copybreak, "3c515 copy breakpoint for copy-only-tiny-frames");
-MODULE_PARM_DESC(max_interrupt_work, "3c515 maximum events handled per interrupt");
-
 /* "Knobs" for adjusting internal parameters. */
 /* Put out somewhat more debugging messages. (0 - no msg, 1 minimal msgs). */
 #define DRIVER_DEBUG 1
@@ -409,6 +400,16 @@ static int options[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1, };
 
 #ifdef MODULE
 static int debug = -1;
+
+module_param(debug, int, 0);
+module_param_array(options, int, NULL, 0);
+module_param(rx_copybreak, int, 0);
+module_param(max_interrupt_work, int, 0);
+MODULE_PARM_DESC(debug, "3c515 debug level (0-6)");
+MODULE_PARM_DESC(options, "3c515: Bits 0-2: media type, bit 3: full duplex, bit 4: bus mastering");
+MODULE_PARM_DESC(rx_copybreak, "3c515 copy breakpoint for copy-only-tiny-frames");
+MODULE_PARM_DESC(max_interrupt_work, "3c515 maximum events handled per interrupt");
+
 /* A list of all installed Vortex devices, for removing the driver module. */
 /* we will need locking (and refcounting) if we ever use it for more */
 static LIST_HEAD(root_corkscrew_dev);
@@ -831,7 +832,7 @@ static int corkscrew_open(struct net_device *dev)
                outb(PKT_BUF_SZ >> 8, ioaddr + TxFreeThreshold);        /* Room for a packet. */
                /* Clear the Tx ring. */
                for (i = 0; i < TX_RING_SIZE; i++)
-                       vp->tx_skbuff[i] = 0;
+                       vp->tx_skbuff[i] = NULL;
                outl(0, ioaddr + DownListPtr);
        }
        /* Set receiver mode: presumably accept b-case and phys addr only. */
@@ -1174,7 +1175,7 @@ static irqreturn_t corkscrew_interrupt(int irq, void *dev_id,
                                        break;  /* It still hasn't been processed. */
                                if (lp->tx_skbuff[entry]) {
                                        dev_kfree_skb_irq(lp->tx_skbuff[entry]);
-                                       lp->tx_skbuff[entry] = 0;
+                                       lp->tx_skbuff[entry] = NULL;
                                }
                                dirty_tx++;
                        }
@@ -1458,7 +1459,7 @@ static int corkscrew_close(struct net_device *dev)
                for (i = 0; i < RX_RING_SIZE; i++)
                        if (vp->rx_skbuff[i]) {
                                dev_kfree_skb(vp->rx_skbuff[i]);
-                               vp->rx_skbuff[i] = 0;
+                               vp->rx_skbuff[i] = NULL;
                        }
        }
        if (vp->full_bus_master_tx) {   /* Free Boomerang bus master Tx buffers. */
@@ -1466,7 +1467,7 @@ static int corkscrew_close(struct net_device *dev)
                for (i = 0; i < TX_RING_SIZE; i++)
                        if (vp->tx_skbuff[i]) {
                                dev_kfree_skb(vp->tx_skbuff[i]);
-                               vp->tx_skbuff[i] = 0;
+                               vp->tx_skbuff[i] = NULL;
                        }
        }