From ed4ef1c4b54150811cf4d7f28b3b7173dd4cc8ac Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Mon, 7 May 2012 15:14:23 +0800 Subject: [PATCH] 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 --- drivers/net/fec.c | 6 ++---- 1 file 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"); -- 2.39.5