diff options
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_dma.c')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_dma.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c index 76e3aed4b471..978ed099e285 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c | |||
@@ -705,11 +705,30 @@ int bcm43xx_dma_init(struct bcm43xx_private *bcm) | |||
705 | struct bcm43xx_dmaring *ring; | 705 | struct bcm43xx_dmaring *ring; |
706 | int err = -ENOMEM; | 706 | int err = -ENOMEM; |
707 | int dma64 = 0; | 707 | int dma64 = 0; |
708 | u32 sbtmstatehi; | 708 | u64 mask = bcm43xx_get_supported_dma_mask(bcm); |
709 | int nobits; | ||
709 | 710 | ||
710 | sbtmstatehi = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATEHIGH); | 711 | if (mask == DMA_64BIT_MASK) { |
711 | if (sbtmstatehi & BCM43xx_SBTMSTATEHIGH_DMA64BIT) | ||
712 | dma64 = 1; | 712 | dma64 = 1; |
713 | nobits = 64; | ||
714 | } else if (mask == DMA_32BIT_MASK) | ||
715 | nobits = 32; | ||
716 | else | ||
717 | nobits = 30; | ||
718 | err = pci_set_dma_mask(bcm->pci_dev, mask); | ||
719 | err |= pci_set_consistent_dma_mask(bcm->pci_dev, mask); | ||
720 | if (err) { | ||
721 | #ifdef CONFIG_BCM43XX_PIO | ||
722 | printk(KERN_WARNING PFX "DMA not supported on this device." | ||
723 | " Falling back to PIO.\n"); | ||
724 | bcm->__using_pio = 1; | ||
725 | return -ENOSYS; | ||
726 | #else | ||
727 | printk(KERN_ERR PFX "FATAL: DMA not supported and PIO not configured. " | ||
728 | "Please recompile the driver with PIO support.\n"); | ||
729 | return -ENODEV; | ||
730 | #endif /* CONFIG_BCM43XX_PIO */ | ||
731 | } | ||
713 | 732 | ||
714 | /* setup TX DMA channels. */ | 733 | /* setup TX DMA channels. */ |
715 | ring = bcm43xx_setup_dmaring(bcm, 0, 1, dma64); | 734 | ring = bcm43xx_setup_dmaring(bcm, 0, 1, dma64); |
@@ -755,8 +774,7 @@ int bcm43xx_dma_init(struct bcm43xx_private *bcm) | |||
755 | dma->rx_ring3 = ring; | 774 | dma->rx_ring3 = ring; |
756 | } | 775 | } |
757 | 776 | ||
758 | dprintk(KERN_INFO PFX "%s DMA initialized\n", | 777 | dprintk(KERN_INFO PFX "%d-bit DMA initialized\n", nobits); |
759 | dma64 ? "64-bit" : "32-bit"); | ||
760 | err = 0; | 778 | err = 0; |
761 | out: | 779 | out: |
762 | return err; | 780 | return err; |