Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / net / gt96100eth.c
index a41ccc4..2d24354 100644 (file)
@@ -44,9 +44,9 @@
 #include <linux/skbuff.h>
 #include <linux/delay.h>
 #include <linux/ctype.h>
+#include <linux/bitops.h>
 
 #include <asm/irq.h>
-#include <asm/bitops.h>
 #include <asm/io.h>
 
 #define DESC_BE 1
@@ -72,8 +72,6 @@ static void dump_tx_desc(int dbg_lvl, struct net_device *dev, int i);
 static void dump_rx_desc(int dbg_lvl, struct net_device *dev, int i);
 static void dump_skb(int dbg_lvl, struct net_device *dev,
                     struct sk_buff *skb);
-static void dump_hw_addr(int dbg_lvl, struct net_device *dev,
-                        const char* pfx, unsigned char* addr_str);
 static void update_stats(struct gt96100_private *gp);
 static void abort(struct net_device *dev, u32 abort_bits);
 static void hard_stop(struct net_device *dev);
@@ -116,8 +114,8 @@ static int max_interrupt_work = 32;
 
 static char mac0[18] = "00.02.03.04.05.06";
 static char mac1[18] = "00.01.02.03.04.05";
-MODULE_PARM(mac0, "c18");
-MODULE_PARM(mac1, "c18");
+module_param_string(mac0, mac0, 18, 0);
+module_param_string(mac1, mac0, 18, 0);
 MODULE_PARM_DESC(mac0, "MAC address for GT96100 ethernet port 0");
 MODULE_PARM_DESC(mac1, "MAC address for GT96100 ethernet port 1");
 
@@ -187,10 +185,8 @@ static void gt96100_delay(int ms)
 {
        if (in_interrupt())
                return;
-       else {
-               current->state = TASK_INTERRUPTIBLE;
-               schedule_timeout(ms*HZ/1000);
-       }
+       else
+               msleep_interruptible(ms);
 }
 
 static int
@@ -336,13 +332,13 @@ dump_MII(int dbg_lvl, struct net_device *dev)
 
 static void
 dump_hw_addr(int dbg_lvl, struct net_device *dev, const char* pfx,
-            unsigned char* addr_str)
+            const char* func, unsigned char* addr_str)
 {
        int i;
        char buf[100], octet[5];
     
        if (dbg_lvl <= GT96100_DEBUG) {
-               strcpy(buf, pfx);
+               sprintf(buf, pfx, func);
                for (i = 0; i < 6; i++) {
                        sprintf(octet, "%2.2x%s",
                                addr_str[i], i<5 ? ":" : "\n");
@@ -527,7 +523,7 @@ abort(struct net_device *dev, u32 abort_bits)
 
        // wait for abort to complete
        while (GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM) & abort_bits) {
-               // snooze for 20 msec and check again
+               // snooze for 1 msec and check again
                gt96100_delay(1);
        
                if (--timedout == 0) {
@@ -710,7 +706,7 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num)
 
        info("%s found at 0x%x, irq %d\n",
             chip_name(gp->chip_rev), gtif->iobase, gtif->irq);
-       dump_hw_addr(0, dev, "HW Address ", dev->dev_addr);
+       dump_hw_addr(0, dev, "%s: HW Address ", __FUNCTION__, dev->dev_addr);
        info("%s chip revision=%d\n", chip_name(gp->chip_rev), gp->chip_rev);
        info("%s ethernet port %d\n", chip_name(gp->chip_rev), gp->port_num);
        info("external PHY ID1=0x%04x, ID2=0x%04x\n", phy_id1, phy_id2);
@@ -1490,7 +1486,7 @@ gt96100_set_rx_mode(struct net_device *dev)
                gt96100_add_hash_entry(dev, dev->dev_addr);
 
                for (mcptr = dev->mc_list; mcptr; mcptr = mcptr->next) {
-                       dump_hw_addr(2, dev, __FUNCTION__ ": addr=",
+                       dump_hw_addr(2, dev, "%s: addr=", __FUNCTION__,
                                     mcptr->dmi_addr);
                        gt96100_add_hash_entry(dev, mcptr->dmi_addr);
                }