Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133944
b: refs/heads/master
c: 4661e75
h: refs/heads/master
v: v3
  • Loading branch information
Sascha Hauer authored and David S. Miller committed Feb 1, 2009
1 parent d48b267 commit 183ca39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 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: 6989f5122f84046ba286efe8ce8be2fec42a1b7c
refs/heads/master: 4661e75b9d7bb12bcbe9be8bbf40ebf0845879a9
14 changes: 9 additions & 5 deletions trunk/drivers/net/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ struct fec_enet_private {

/* CPM dual port RAM relative addresses.
*/
dma_addr_t bd_dma;
cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */
cbd_t *tx_bd_base;
cbd_t *cur_rx, *cur_tx; /* The next free ring entry */
Expand Down Expand Up @@ -2107,7 +2108,8 @@ int __init fec_enet_init(struct net_device *dev)

/* Allocate memory for buffer descriptors.
*/
mem_addr = __get_free_page(GFP_KERNEL);
mem_addr = (unsigned long)dma_alloc_coherent(NULL, PAGE_SIZE,
&fep->bd_dma, GFP_KERNEL);
if (mem_addr == 0) {
printk("FEC: allocate descriptor memory failed?\n");
return -ENOMEM;
Expand Down Expand Up @@ -2202,8 +2204,9 @@ int __init fec_enet_init(struct net_device *dev)

/* Set receive and transmit descriptor base.
*/
fecp->fec_r_des_start = __pa((uint)(fep->rx_bd_base));
fecp->fec_x_des_start = __pa((uint)(fep->tx_bd_base));
fecp->fec_r_des_start = fep->bd_dma;
fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t)
* RX_RING_SIZE;

/* Install our interrupt handlers. This varies depending on
* the architecture.
Expand Down Expand Up @@ -2291,8 +2294,9 @@ fec_restart(struct net_device *dev, int duplex)

/* Set receive and transmit descriptor base.
*/
fecp->fec_r_des_start = __pa((uint)(fep->rx_bd_base));
fecp->fec_x_des_start = __pa((uint)(fep->tx_bd_base));
fecp->fec_r_des_start = fep->bd_dma;
fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t)
* RX_RING_SIZE;

fep->dirty_tx = fep->cur_tx = fep->tx_bd_base;
fep->cur_rx = fep->rx_bd_base;
Expand Down

0 comments on commit 183ca39

Please sign in to comment.