From: Fugang Duan Date: Mon, 7 May 2012 07:14:23 +0000 (+0800) Subject: ENGR00179636-04 - FEC : allocate the enough DMA size for BD. X-Git-Tag: v3.0.35-fsl~1081 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ed4ef1c4b54150811cf4d7f28b3b7173dd4cc8ac;p=karo-tx-linux.git 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 --- 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");