diff options
author | Olof Johansson <olof@lixom.net> | 2008-02-20 21:57:59 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2008-03-05 17:34:41 -0500 |
commit | e37c772e36a7943b2e0bd8f48312e78474c0df15 (patch) | |
tree | 7f4fdfd2ecc3f598f74de18ddafd78d6898fdd9d /drivers/net/pasemi_mac.h | |
parent | 251567848f2f446f4356f969329a8188faf1fe90 (diff) |
pasemi_mac: basic ethtool support
First cut at ethtool support, to be completed over time.
Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/pasemi_mac.h')
-rw-r--r-- | drivers/net/pasemi_mac.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/pasemi_mac.h b/drivers/net/pasemi_mac.h index 90c51670a1e7..1a115ec60b53 100644 --- a/drivers/net/pasemi_mac.h +++ b/drivers/net/pasemi_mac.h | |||
@@ -26,6 +26,12 @@ | |||
26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
27 | #include <linux/phy.h> | 27 | #include <linux/phy.h> |
28 | 28 | ||
29 | /* Must be a power of two */ | ||
30 | #define RX_RING_SIZE 2048 | ||
31 | #define TX_RING_SIZE 4096 | ||
32 | #define CS_RING_SIZE (TX_RING_SIZE*2) | ||
33 | |||
34 | |||
29 | #define MAX_LRO_DESCRIPTORS 8 | 35 | #define MAX_LRO_DESCRIPTORS 8 |
30 | #define MAX_CS 2 | 36 | #define MAX_CS 2 |
31 | 37 | ||
@@ -103,6 +109,16 @@ struct pasemi_mac_buffer { | |||
103 | dma_addr_t dma; | 109 | dma_addr_t dma; |
104 | }; | 110 | }; |
105 | 111 | ||
112 | #define TX_DESC(tx, num) ((tx)->chan.ring_virt[(num) & (TX_RING_SIZE-1)]) | ||
113 | #define TX_DESC_INFO(tx, num) ((tx)->ring_info[(num) & (TX_RING_SIZE-1)]) | ||
114 | #define RX_DESC(rx, num) ((rx)->chan.ring_virt[(num) & (RX_RING_SIZE-1)]) | ||
115 | #define RX_DESC_INFO(rx, num) ((rx)->ring_info[(num) & (RX_RING_SIZE-1)]) | ||
116 | #define RX_BUFF(rx, num) ((rx)->buffers[(num) & (RX_RING_SIZE-1)]) | ||
117 | #define CS_DESC(cs, num) ((cs)->chan.ring_virt[(num) & (CS_RING_SIZE-1)]) | ||
118 | |||
119 | #define RING_USED(ring) (((ring)->next_to_fill - (ring)->next_to_clean) \ | ||
120 | & ((ring)->size - 1)) | ||
121 | #define RING_AVAIL(ring) ((ring->size) - RING_USED(ring)) | ||
106 | 122 | ||
107 | /* PCI register offsets and formats */ | 123 | /* PCI register offsets and formats */ |
108 | 124 | ||
@@ -114,6 +130,7 @@ enum { | |||
114 | PAS_MAC_CFG_ADR0 = 0x8c, | 130 | PAS_MAC_CFG_ADR0 = 0x8c, |
115 | PAS_MAC_CFG_ADR1 = 0x90, | 131 | PAS_MAC_CFG_ADR1 = 0x90, |
116 | PAS_MAC_CFG_TXP = 0x98, | 132 | PAS_MAC_CFG_TXP = 0x98, |
133 | PAS_MAC_CFG_RMON = 0x100, | ||
117 | PAS_MAC_IPC_CHNL = 0x208, | 134 | PAS_MAC_IPC_CHNL = 0x208, |
118 | }; | 135 | }; |
119 | 136 | ||
@@ -185,6 +202,8 @@ enum { | |||
185 | #define PAS_MAC_CFG_TXP_TIFG(x) (((x) << PAS_MAC_CFG_TXP_TIFG_S) & \ | 202 | #define PAS_MAC_CFG_TXP_TIFG(x) (((x) << PAS_MAC_CFG_TXP_TIFG_S) & \ |
186 | PAS_MAC_CFG_TXP_TIFG_M) | 203 | PAS_MAC_CFG_TXP_TIFG_M) |
187 | 204 | ||
205 | #define PAS_MAC_RMON(r) (0x100+(r)*4) | ||
206 | |||
188 | #define PAS_MAC_IPC_CHNL_DCHNO_M 0x003f0000 | 207 | #define PAS_MAC_IPC_CHNL_DCHNO_M 0x003f0000 |
189 | #define PAS_MAC_IPC_CHNL_DCHNO_S 16 | 208 | #define PAS_MAC_IPC_CHNL_DCHNO_S 16 |
190 | #define PAS_MAC_IPC_CHNL_DCHNO(x) (((x) << PAS_MAC_IPC_CHNL_DCHNO_S) & \ | 209 | #define PAS_MAC_IPC_CHNL_DCHNO(x) (((x) << PAS_MAC_IPC_CHNL_DCHNO_S) & \ |
@@ -194,4 +213,5 @@ enum { | |||
194 | #define PAS_MAC_IPC_CHNL_BCH(x) (((x) << PAS_MAC_IPC_CHNL_BCH_S) & \ | 213 | #define PAS_MAC_IPC_CHNL_BCH(x) (((x) << PAS_MAC_IPC_CHNL_BCH_S) & \ |
195 | PAS_MAC_IPC_CHNL_BCH_M) | 214 | PAS_MAC_IPC_CHNL_BCH_M) |
196 | 215 | ||
216 | |||
197 | #endif /* PASEMI_MAC_H */ | 217 | #endif /* PASEMI_MAC_H */ |