diff options
author | Jie Yang <jie.yang@atheros.com> | 2009-11-06 00:32:05 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-07 00:46:35 -0800 |
commit | c6060be46fbda5af651b6ed2b85502ccbb3d9279 (patch) | |
tree | 89ef8caaecd190a6ab29e38b78382775589e4050 /drivers/net/atl1c/atl1c.h | |
parent | d3bcfefaca27c1bfc8f740f5fff5b25d52ed1211 (diff) | |
download | op-kernel-dev-c6060be46fbda5af651b6ed2b85502ccbb3d9279.zip op-kernel-dev-c6060be46fbda5af651b6ed2b85502ccbb3d9279.tar.gz |
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 2a1120a..a348a22 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 */ |