diff options
author | Jie Yang <jie.yang@atheros.com> | 2009-11-06 09:32:05 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-07 09:46:35 +0100 |
commit | c6060be46fbda5af651b6ed2b85502ccbb3d9279 (patch) | |
tree | 89ef8caaecd190a6ab29e38b78382775589e4050 /drivers/net/atl1c/atl1c.h | |
parent | net: Replace old style lock initializer (diff) | |
download | linux-c6060be46fbda5af651b6ed2b85502ccbb3d9279.tar.xz linux-c6060be46fbda5af651b6ed2b85502ccbb3d9279.zip |
atl1c: change atl1c_buffer struct and restructure clean atl1c_buffer procedure
change atl1c_buffer struct, use "u16 flags" instead of "u16 state"
to store more infomation for atl1c_buffer, and restructure clean
atl1c_buffer procedure, add common api atl1c_clean_buffer.
Signed-off-by: Jie Yang <jie.yang@atheros.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/atl1c/atl1c.h')
-rw-r--r-- | drivers/net/atl1c/atl1c.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h index 2a1120ad2e74..a348a22551d9 100644 --- a/drivers/net/atl1c/atl1c.h +++ b/drivers/net/atl1c/atl1c.h @@ -470,12 +470,28 @@ struct atl1c_ring_header { struct atl1c_buffer { struct sk_buff *skb; /* socket buffer */ u16 length; /* rx buffer length */ - u16 state; /* state of buffer */ -#define ATL1_BUFFER_FREE 0 -#define ATL1_BUFFER_BUSY 1 + u16 flags; /* information of buffer */ +#define ATL1C_BUFFER_FREE 0x0001 +#define ATL1C_BUFFER_BUSY 0x0002 +#define ATL1C_BUFFER_STATE_MASK 0x0003 + +#define ATL1C_PCIMAP_SINGLE 0x0004 +#define ATL1C_PCIMAP_PAGE 0x0008 +#define ATL1C_PCIMAP_TYPE_MASK 0x000C + dma_addr_t dma; }; +#define ATL1C_SET_BUFFER_STATE(buff, state) do { \ + ((buff)->flags) &= ~ATL1C_BUFFER_STATE_MASK; \ + ((buff)->flags) |= (state); \ + } while (0) + +#define ATL1C_SET_PCIMAP_TYPE(buff, type) do { \ + ((buff)->flags) &= ~ATL1C_PCIMAP_TYPE_MASK; \ + ((buff)->flags) |= (type); \ + } while (0) + /* transimit packet descriptor (tpd) ring */ struct atl1c_tpd_ring { void *desc; /* descriptor ring virtual address */ |