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.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index bad3452ea893..a94c6d8826f8 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -2925,10 +2925,13 @@ static int bcm43xx_wireless_core_init(struct bcm43xx_private *bcm,
2925 bcm43xx_write16(bcm, 0x043C, 0x000C); 2925 bcm43xx_write16(bcm, 0x043C, 0x000C);
2926 2926
2927 if (active_wlcore) { 2927 if (active_wlcore) {
2928 if (bcm43xx_using_pio(bcm)) 2928 if (bcm43xx_using_pio(bcm)) {
2929 err = bcm43xx_pio_init(bcm); 2929 err = bcm43xx_pio_init(bcm);
2930 else 2930 } else {
2931 err = bcm43xx_dma_init(bcm); 2931 err = bcm43xx_dma_init(bcm);
2932 if (err == -ENOSYS)
2933 err = bcm43xx_pio_init(bcm);
2934 }
2932 if (err) 2935 if (err)
2933 goto err_chip_cleanup; 2936 goto err_chip_cleanup;
2934 } 2937 }
@@ -3164,12 +3167,12 @@ static void bcm43xx_periodic_work_handler(void *d)
3164 u32 savedirqs = 0; 3167 u32 savedirqs = 0;
3165 int badness; 3168 int badness;
3166 3169
3170 mutex_lock(&bcm->mutex);
3167 badness = estimate_periodic_work_badness(bcm->periodic_state); 3171 badness = estimate_periodic_work_badness(bcm->periodic_state);
3168 if (badness > BADNESS_LIMIT) { 3172 if (badness > BADNESS_LIMIT) {
3169 /* Periodic work will take a long time, so we want it to 3173 /* Periodic work will take a long time, so we want it to
3170 * be preemtible. 3174 * be preemtible.
3171 */ 3175 */
3172 mutex_lock(&bcm->mutex);
3173 netif_tx_disable(bcm->net_dev); 3176 netif_tx_disable(bcm->net_dev);
3174 spin_lock_irqsave(&bcm->irq_lock, flags); 3177 spin_lock_irqsave(&bcm->irq_lock, flags);
3175 bcm43xx_mac_suspend(bcm); 3178 bcm43xx_mac_suspend(bcm);
@@ -3182,7 +3185,6 @@ static void bcm43xx_periodic_work_handler(void *d)
3182 /* Periodic work should take short time, so we want low 3185 /* Periodic work should take short time, so we want low
3183 * locking overhead. 3186 * locking overhead.
3184 */ 3187 */
3185 mutex_lock(&bcm->mutex);
3186 spin_lock_irqsave(&bcm->irq_lock, flags); 3188 spin_lock_irqsave(&bcm->irq_lock, flags);
3187 } 3189 }
3188 3190
@@ -3993,8 +3995,6 @@ static int bcm43xx_init_private(struct bcm43xx_private *bcm,
3993 struct net_device *net_dev, 3995 struct net_device *net_dev,
3994 struct pci_dev *pci_dev) 3996 struct pci_dev *pci_dev)
3995{ 3997{
3996 int err;
3997
3998 bcm43xx_set_status(bcm, BCM43xx_STAT_UNINIT); 3998 bcm43xx_set_status(bcm, BCM43xx_STAT_UNINIT);
3999 bcm->ieee = netdev_priv(net_dev); 3999 bcm->ieee = netdev_priv(net_dev);
4000 bcm->softmac = ieee80211_priv(net_dev); 4000 bcm->softmac = ieee80211_priv(net_dev);
@@ -4012,22 +4012,8 @@ static int bcm43xx_init_private(struct bcm43xx_private *bcm,
4012 (void (*)(unsigned long))bcm43xx_interrupt_tasklet, 4012 (void (*)(unsigned long))bcm43xx_interrupt_tasklet,
4013 (unsigned long)bcm); 4013 (unsigned long)bcm);
4014 tasklet_disable_nosync(&bcm->isr_tasklet); 4014 tasklet_disable_nosync(&bcm->isr_tasklet);
4015 if (modparam_pio) { 4015 if (modparam_pio)
4016 bcm->__using_pio = 1; 4016 bcm->__using_pio = 1;
4017 } else {
4018 err = pci_set_dma_mask(pci_dev, DMA_30BIT_MASK);
4019 err |= pci_set_consistent_dma_mask(pci_dev, DMA_30BIT_MASK);
4020 if (err) {
4021#ifdef CONFIG_BCM43XX_PIO
4022 printk(KERN_WARNING PFX "DMA not supported. Falling back to PIO.\n");
4023 bcm->__using_pio = 1;
4024#else
4025 printk(KERN_ERR PFX "FATAL: DMA not supported and PIO not configured. "
4026 "Recompile the driver with PIO support, please.\n");
4027 return -ENODEV;
4028#endif /* CONFIG_BCM43XX_PIO */
4029 }
4030 }
4031 bcm->rts_threshold = BCM43xx_DEFAULT_RTS_THRESHOLD; 4017 bcm->rts_threshold = BCM43xx_DEFAULT_RTS_THRESHOLD;
4032 4018
4033 /* default to sw encryption for now */ 4019 /* default to sw encryption for now */
@@ -4208,7 +4194,11 @@ static int bcm43xx_resume(struct pci_dev *pdev)
4208 dprintk(KERN_INFO PFX "Resuming...\n"); 4194 dprintk(KERN_INFO PFX "Resuming...\n");
4209 4195
4210 pci_set_power_state(pdev, 0); 4196 pci_set_power_state(pdev, 0);
4211 pci_enable_device(pdev); 4197 err = pci_enable_device(pdev);
4198 if (err) {
4199 printk(KERN_ERR PFX "Failure with pci_enable_device!\n");
4200 return err;
4201 }
4212 pci_restore_state(pdev); 4202 pci_restore_state(pdev);
4213 4203
4214 bcm43xx_chipset_attach(bcm); 4204 bcm43xx_chipset_attach(bcm);