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.c48
1 files changed, 18 insertions, 30 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index 7ed18cad29f7..736dde96c4a3 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:
@@ -3568,7 +3555,7 @@ static void bcm43xx_ieee80211_set_security(struct net_device *net_dev,
3568 unsigned long flags; 3555 unsigned long flags;
3569 int keyidx; 3556 int keyidx;
3570 3557
3571 dprintk(KERN_INFO PFX "set security called\n"); 3558 dprintk(KERN_INFO PFX "set security called");
3572 3559
3573 bcm43xx_lock_mmio(bcm, flags); 3560 bcm43xx_lock_mmio(bcm, flags);
3574 3561
@@ -3581,24 +3568,25 @@ static void bcm43xx_ieee80211_set_security(struct net_device *net_dev,
3581 3568
3582 if (sec->flags & SEC_ACTIVE_KEY) { 3569 if (sec->flags & SEC_ACTIVE_KEY) {
3583 secinfo->active_key = sec->active_key; 3570 secinfo->active_key = sec->active_key;
3584 dprintk(KERN_INFO PFX " .active_key = %d\n", sec->active_key); 3571 dprintk(", .active_key = %d", sec->active_key);
3585 } 3572 }
3586 if (sec->flags & SEC_UNICAST_GROUP) { 3573 if (sec->flags & SEC_UNICAST_GROUP) {
3587 secinfo->unicast_uses_group = sec->unicast_uses_group; 3574 secinfo->unicast_uses_group = sec->unicast_uses_group;
3588 dprintk(KERN_INFO PFX " .unicast_uses_group = %d\n", sec->unicast_uses_group); 3575 dprintk(", .unicast_uses_group = %d", sec->unicast_uses_group);
3589 } 3576 }
3590 if (sec->flags & SEC_LEVEL) { 3577 if (sec->flags & SEC_LEVEL) {
3591 secinfo->level = sec->level; 3578 secinfo->level = sec->level;
3592 dprintk(KERN_INFO PFX " .level = %d\n", sec->level); 3579 dprintk(", .level = %d", sec->level);
3593 } 3580 }
3594 if (sec->flags & SEC_ENABLED) { 3581 if (sec->flags & SEC_ENABLED) {
3595 secinfo->enabled = sec->enabled; 3582 secinfo->enabled = sec->enabled;
3596 dprintk(KERN_INFO PFX " .enabled = %d\n", sec->enabled); 3583 dprintk(", .enabled = %d", sec->enabled);
3597 } 3584 }
3598 if (sec->flags & SEC_ENCRYPT) { 3585 if (sec->flags & SEC_ENCRYPT) {
3599 secinfo->encrypt = sec->encrypt; 3586 secinfo->encrypt = sec->encrypt;
3600 dprintk(KERN_INFO PFX " .encrypt = %d\n", sec->encrypt); 3587 dprintk(", .encrypt = %d", sec->encrypt);
3601 } 3588 }
3589 dprintk("\n");
3602 if (bcm->initialized && !bcm->ieee->host_encrypt) { 3590 if (bcm->initialized && !bcm->ieee->host_encrypt) {
3603 if (secinfo->enabled) { 3591 if (secinfo->enabled) {
3604 /* upload WEP keys to hardware */ 3592 /* upload WEP keys to hardware */