diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-01-06 19:57:40 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-09 10:32:40 -0500 |
commit | bce7c95e4dd4d5e924deb2929b639b4caca09c93 (patch) | |
tree | 0ed78b75ba55aada28f4f02a1f5f89da5b55125d | |
parent | 17fa6e2f115ad734ef802b663071159a1a64d06f (diff) |
[PATCH] sk98lin: not doing high dma properly
Sk98lin 64bit memory handling is wrong. It doesn't set the
highdma flag; i.e. the kernel always does bounce buffers.
It doesn't fallback to 32 bit mask if it can't get 64 bit mask.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r-- | drivers/net/sk98lin/skge.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c index 3302d644011f..9a879530ef6d 100644 --- a/drivers/net/sk98lin/skge.c +++ b/drivers/net/sk98lin/skge.c | |||
@@ -4775,16 +4775,30 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4775 | struct net_device *dev = NULL; | 4775 | struct net_device *dev = NULL; |
4776 | static int boards_found = 0; | 4776 | static int boards_found = 0; |
4777 | int error = -ENODEV; | 4777 | int error = -ENODEV; |
4778 | int using_dac = 0; | ||
4778 | char DeviceStr[80]; | 4779 | char DeviceStr[80]; |
4779 | 4780 | ||
4780 | if (pci_enable_device(pdev)) | 4781 | if (pci_enable_device(pdev)) |
4781 | goto out; | 4782 | goto out; |
4782 | 4783 | ||
4783 | /* Configure DMA attributes. */ | 4784 | /* Configure DMA attributes. */ |
4784 | if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) && | 4785 | if (sizeof(dma_addr_t) > sizeof(u32) && |
4785 | pci_set_dma_mask(pdev, DMA_32BIT_MASK)) | 4786 | !(error = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) { |
4786 | goto out_disable_device; | 4787 | using_dac = 1; |
4787 | 4788 | error = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); | |
4789 | if (error < 0) { | ||
4790 | printk(KERN_ERR "sk98lin %s unable to obtain 64 bit DMA " | ||
4791 | "for consistent allocations\n", pci_name(pdev)); | ||
4792 | goto out_disable_device; | ||
4793 | } | ||
4794 | } else { | ||
4795 | error = pci_set_dma_mask(pdev, DMA_32BIT_MASK); | ||
4796 | if (error) { | ||
4797 | printk(KERN_ERR "sk98lin %s no usable DMA configuration\n", | ||
4798 | pci_name(pdev)); | ||
4799 | goto out_disable_device; | ||
4800 | } | ||
4801 | } | ||
4788 | 4802 | ||
4789 | if ((dev = alloc_etherdev(sizeof(DEV_NET))) == NULL) { | 4803 | if ((dev = alloc_etherdev(sizeof(DEV_NET))) == NULL) { |
4790 | printk(KERN_ERR "Unable to allocate etherdev " | 4804 | printk(KERN_ERR "Unable to allocate etherdev " |
@@ -4843,6 +4857,9 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4843 | #endif | 4857 | #endif |
4844 | } | 4858 | } |
4845 | 4859 | ||
4860 | if (using_dac) | ||
4861 | dev->features |= NETIF_F_HIGHDMA; | ||
4862 | |||
4846 | pAC->Index = boards_found++; | 4863 | pAC->Index = boards_found++; |
4847 | 4864 | ||
4848 | if (SkGeBoardInit(dev, pAC)) | 4865 | if (SkGeBoardInit(dev, pAC)) |
@@ -4919,6 +4936,9 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4919 | #endif | 4936 | #endif |
4920 | } | 4937 | } |
4921 | 4938 | ||
4939 | if (using_dac) | ||
4940 | dev->features |= NETIF_F_HIGHDMA; | ||
4941 | |||
4922 | if (register_netdev(dev)) { | 4942 | if (register_netdev(dev)) { |
4923 | printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n"); | 4943 | printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n"); |
4924 | free_netdev(dev); | 4944 | free_netdev(dev); |