aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcm43xx/bcm43xx_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_main.c')
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index 7ed18cad29f7..c0502905a956 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -128,13 +128,15 @@ MODULE_PARM_DESC(fwpostfix, "Postfix for .fw files. Useful for debugging.");
128 static struct pci_device_id bcm43xx_pci_tbl[] = { 128 static struct pci_device_id bcm43xx_pci_tbl[] = {
129 /* Broadcom 4303 802.11b */ 129 /* Broadcom 4303 802.11b */
130 { PCI_VENDOR_ID_BROADCOM, 0x4301, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 130 { PCI_VENDOR_ID_BROADCOM, 0x4301, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
131 /* Broadcom 4307 802.11b */ 131 /* Broadcom 4307 802.11b */
132 { PCI_VENDOR_ID_BROADCOM, 0x4307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 132 { PCI_VENDOR_ID_BROADCOM, 0x4307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
133 /* Broadcom 4318 802.11b/g */ 133 /* Broadcom 4318 802.11b/g */
134 { PCI_VENDOR_ID_BROADCOM, 0x4318, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 134 { PCI_VENDOR_ID_BROADCOM, 0x4318, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
135 /* Broadcom 4319 802.11a/b/g */
136 { PCI_VENDOR_ID_BROADCOM, 0x4319, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
135 /* Broadcom 4306 802.11b/g */ 137 /* Broadcom 4306 802.11b/g */
136 { PCI_VENDOR_ID_BROADCOM, 0x4320, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 138 { PCI_VENDOR_ID_BROADCOM, 0x4320, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
137 /* Broadcom 4306 802.11a */ 139 /* Broadcom 4306 802.11a */
138// { PCI_VENDOR_ID_BROADCOM, 0x4321, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 140// { PCI_VENDOR_ID_BROADCOM, 0x4321, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
139 /* Broadcom 4309 802.11a/b/g */ 141 /* Broadcom 4309 802.11a/b/g */
140 { PCI_VENDOR_ID_BROADCOM, 0x4324, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 142 { PCI_VENDOR_ID_BROADCOM, 0x4324, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
@@ -3299,8 +3301,7 @@ static void bcm43xx_detach_board(struct bcm43xx_private *bcm)
3299 3301
3300 bcm43xx_chipset_detach(bcm); 3302 bcm43xx_chipset_detach(bcm);
3301 /* Do _not_ access the chip, after it is detached. */ 3303 /* Do _not_ access the chip, after it is detached. */
3302 iounmap(bcm->mmio_addr); 3304 pci_iounmap(pci_dev, bcm->mmio_addr);
3303
3304 pci_release_regions(pci_dev); 3305 pci_release_regions(pci_dev);
3305 pci_disable_device(pci_dev); 3306 pci_disable_device(pci_dev);
3306 3307
@@ -3390,40 +3391,26 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm)
3390 struct net_device *net_dev = bcm->net_dev; 3391 struct net_device *net_dev = bcm->net_dev;
3391 int err; 3392 int err;
3392 int i; 3393 int i;
3393 unsigned long mmio_start, mmio_flags, mmio_len;
3394 u32 coremask; 3394 u32 coremask;
3395 3395
3396 err = pci_enable_device(pci_dev); 3396 err = pci_enable_device(pci_dev);
3397 if (err) { 3397 if (err) {
3398 printk(KERN_ERR PFX "unable to wake up pci device (%i)\n", err); 3398 printk(KERN_ERR PFX "pci_enable_device() failed\n");
3399 goto out; 3399 goto out;
3400 } 3400 }
3401 mmio_start = pci_resource_start(pci_dev, 0);
3402 mmio_flags = pci_resource_flags(pci_dev, 0);
3403 mmio_len = pci_resource_len(pci_dev, 0);
3404 if (!(mmio_flags & IORESOURCE_MEM)) {
3405 printk(KERN_ERR PFX
3406 "%s, region #0 not an MMIO resource, aborting\n",
3407 pci_name(pci_dev));
3408 err = -ENODEV;
3409 goto err_pci_disable;
3410 }
3411 err = pci_request_regions(pci_dev, KBUILD_MODNAME); 3401 err = pci_request_regions(pci_dev, KBUILD_MODNAME);
3412 if (err) { 3402 if (err) {
3413 printk(KERN_ERR PFX 3403 printk(KERN_ERR PFX "pci_request_regions() failed\n");
3414 "could not access PCI resources (%i)\n", err);
3415 goto err_pci_disable; 3404 goto err_pci_disable;
3416 } 3405 }
3417 /* enable PCI bus-mastering */ 3406 /* enable PCI bus-mastering */
3418 pci_set_master(pci_dev); 3407 pci_set_master(pci_dev);
3419 bcm->mmio_addr = ioremap(mmio_start, mmio_len); 3408 bcm->mmio_addr = pci_iomap(pci_dev, 0, ~0UL);
3420 if (!bcm->mmio_addr) { 3409 if (!bcm->mmio_addr) {
3421 printk(KERN_ERR PFX "%s: cannot remap MMIO, aborting\n", 3410 printk(KERN_ERR PFX "pci_iomap() failed\n");
3422 pci_name(pci_dev));
3423 err = -EIO; 3411 err = -EIO;
3424 goto err_pci_release; 3412 goto err_pci_release;
3425 } 3413 }
3426 bcm->mmio_len = mmio_len;
3427 net_dev->base_addr = (unsigned long)bcm->mmio_addr; 3414 net_dev->base_addr = (unsigned long)bcm->mmio_addr;
3428 3415
3429 bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID, 3416 bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID,
@@ -3517,7 +3504,7 @@ err_80211_unwind:
3517err_chipset_detach: 3504err_chipset_detach:
3518 bcm43xx_chipset_detach(bcm); 3505 bcm43xx_chipset_detach(bcm);
3519err_iounmap: 3506err_iounmap:
3520 iounmap(bcm->mmio_addr); 3507 pci_iounmap(pci_dev, bcm->mmio_addr);
3521err_pci_release: 3508err_pci_release:
3522 pci_release_regions(pci_dev); 3509 pci_release_regions(pci_dev);
3523err_pci_disable: 3510err_pci_disable: