Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168965
b: refs/heads/master
c: 98468ef
h: refs/heads/master
i:
  168963: e8d13da
v: v3
  • Loading branch information
Roger Oksanen authored and David S. Miller committed Nov 30, 2009
1 parent 3710466 commit 0299965
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5fdd4baef6195a1f2960e901c8877e2105f832ca
refs/heads/master: 98468efddb101f8a29af974101c17ba513b07be1
17 changes: 11 additions & 6 deletions trunk/drivers/net/e100.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/mii.h>
Expand Down Expand Up @@ -602,6 +603,7 @@ struct nic {
struct mem *mem;
dma_addr_t dma_addr;

struct pci_pool *cbs_pool;
dma_addr_t cbs_dma_addr;
u8 adaptive_ifs;
u8 tx_threshold;
Expand Down Expand Up @@ -1793,9 +1795,7 @@ static void e100_clean_cbs(struct nic *nic)
nic->cb_to_clean = nic->cb_to_clean->next;
nic->cbs_avail++;
}
pci_free_consistent(nic->pdev,
sizeof(struct cb) * nic->params.cbs.count,
nic->cbs, nic->cbs_dma_addr);
pci_pool_free(nic->cbs_pool, nic->cbs, nic->cbs_dma_addr);
nic->cbs = NULL;
nic->cbs_avail = 0;
}
Expand All @@ -1813,8 +1813,8 @@ static int e100_alloc_cbs(struct nic *nic)
nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL;
nic->cbs_avail = 0;

nic->cbs = pci_alloc_consistent(nic->pdev,
sizeof(struct cb) * count, &nic->cbs_dma_addr);
nic->cbs = pci_pool_alloc(nic->cbs_pool, GFP_KERNEL,
&nic->cbs_dma_addr);
if (!nic->cbs)
return -ENOMEM;

Expand Down Expand Up @@ -2841,7 +2841,11 @@ static int __devinit e100_probe(struct pci_dev *pdev,
DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n");
goto err_out_free;
}

nic->cbs_pool = pci_pool_create(netdev->name,
nic->pdev,
nic->params.cbs.count * sizeof(struct cb),
sizeof(u32),
0);
DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n",
(unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0),
pdev->irq, netdev->dev_addr);
Expand Down Expand Up @@ -2871,6 +2875,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
unregister_netdev(netdev);
e100_free(nic);
pci_iounmap(pdev, nic->csr);
pci_pool_destroy(nic->cbs_pool);
free_netdev(netdev);
pci_release_regions(pdev);
pci_disable_device(pdev);
Expand Down

0 comments on commit 0299965

Please sign in to comment.