diff options
-rw-r--r-- | drivers/net/b44.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 5ff7882297d6..9332f4c2dc6f 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -59,7 +59,6 @@ | |||
59 | #define B44_DEF_TX_RING_PENDING (B44_TX_RING_SIZE - 1) | 59 | #define B44_DEF_TX_RING_PENDING (B44_TX_RING_SIZE - 1) |
60 | #define B44_TX_RING_BYTES (sizeof(struct dma_desc) * \ | 60 | #define B44_TX_RING_BYTES (sizeof(struct dma_desc) * \ |
61 | B44_TX_RING_SIZE) | 61 | B44_TX_RING_SIZE) |
62 | #define B44_DMA_MASK 0x3fffffff | ||
63 | 62 | ||
64 | #define TX_RING_GAP(BP) \ | 63 | #define TX_RING_GAP(BP) \ |
65 | (B44_TX_RING_SIZE - (BP)->tx_pending) | 64 | (B44_TX_RING_SIZE - (BP)->tx_pending) |
@@ -665,7 +664,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
665 | /* Hardware bug work-around, the chip is unable to do PCI DMA | 664 | /* Hardware bug work-around, the chip is unable to do PCI DMA |
666 | to/from anything above 1GB :-( */ | 665 | to/from anything above 1GB :-( */ |
667 | if (dma_mapping_error(mapping) || | 666 | if (dma_mapping_error(mapping) || |
668 | mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) { | 667 | mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) { |
669 | /* Sigh... */ | 668 | /* Sigh... */ |
670 | if (!dma_mapping_error(mapping)) | 669 | if (!dma_mapping_error(mapping)) |
671 | pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); | 670 | pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); |
@@ -677,7 +676,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
677 | RX_PKT_BUF_SZ, | 676 | RX_PKT_BUF_SZ, |
678 | PCI_DMA_FROMDEVICE); | 677 | PCI_DMA_FROMDEVICE); |
679 | if (dma_mapping_error(mapping) || | 678 | if (dma_mapping_error(mapping) || |
680 | mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) { | 679 | mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) { |
681 | if (!dma_mapping_error(mapping)) | 680 | if (!dma_mapping_error(mapping)) |
682 | pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); | 681 | pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); |
683 | dev_kfree_skb_any(skb); | 682 | dev_kfree_skb_any(skb); |
@@ -988,7 +987,7 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
988 | } | 987 | } |
989 | 988 | ||
990 | mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE); | 989 | mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE); |
991 | if (dma_mapping_error(mapping) || mapping + len > B44_DMA_MASK) { | 990 | if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) { |
992 | /* Chip can't handle DMA to/from >1GB, use bounce buffer */ | 991 | /* Chip can't handle DMA to/from >1GB, use bounce buffer */ |
993 | if (!dma_mapping_error(mapping)) | 992 | if (!dma_mapping_error(mapping)) |
994 | pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE); | 993 | pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE); |
@@ -1000,7 +999,7 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1000 | 999 | ||
1001 | mapping = pci_map_single(bp->pdev, bounce_skb->data, | 1000 | mapping = pci_map_single(bp->pdev, bounce_skb->data, |
1002 | len, PCI_DMA_TODEVICE); | 1001 | len, PCI_DMA_TODEVICE); |
1003 | if (dma_mapping_error(mapping) || mapping + len > B44_DMA_MASK) { | 1002 | if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) { |
1004 | if (!dma_mapping_error(mapping)) | 1003 | if (!dma_mapping_error(mapping)) |
1005 | pci_unmap_single(bp->pdev, mapping, | 1004 | pci_unmap_single(bp->pdev, mapping, |
1006 | len, PCI_DMA_TODEVICE); | 1005 | len, PCI_DMA_TODEVICE); |
@@ -1227,7 +1226,7 @@ static int b44_alloc_consistent(struct b44 *bp) | |||
1227 | DMA_BIDIRECTIONAL); | 1226 | DMA_BIDIRECTIONAL); |
1228 | 1227 | ||
1229 | if (dma_mapping_error(rx_ring_dma) || | 1228 | if (dma_mapping_error(rx_ring_dma) || |
1230 | rx_ring_dma + size > B44_DMA_MASK) { | 1229 | rx_ring_dma + size > DMA_30BIT_MASK) { |
1231 | kfree(rx_ring); | 1230 | kfree(rx_ring); |
1232 | goto out_err; | 1231 | goto out_err; |
1233 | } | 1232 | } |
@@ -1254,7 +1253,7 @@ static int b44_alloc_consistent(struct b44 *bp) | |||
1254 | DMA_TO_DEVICE); | 1253 | DMA_TO_DEVICE); |
1255 | 1254 | ||
1256 | if (dma_mapping_error(tx_ring_dma) || | 1255 | if (dma_mapping_error(tx_ring_dma) || |
1257 | tx_ring_dma + size > B44_DMA_MASK) { | 1256 | tx_ring_dma + size > DMA_30BIT_MASK) { |
1258 | kfree(tx_ring); | 1257 | kfree(tx_ring); |
1259 | goto out_err; | 1258 | goto out_err; |
1260 | } | 1259 | } |
@@ -2151,13 +2150,13 @@ static int __devinit b44_init_one(struct pci_dev *pdev, | |||
2151 | 2150 | ||
2152 | pci_set_master(pdev); | 2151 | pci_set_master(pdev); |
2153 | 2152 | ||
2154 | err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK); | 2153 | err = pci_set_dma_mask(pdev, (u64) DMA_30BIT_MASK); |
2155 | if (err) { | 2154 | if (err) { |
2156 | dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n"); | 2155 | dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n"); |
2157 | goto err_out_free_res; | 2156 | goto err_out_free_res; |
2158 | } | 2157 | } |
2159 | 2158 | ||
2160 | err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK); | 2159 | err = pci_set_consistent_dma_mask(pdev, (u64) DMA_30BIT_MASK); |
2161 | if (err) { | 2160 | if (err) { |
2162 | dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n"); | 2161 | dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n"); |
2163 | goto err_out_free_res; | 2162 | goto err_out_free_res; |