• Andy Fleming's avatar
    gianfar: Add macros for stepping through BDs · 31de198b
    Andy Fleming authored
    This code is based strongly on code from Dai Haruki <Dai.Haruki@freescale.com>.
    
    The gianfar Buffer Descriptors are arranged in a circular array, the end of
    which is denoted by setting the "WRAP" bit in the descriptor.  However, the
    software knows the end of the ring because it knows how many descriptors are
    there.  Rather than check each descriptor for whether the WRAP bit is set,
    use pointer math to determine where the next BD is.  This is also useful for
    when we want to look at BDs other than the very next one (for Scatter-Gather).
    Signed-off-by: default avatarAndy Fleming <afleming@freescale.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    31de198b
gianfar.c 57.7 KB