summaryrefslogtreecommitdiff
path: root/drivers/net/gianfar.h
diff options
context:
space:
mode:
authorDai Haruki <dai.haruki@freescale.com>2008-12-17 02:34:50 +0300
committerDavid S. Miller <davem@davemloft.net>2008-12-17 02:34:50 +0300
commit5a5efed4817ef931f648b118aeb9222e53122d2b (patch)
tree592f3dbe3bf47035e8738b1c4bbe48fc3be973fc /drivers/net/gianfar.h
parent31de198b4d2732028f4c5bff04b0103b1d8c1d8c (diff)
downloadlinux-5a5efed4817ef931f648b118aeb9222e53122d2b.tar.xz
gianfar: Make all BD status writes 32-bit
Whenever we want to update the status field in a BD, we usually want to update the length field, too. By combining them into one 32-bit field, we reduce the number of stores to memory shared with the controller, and we eliminate the need for order-enforcement, as the length and "READY" bit are now updated atomically at the same time. Signed-off-by: Dai Haruki <Dai.Haruki@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gianfar.h')
-rw-r--r--drivers/net/gianfar.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 1ebf7ac27a3d..9c8974dc8dd5 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -311,6 +311,8 @@ extern const char gfar_driver_version[];
#define ATTRELI_EI_MASK 0x00003fff
#define ATTRELI_EI(x) (x)
+#define BD_LFLAG(flags) ((flags) << 16)
+#define BD_LENGTH_MASK 0x00ff
/* TxBD status field bits */
#define TXBD_READY 0x8000
@@ -374,8 +376,13 @@ extern const char gfar_driver_version[];
struct txbd8
{
- u16 status; /* Status Fields */
- u16 length; /* Buffer length */
+ union {
+ struct {
+ u16 status; /* Status Fields */
+ u16 length; /* Buffer length */
+ };
+ u32 lstatus;
+ };
u32 bufPtr; /* Buffer Pointer */
};
@@ -390,8 +397,13 @@ struct txfcb {
struct rxbd8
{
- u16 status; /* Status Fields */
- u16 length; /* Buffer Length */
+ union {
+ struct {
+ u16 status; /* Status Fields */
+ u16 length; /* Buffer Length */
+ };
+ u32 lstatus;
+ };
u32 bufPtr; /* Buffer Pointer */
};