]> git.baikalelectronics.ru Git - kernel.git/commit
gianfar: Add macros for stepping through BDs
authorAndy Fleming <afleming@freescale.com>
Tue, 16 Dec 2008 23:33:40 +0000 (15:33 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Dec 2008 23:33:40 +0000 (15:33 -0800)
commite31af0b721cfcdb49a2698edcb578e7deb3dc19a
tree63b971edc7f662d402769cfaf3c50465f3aab48d
parent932c26ce672c5aee9f81971bb4d2e772f22a9bab
gianfar: Add macros for stepping through BDs

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: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/gianfar.c
drivers/net/gianfar.h