aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e100.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e100.c')
-rw-r--r--drivers/net/e100.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index a81c7b0c41b0..929701ca07d3 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -157,6 +157,7 @@
157#include <linux/init.h> 157#include <linux/init.h>
158#include <linux/pci.h> 158#include <linux/pci.h>
159#include <linux/dma-mapping.h> 159#include <linux/dma-mapping.h>
160#include <linux/dmapool.h>
160#include <linux/netdevice.h> 161#include <linux/netdevice.h>
161#include <linux/etherdevice.h> 162#include <linux/etherdevice.h>
162#include <linux/mii.h> 163#include <linux/mii.h>
@@ -602,6 +603,7 @@ struct nic {
602 struct mem *mem; 603 struct mem *mem;
603 dma_addr_t dma_addr; 604 dma_addr_t dma_addr;
604 605
606 struct pci_pool *cbs_pool;
605 dma_addr_t cbs_dma_addr; 607 dma_addr_t cbs_dma_addr;
606 u8 adaptive_ifs; 608 u8 adaptive_ifs;
607 u8 tx_threshold; 609 u8 tx_threshold;
@@ -1805,9 +1807,7 @@ static void e100_clean_cbs(struct nic *nic)
1805 nic->cb_to_clean = nic->cb_to_clean->next; 1807 nic->cb_to_clean = nic->cb_to_clean->next;
1806 nic->cbs_avail++; 1808 nic->cbs_avail++;
1807 } 1809 }
1808 pci_free_consistent(nic->pdev, 1810 pci_pool_free(nic->cbs_pool, nic->cbs, nic->cbs_dma_addr);
1809 sizeof(struct cb) * nic->params.cbs.count,
1810 nic->cbs, nic->cbs_dma_addr);
1811 nic->cbs = NULL; 1811 nic->cbs = NULL;
1812 nic->cbs_avail = 0; 1812 nic->cbs_avail = 0;
1813 } 1813 }
@@ -1825,8 +1825,8 @@ static int e100_alloc_cbs(struct nic *nic)
1825 nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL; 1825 nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL;
1826 nic->cbs_avail = 0; 1826 nic->cbs_avail = 0;
1827 1827
1828 nic->cbs = pci_alloc_consistent(nic->pdev, 1828 nic->cbs = pci_pool_alloc(nic->cbs_pool, GFP_KERNEL,
1829 sizeof(struct cb) * count, &nic->cbs_dma_addr); 1829 &nic->cbs_dma_addr);
1830 if (!nic->cbs) 1830 if (!nic->cbs)
1831 return -ENOMEM; 1831 return -ENOMEM;
1832 1832
@@ -2852,7 +2852,11 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2852 DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); 2852 DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n");
2853 goto err_out_free; 2853 goto err_out_free;
2854 } 2854 }
2855 2855 nic->cbs_pool = pci_pool_create(netdev->name,
2856 nic->pdev,
2857 nic->params.cbs.count * sizeof(struct cb),
2858 sizeof(u32),
2859 0);
2856 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n", 2860 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n",
2857 (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), 2861 (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0),
2858 pdev->irq, netdev->dev_addr); 2862 pdev->irq, netdev->dev_addr);
@@ -2882,6 +2886,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
2882 unregister_netdev(netdev); 2886 unregister_netdev(netdev);
2883 e100_free(nic); 2887 e100_free(nic);
2884 pci_iounmap(pdev, nic->csr); 2888 pci_iounmap(pdev, nic->csr);
2889 pci_pool_destroy(nic->cbs_pool);
2885 free_netdev(netdev); 2890 free_netdev(netdev);
2886 pci_release_regions(pdev); 2891 pci_release_regions(pdev);
2887 pci_disable_device(pdev); 2892 pci_disable_device(pdev);