[PATCH 4/5] macb: implement alloc_packet & free_packet

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Mar 5 12:55:15 EST 2012


On 13:08 Sun 04 Mar     , Sascha Hauer wrote:
> On Fri, Mar 02, 2012 at 07:20:09PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > We need to have a non cached buffer.
> > Need when MMU enabled.
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> > ---
> >  drivers/net/macb.c |   19 ++++++++++++++++---
> >  1 files changed, 16 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> > index d79da72..9b54afa 100644
> > --- a/drivers/net/macb.c
> > +++ b/drivers/net/macb.c
> > @@ -50,6 +50,7 @@
> >  #include <mach/board.h>
> >  #include <linux/clk.h>
> >  #include <linux/err.h>
> > +#include <asm/mmu.h>
> >  
> >  #include "macb.h"
> >  
> > @@ -391,6 +392,16 @@ static int macb_set_ethaddr(struct eth_device *edev, unsigned char *adr)
> >  	return 0;
> >  }
> >  
> > +static void *macb_alloc_packet(struct eth_device* edev)
> > +{
> > +	return dma_alloc_coherent(PKTSIZE);
> > +}
> > +
> > +static void macb_free_packet(struct eth_device* edev, void *packet)
> > +{
> > +	dma_free_coherent(packet, PKTSIZE);
> > +}
> 
> Why don't you use dma_flush_range/dma_clean_range like we do in other
> drivers?
yeah I did it last week-end but too much late and put the flush at thw wrong
place

now work send an update.

can you apply them on master as they fix the macb when MMU is enable on AT91

Best Regards,
J.



More information about the barebox mailing list