[GFS2] Fix up merge of Linus' kernel into GFS2
[pandora-kernel.git] / drivers / net / fealnx.c
index d26140a..191bd42 100644 (file)
@@ -25,8 +25,8 @@
 */
 
 #define DRV_NAME       "fealnx"
-#define DRV_VERSION    "2.51"
-#define DRV_RELDATE    "Nov-17-2001"
+#define DRV_VERSION    "2.52"
+#define DRV_RELDATE    "Sep-11-2006"
 
 static int debug;              /* 1-> print debug message */
 static int max_interrupt_work = 20;
@@ -92,7 +92,7 @@ static int full_duplex[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 };
 #include <asm/uaccess.h>
 
 /* These identify the driver base version and may not be removed. */
-static char version[] __devinitdata =
+static char version[] =
 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE "\n";
 
 
@@ -440,7 +440,7 @@ static void set_rx_mode(struct net_device *dev);
 static void __set_rx_mode(struct net_device *dev);
 static struct net_device_stats *get_stats(struct net_device *dev);
 static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-static struct ethtool_ops netdev_ethtool_ops;
+static const struct ethtool_ops netdev_ethtool_ops;
 static int netdev_close(struct net_device *dev);
 static void reset_rx_descriptors(struct net_device *dev);
 static void reset_tx_descriptors(struct net_device *dev);
@@ -486,26 +486,26 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
 #else
        int bar = 1;
 #endif
-       
+
 /* when built into the kernel, we only print version if device is found */
 #ifndef MODULE
        static int printed_version;
        if (!printed_version++)
                printk(version);
 #endif
-       
+
        card_idx++;
        sprintf(boardname, "fealnx%d", card_idx);
-       
+
        option = card_idx < MAX_UNITS ? options[card_idx] : 0;
 
        i = pci_enable_device(pdev);
        if (i) return i;
        pci_set_master(pdev);
