X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fnet%2Ffealnx.c;fp=drivers%2Fnet%2Ffealnx.c;h=567e27413cfdc4cc9d999e8d1d17f2b060d21301;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=a8449265e5fd5a2dbae2ffb2ee9b6ec297a3d79c;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;p=linux-2.6.git diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c index a8449265e..567e27413 100644 --- a/drivers/net/fealnx.c +++ b/drivers/net/fealnx.c @@ -92,7 +92,7 @@ static int full_duplex[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 }; #include /* 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"; @@ -124,16 +124,8 @@ 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)"); -#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, +enum { + MIN_REGION_SIZE = 136, }; /* A chip capabilities table, matching the entries in pci_tbl[] above. */ @@ -156,14 +148,13 @@ enum phy_type_flags { struct chip_info { char *chip_name; - int io_size; int flags; }; -static const 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}, +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 }, }; /* Offsets to the Command and Status Registers. */ @@ -514,13 +505,14 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev, len = pci_resource_len(pdev, bar); if (len < MIN_REGION_SIZE) { - printk(KERN_ERR "%s: region size %ld too small, aborting\n", - boardname, len); + dev_err(&pdev->dev, + "region size %ld too small, aborting\n", len); return -ENODEV; } i = pci_request_regions(pdev, boardname); - if (i) return i; + if (i) + return i; irq = pdev->irq; @@ -586,9 +578,9 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev, if (mii_status != 0xffff && mii_status != 0x0000) { np->phys[phy_idx++] = phy; - printk(KERN_INFO - "%s: MII PHY found at address %d, status " - "0x%4.4x.\n", dev->name, phy, mii_status); + dev_info(&pdev->dev, + "MII PHY found at address %d, status " + "0x%4.4x.\n", phy, mii_status); /* get phy type */ { unsigned int data; @@ -611,10 +603,10 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev, } np->mii_cnt = phy_idx; - if (phy_idx == 0) { - printk(KERN_WARNING "%s: MII PHY not found -- this device may " - "not operate correctly.\n", dev->name); - } + if (phy_idx == 0) + dev_warn(&pdev->dev, + "MII PHY not found -- this device may " + "not operate correctly.\n"); } else { np->phys[0] = 32; /* 89/6/23 add, (begin) */ @@ -640,7 +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) { - printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name); + 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)) { @@ -844,7 +836,7 @@ static int netdev_open(struct net_device *dev) iowrite32(0x00000001, ioaddr + BCR); /* Reset */ - if (request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev)) + if (request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev)) return -EAGAIN; for (i = 0; i < 3; i++)