aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.c30
1 files changed, 4 insertions, 26 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index e26507b11f02..6a877df2ecf0 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -3386,23 +3386,17 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm)
3386 struct net_device *net_dev = bcm->net_dev; 3386 struct net_device *net_dev = bcm->net_dev;
3387 int err; 3387 int err;
3388 int i; 3388 int i;
3389 void __iomem *ioaddr; 3389 unsigned long mmio_start, mmio_flags, mmio_len;
3390 unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
3391 u32 coremask; 3390 u32 coremask;
3392 3391
3393 err = pci_enable_device(pci_dev); 3392 err = pci_enable_device(pci_dev);
3394 if (err) { 3393 if (err) {
3395 printk(KERN_ERR PFX "unable to wake up pci device (%i)\n", err); 3394 printk(KERN_ERR PFX "unable to wake up pci device (%i)\n", err);
3396 err = -ENODEV;
3397 goto out; 3395 goto out;
3398 } 3396 }
3399
3400 mmio_start = pci_resource_start(pci_dev, 0); 3397 mmio_start = pci_resource_start(pci_dev, 0);
3401 mmio_end = pci_resource_end(pci_dev, 0);
3402 mmio_flags = pci_resource_flags(pci_dev, 0); 3398 mmio_flags = pci_resource_flags(pci_dev, 0);
3403 mmio_len = pci_resource_len(pci_dev, 0); 3399 mmio_len = pci_resource_len(pci_dev, 0);
3404
3405 /* make sure PCI base addr is MMIO */
3406 if (!(mmio_flags & IORESOURCE_MEM)) { 3400 if (!(mmio_flags & IORESOURCE_MEM)) {
3407 printk(KERN_ERR PFX 3401 printk(KERN_ERR PFX
3408 "%s, region #0 not an MMIO resource, aborting\n", 3402 "%s, region #0 not an MMIO resource, aborting\n",
@@ -3410,39 +3404,23 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm)
3410 err = -ENODEV; 3404 err = -ENODEV;
3411 goto err_pci_disable; 3405 goto err_pci_disable;
3412 } 3406 }
3413//FIXME: Why is this check disabled for BCM947XX? What is the IO_SIZE there?
3414#ifndef CONFIG_BCM947XX
3415 if (mmio_len != BCM43xx_IO_SIZE) {
3416 printk(KERN_ERR PFX
3417 "%s: invalid PCI mem region size(s), aborting\n",
3418 pci_name(pci_dev));
3419 err = -ENODEV;
3420 goto err_pci_disable;
3421 }
3422#endif
3423
3424 err = pci_request_regions(pci_dev, KBUILD_MODNAME); 3407 err = pci_request_regions(pci_dev, KBUILD_MODNAME);
3425 if (err) { 3408 if (err) {
3426 printk(KERN_ERR PFX 3409 printk(KERN_ERR PFX
3427 "could not access PCI resources (%i)\n", err); 3410 "could not access PCI resources (%i)\n", err);
3428 goto err_pci_disable; 3411 goto err_pci_disable;
3429 } 3412 }
3430
3431 /* enable PCI bus-mastering */ 3413 /* enable PCI bus-mastering */
3432 pci_set_master(pci_dev); 3414 pci_set_master(pci_dev);
3433 3415 bcm->mmio_addr = ioremap(mmio_start, mmio_len);
3434 /* ioremap MMIO region */ 3416 if (!bcm->mmio_addr) {
3435 ioaddr = ioremap(mmio_start, mmio_len);
3436 if (!ioaddr) {
3437 printk(KERN_ERR PFX "%s: cannot remap MMIO, aborting\n", 3417 printk(KERN_ERR PFX "%s: cannot remap MMIO, aborting\n",
3438 pci_name(pci_dev)); 3418 pci_name(pci_dev));
3439 err = -EIO; 3419 err = -EIO;
3440 goto err_pci_release; 3420 goto err_pci_release;
3441 } 3421 }
3442
3443 net_dev->base_addr = (unsigned long)ioaddr;
3444 bcm->mmio_addr = ioaddr;
3445 bcm->mmio_len = mmio_len; 3422 bcm->mmio_len = mmio_len;
3423 net_dev->base_addr = (unsigned long)bcm->mmio_addr;
3446 3424
3447 bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID, 3425 bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID,
3448 &bcm->board_vendor); 3426 &bcm->board_vendor);