]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00179636-04 - FEC : allocate the enough DMA size for BD.
authorFugang Duan <B38611@freescale.com>
Mon, 7 May 2012 07:14:23 +0000 (15:14 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:34 +0000 (08:34 +0200)
- 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>
drivers/net/fec.c

index 7897de31b9a008bfdfbfbd76a41c6a57323ea6c1..6e710e11f1a4d7999851caa6391e5fe70b482a0f 100755 (executable)
@@ -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");