-       
+
        len = pci_resource_len(pdev, bar);
        if (len < MIN_REGION_SIZE) {
-               dev_printk(KERN_ERR, &pdev->dev,
+               dev_err(&pdev->dev,
                           "region size %ld too small, aborting\n", len);
                return -ENODEV;
        }
@@ -513,7 +513,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
        i = pci_request_regions(pdev, boardname);
        if (i)
                return i;
-       
+
        irq = pdev->irq;
 
        ioaddr = pci_iomap(pdev, bar, len);
@@ -578,7 +578,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
 
                        if (mii_status != 0xffff && mii_status != 0x0000) {
                                np->phys[phy_idx++] = phy;
-                               dev_printk(KERN_INFO, &pdev->dev,
+                               dev_info(&pdev->dev,
                                       "MII PHY found at address %d, status "
                                       "0x%4.4x.\n", phy, mii_status);
                                /* get phy type */
@@ -604,7 +604,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
 
                np->mii_cnt = phy_idx;
                if (phy_idx == 0)
-                       dev_printk(KERN_WARNING, &pdev->dev,
+                       dev_warn(&pdev->dev,
                                "MII PHY not found -- this device may "
                               "not operate correctly.\n");
        } else {
@@ -632,8 +632,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
                np->mii.full_duplex = full_duplex[card_idx];
 
        if (np->mii.full_duplex) {
-               dev_printk(KERN_INFO, &pdev->dev,
-                       "Media type forced to Full Duplex.\n");
+               dev_info(&pdev->dev, "Media type forced to Full Duplex.\n");
 /* 89/6/13 add, (begin) */
 //      if (np->PHYType==MarvellPHY)
                if ((np->PHYType == MarvellPHY) || (np->PHYType == LevelOnePHY)) {
@@ -661,7 +660,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
        dev->ethtool_ops = &netdev_ethtool_ops;
        dev->tx_timeout = &tx_timeout;
        dev->watchdog_timeo = TX_TIMEOUT;
-       
+
        err = register_netdev(dev);
        if (err)
                goto err_out_free_tx;
@@ -866,25 +865,25 @@ static int netdev_open(struct net_device *dev)
           Tx and Rx queues and the address filter list.
           FIXME (Ueimor): optimistic for alpha + posted writes ? */
 #if defined(__powerpc__) || defined(__sparc__)
-// 89/9/1 modify, 
+// 89/9/1 modify,
 //   np->bcrvalue=0x04 | 0x0x38;  /* big-endian, 256 burst length */
        np->bcrvalue = 0x04 | 0x10;     /* big-endian, tx 8 burst length */
        np->crvalue = 0xe00;    /* rx 128 burst length */
 #elif defined(__alpha__) || defined(__x86_64__)
-// 89/9/1 modify, 
+// 89/9/1 modify,
 //   np->bcrvalue=0x38;           /* little-endian, 256 burst length */
        np->bcrvalue = 0x10;    /* little-endian, 8 burst length */
        np->crvalue = 0xe00;    /* rx 128 burst length */
 #elif defined(__i386__)
 #if defined(MODULE)
-// 89/9/1 modify, 
+// 89/9/1 modify,
 //   np->bcrvalue=0x38;           /* little-endian, 256 burst length */
        np->bcrvalue = 0x10;    /* little-endian, 8 burst length */
        np->crvalue = 0xe00;    /* rx 128 burst length */
 #else
        /* When not a module we can work around broken '486 PCI boards. */
 #define x86 boot_cpu_data.x86
-// 89/9/1 modify, 
+// 89/9/1 modify,
 //   np->bcrvalue=(x86 <= 4 ? 0x10 : 0x38);
        np->bcrvalue = 0x10;
        np->crvalue = (x86 <= 4 ? 0xa00 : 0xe00);
@@ -1161,7 +1160,7 @@ static void reset_and_disable_rxtx(struct net_device *dev)
        /* Reset the chip to erase previous misconfiguration. */
        iowrite32(0x00000001, ioaddr + BCR);
 
-       /* Ueimor: wait for 50 PCI cycles (and flush posted writes btw). 
+       /* Ueimor: wait for 50 PCI cycles (and flush posted writes btw).
           We surely wait too long (address+data phase). Who cares? */
        while (--delay) {
                ioread32(ioaddr + BCR);
@@ -1214,7 +1213,7 @@ static void reset_timer(unsigned long data)
        reset_tx_descriptors(dev); */
        enable_rxtx(dev);
        netif_start_queue(dev); /* FIXME: or netif_wake_queue(dev); ? */
-               
+
        np->reset_timer_armed = 0;
 
        spin_unlock_irqrestore(&np->lock, flags);
@@ -1240,7 +1239,7 @@ static void tx_timeout(struct net_device *dev)
                        printk(" %4.4x", np->tx_ring[i].status);
                printk("\n");
        }
-       
+
        spin_lock_irqsave(&np->lock, flags);
 
        reset_and_disable_rxtx(dev);
@@ -1510,7 +1509,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
                                stop_nic_rx(ioaddr, np->crvalue);
                                reset_rx_descriptors(dev);
                                iowrite32(np->crvalue, ioaddr + TCRRCR);
-                       }                               
+                       }
                }
 
                while (np->really_tx_count) {
@@ -1572,7 +1571,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
                        }
                        num_tx++;
                }               /* end of for loop */
-               
+
                if (num_tx && np->free_tx_count >= 2)
                        netif_wake_queue(dev);
 
@@ -1729,7 +1728,7 @@ static int netdev_rx(struct net_device *dev)
                                /* Call copy + cksum if available. */
 
 #if ! defined(__alpha__)
-                               eth_copy_and_sum(skb, 
+                               eth_copy_and_sum(skb,
                                        np->cur_rx->skbuff->data, pkt_len, 0);
                                skb_put(skb, pkt_len);
 #else
@@ -1801,8 +1800,6 @@ static void __set_rx_mode(struct net_device *dev)
        u32 rx_mode;
 
        if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
-               /* Unconditionally log net taps. */
-               printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
                memset(mc_filter, 0xff, sizeof(mc_filter));
                rx_mode = CR_W_PROM | CR_W_AB | CR_W_AM;
        } else if ((dev->mc_count > multicast_filter_limit)
@@ -1888,7 +1885,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 value)
        debug = value;
 }
 
-static struct ethtool_ops netdev_ethtool_ops = {
+static const struct ethtool_ops netdev_ethtool_ops = {
        .get_drvinfo            = netdev_get_drvinfo,
        .get_settings           = netdev_get_settings,
        .set_settings           = netdev_set_settings,
@@ -1985,7 +1982,7 @@ static int __init fealnx_init(void)
        printk(version);
 #endif
 
-       return pci_module_init(&fealnx_driver);
+       return pci_register_driver(&fealnx_driver);
 }
 
 static void __exit fealnx_exit(void)