linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / net / fealnx.c
index 567e274..55dbe9a 100644 (file)
@@ -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[] =
+static char version[] __devinitdata =
 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE "\n";
 
 
@@ -124,8 +124,16 @@ MODULE_PARM_DESC(multicast_filter_limit, "fealnx maximum number of filtered mult
 MODULE_PARM_DESC(options, "fealnx: Bits 0-3: media type, bit 17: full duplex");
 MODULE_PARM_DESC(full_duplex, "fealnx full duplex setting(s) (1)");
 
-enum {
-       MIN_REGION_SIZE         = 136,
+#define MIN_REGION_SIZE 136
+
+enum pci_flags_bit {
+       PCI_USES_IO = 1,
+       PCI_USES_MEM = 2,
+       PCI_USES_MASTER = 4,
+       PCI_ADDR0 = 0x10 << 0,
+       PCI_ADDR1 = 0x10 << 1,
+       PCI_ADDR2 = 0x10 << 2,
+       PCI_ADDR3 = 0x10 << 3,
 };
 
 /* A chip capabilities table, matching the entries in pci_tbl[] above. */
@@ -148,13 +156,14 @@ enum phy_type_flags {
 
 struct chip_info {
        char *chip_name;
+       int io_size;
        int flags;
 };
 
-static const struct chip_info skel_netdrv_tbl[] __devinitdata = {
-       { "100/10M Ethernet PCI Adapter",       HAS_MII_XCVR },
-       { "100/10M Ethernet PCI Adapter",       HAS_CHIP_XCVR },
-       { "1000/100/10M Ethernet PCI Adapter",  HAS_MII_XCVR },
+static struct chip_info skel_netdrv_tbl[] = {
+       {"100/10M Ethernet PCI Adapter", 136, HAS_MII_XCVR},
+       {"100/10M Ethernet PCI Adapter", 136, HAS_CHIP_XCVR},
+       {"1000/100/10M Ethernet PCI Adapter", 136, HAS_MII_XCVR},
 };
 
 /* Offsets to the Command and Status Registers. */
@@ -505,14 +514,13 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
        
        len = pci_resource_len(pdev, bar);
        if (len < MIN_REGION_SIZE) {
-               dev_err(&pdev->dev,
-                          "region size %ld too small, aborting\n", len);
+               printk(KERN_ERR "%s: region size %ld too small, aborting\n",
+                      boardname, len);
                return -ENODEV;
        }
 
        i = pci_request_regions(pdev, boardname);
-       if (i)
-               return i;
+       if (i) return i;
        
        irq = pdev->irq;
 
@@ -578,9 +586,9 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
 
                        if (mii_status != 0xffff && mii_status != 0x0000) {
                                np->phys[phy_idx++] = phy;
-                               dev_info(&pdev->dev,
-                                      "MII PHY found at address %d, status "
-                                      "0x%4.4x.\n", phy, mii_status);
+                               printk(KERN_INFO
+                                      "%s: MII PHY found at address %d, status "
+                                      "0x%4.4x.\n", dev->name, phy, mii_status);
                                /* get phy type */
                                {
                                        unsigned int data;
@@ -603,10 +611,10 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
                }
 
                np->mii_cnt = phy_idx;
-               if (phy_idx == 0)
-                       dev_warn(&pdev->dev,
-                               "MII PHY not found -- this device may "
-                              "not operate correctly.\n");
+               if (phy_idx == 0) {
+                       printk(KERN_WARNING "%s: MII PHY not found -- this device may "
+                              "not operate correctly.\n", dev->name);
+               }
        } else {
                np->phys[0] = 32;
 /* 89/6/23 add, (begin) */
@@ -632,7 +640,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_info(&pdev->dev, "Media type forced to Full Duplex.\n");
+               printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name);
 /* 89/6/13 add, (begin) */
 //      if (np->PHYType==MarvellPHY)
                if ((np->PHYType == MarvellPHY) || (np->PHYType == LevelOnePHY)) {
@@ -836,7 +844,7 @@ static int netdev_open(struct net_device *dev)
 
        iowrite32(0x00000001, ioaddr + BCR);    /* Reset */
 
-       if (request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev))
+       if (request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev))
                return -EAGAIN;
 
        for (i = 0; i < 3; i++)