diff options
author | Fugang Duan <B38611@freescale.com> | 2012-05-07 15:14:23 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-07-20 13:37:08 +0800 |
commit | 025d404cad7297956aaf8229b25df4aedcf2c2fb (patch) | |
tree | 53b4f66d474d05f77d0b1bc8018408f97a61de5a /drivers/net | |
parent | da24c7cd573a125d43b56ad1180340f04c1d2dd7 (diff) | |
download | linux-025d404cad7297956aaf8229b25df4aedcf2c2fb.tar.gz |
ENGR00179636-04 - FEC : allocate the enough DMA size for BD.
- Increase RX BD size to 384 entrys from 16 entrys, and allocate
the enough DMA memory for buffer description.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Diffstat (limited to 'drivers/net')
-rwxr-xr-x | drivers/net/fec.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 7897de31b9a0..6e710e11f1a4 100755 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -128,9 +128,7 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address"); #define TX_RING_SIZE 16 /* Must be power of two */ #define TX_RING_MOD_MASK 15 /* for this to work */ -#if (((RX_RING_SIZE + TX_RING_SIZE) * 8) > PAGE_SIZE) -#error "FEC: descriptor ring size constants too large" -#endif +#define BUFDES_SIZE ((RX_RING_SIZE + TX_RING_SIZE) * sizeof(struct bufdesc)) /* Interrupt events/masks. */ #define FEC_ENET_HBERR ((uint)0x80000000) /* Heartbeat error */ @@ -1467,7 +1465,7 @@ static int fec_enet_init(struct net_device *ndev) int i; /* Allocate memory for buffer descriptors. */ - cbd_base = dma_alloc_coherent(NULL, PAGE_SIZE, &fep->bd_dma, + cbd_base = dma_alloc_coherent(NULL, BUFDES_SIZE, &fep->bd_dma, GFP_KERNEL); if (!cbd_base) { printk("FEC: allocate descriptor memory failed?\n"); |