diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2006-12-11 18:13:48 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-05 16:58:43 -0500 |
commit | 834324687d08e0f67b167934cb56406aa98ff8c6 (patch) | |
tree | bafd6715f66bf7ad17bcabb4fabfbeffbddd1538 /drivers/net/chelsio/vsc7326_reg.h | |
parent | 3e0f75be52605a901165fa1d8acf4ffd37a4857b (diff) |
chelsio: tabulate the update of the statistic counters
Let's try to avoid some code duplication.
- cxgb2
The data are contiguous. Use plain memcpy.
- ixf1010/pm3393/vsc7326
The cast of &mac->stats to (u64 *) is not wonderful but it is not clear
if it is worth to add an ad-hoc union under the struct cmac_statistics.
vsc7326_reg.h suggests that more statistics could be available.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/chelsio/vsc7326_reg.h')
-rw-r--r-- | drivers/net/chelsio/vsc7326_reg.h | 139 |
1 files changed, 75 insertions, 64 deletions
diff --git a/drivers/net/chelsio/vsc7326_reg.h b/drivers/net/chelsio/vsc7326_reg.h index 491bcf75c4fb..479edbcabe68 100644 --- a/drivers/net/chelsio/vsc7326_reg.h +++ b/drivers/net/chelsio/vsc7326_reg.h | |||
@@ -192,73 +192,84 @@ | |||
192 | #define REG_HDX(pn) CRA(0x1,pn,0x19) /* Half-duplex config */ | 192 | #define REG_HDX(pn) CRA(0x1,pn,0x19) /* Half-duplex config */ |
193 | 193 | ||
194 | /* Statistics */ | 194 | /* Statistics */ |
195 | /* CRA(0x4,pn,reg) */ | ||
196 | /* reg below */ | ||
195 | /* pn = port number, 0-a, a = 10GbE */ | 197 | /* pn = port number, 0-a, a = 10GbE */ |
196 | #define REG_RX_IN_BYTES(pn) CRA(0x4,pn,0x00) /* # Rx in octets */ | ||
197 | #define REG_RX_SYMBOL_CARRIER(pn) CRA(0x4,pn,0x01) /* Frames w/ symbol errors */ | ||
198 | #define REG_RX_PAUSE(pn) CRA(0x4,pn,0x02) /* # pause frames received */ | ||
199 | #define REG_RX_UNSUP_OPCODE(pn) CRA(0x4,pn,0x03) /* # control frames with unsupported opcode */ | ||
200 | #define REG_RX_OK_BYTES(pn) CRA(0x4,pn,0x04) /* # octets in good frames */ | ||
201 | #define REG_RX_BAD_BYTES(pn) CRA(0x4,pn,0x05) /* # octets in bad frames */ | ||
202 | #define REG_RX_UNICAST(pn) CRA(0x4,pn,0x06) /* # good unicast frames */ | ||
203 | #define REG_RX_MULTICAST(pn) CRA(0x4,pn,0x07) /* # good multicast frames */ | ||
204 | #define REG_RX_BROADCAST(pn) CRA(0x4,pn,0x08) /* # good broadcast frames */ | ||
205 | #define REG_CRC(pn) CRA(0x4,pn,0x09) /* # frames w/ bad CRC only */ | ||
206 | #define REG_RX_ALIGNMENT(pn) CRA(0x4,pn,0x0a) /* # frames w/ alignment err */ | ||
207 | #define REG_RX_UNDERSIZE(pn) CRA(0x4,pn,0x0b) /* # frames undersize */ | ||
208 | #define REG_RX_FRAGMENTS(pn) CRA(0x4,pn,0x0c) /* # frames undersize w/ crc err */ | ||
209 | #define REG_RX_IN_RANGE_LENGTH_ERROR(pn) CRA(0x4,pn,0x0d) /* # frames with length error */ | ||
210 | #define REG_RX_OUT_OF_RANGE_ERROR(pn) CRA(0x4,pn,0x0e) /* # frames with illegal length field */ | ||
211 | #define REG_RX_OVERSIZE(pn) CRA(0x4,pn,0x0f) /* # frames oversize */ | ||
212 | #define REG_RX_JABBERS(pn) CRA(0x4,pn,0x10) /* # frames oversize w/ crc err */ | ||
213 | #define REG_RX_SIZE_64(pn) CRA(0x4,pn,0x11) /* # frames 64 octets long */ | ||
214 | #define REG_RX_SIZE_65_TO_127(pn) CRA(0x4,pn,0x12) /* # frames 65-127 octets */ | ||
215 | #define REG_RX_SIZE_128_TO_255(pn) CRA(0x4,pn,0x13) /* # frames 128-255 */ | ||
216 | #define REG_RX_SIZE_256_TO_511(pn) CRA(0x4,pn,0x14) /* # frames 256-511 */ | ||
217 | #define REG_RX_SIZE_512_TO_1023(pn) CRA(0x4,pn,0x15) /* # frames 512-1023 */ | ||
218 | #define REG_RX_SIZE_1024_TO_1518(pn) CRA(0x4,pn,0x16) /* # frames 1024-1518 */ | ||
219 | #define REG_RX_SIZE_1519_TO_MAX(pn) CRA(0x4,pn,0x17) /* # frames 1519-max */ | ||
220 | 198 | ||
221 | #define REG_TX_OUT_BYTES(pn) CRA(0x4,pn,0x18) /* # octets tx */ | 199 | enum { |
222 | #define REG_TX_PAUSE(pn) CRA(0x4,pn,0x19) /* # pause frames sent */ | 200 | RxInBytes = 0x00, // # Rx in octets |
223 | #define REG_TX_OK_BYTES(pn) CRA(0x4,pn,0x1a) /* # octets tx OK */ | 201 | RxSymbolCarrier = 0x01, // Frames w/ symbol errors |
224 | #define REG_TX_UNICAST(pn) CRA(0x4,pn,0x1b) /* # frames unicast */ | 202 | RxPause = 0x02, // # pause frames received |
225 | #define REG_TX_MULTICAST(pn) CRA(0x4,pn,0x1c) /* # frames multicast */ | 203 | RxUnsupOpcode = 0x03, // # control frames with unsupported opcode |
226 | #define REG_TX_BROADCAST(pn) CRA(0x4,pn,0x1d) /* # frames broadcast */ | 204 | RxOkBytes = 0x04, // # octets in good frames |
227 | #define REG_TX_MULTIPLE_COLL(pn) CRA(0x4,pn,0x1e) /* # frames tx after multiple collisions */ | 205 | RxBadBytes = 0x05, // # octets in bad frames |
228 | #define REG_TX_LATE_COLL(pn) CRA(0x4,pn,0x1f) /* # late collisions detected */ | 206 | RxUnicast = 0x06, // # good unicast frames |
229 | #define REG_TX_XCOLL(pn) CRA(0x4,pn,0x20) /* # frames lost, excessive collisions */ | 207 | RxMulticast = 0x07, // # good multicast frames |
230 | #define REG_TX_DEFER(pn) CRA(0x4,pn,0x21) /* # frames deferred on first tx attempt */ | 208 | RxBroadcast = 0x08, // # good broadcast frames |
231 | #define REG_TX_XDEFER(pn) CRA(0x4,pn,0x22) /* # frames excessively deferred */ | 209 | Crc = 0x09, // # frames w/ bad CRC only |
232 | #define REG_TX_CSENSE(pn) CRA(0x4,pn,0x23) /* carrier sense errors at frame end */ | 210 | RxAlignment = 0x0a, // # frames w/ alignment err |
233 | #define REG_TX_SIZE_64(pn) CRA(0x4,pn,0x24) /* # frames 64 octets long */ | 211 | RxUndersize = 0x0b, // # frames undersize |
234 | #define REG_TX_SIZE_65_TO_127(pn) CRA(0x4,pn,0x25) /* # frames 65-127 octets */ | 212 | RxFragments = 0x0c, // # frames undersize w/ crc err |
235 | #define REG_TX_SIZE_128_TO_255(pn) CRA(0x4,pn,0x26) /* # frames 128-255 */ | 213 | RxInRangeLengthError = 0x0d, // # frames with length error |
236 | #define REG_TX_SIZE_256_TO_511(pn) CRA(0x4,pn,0x27) /* # frames 256-511 */ | 214 | RxOutOfRangeError = 0x0e, // # frames with illegal length field |
237 | #define REG_TX_SIZE_512_TO_1023(pn) CRA(0x4,pn,0x28) /* # frames 512-1023 */ | 215 | RxOversize = 0x0f, // # frames oversize |
238 | #define REG_TX_SIZE_1024_TO_1518(pn) CRA(0x4,pn,0x29) /* # frames 1024-1518 */ | 216 | RxJabbers = 0x10, // # frames oversize w/ crc err |
239 | #define REG_TX_SIZE_1519_TO_MAX(pn) CRA(0x4,pn,0x2a) /* # frames 1519-max */ | 217 | RxSize64 = 0x11, // # frames 64 octets long |
240 | #define REG_TX_SINGLE_COLL(pn) CRA(0x4,pn,0x2b) /* # frames tx after single collision */ | 218 | RxSize65To127 = 0x12, // # frames 65-127 octets |
241 | #define REG_TX_BACKOFF2(pn) CRA(0x4,pn,0x2c) /* # frames tx ok after 2 backoffs/collisions */ | 219 | RxSize128To255 = 0x13, // # frames 128-255 |
242 | #define REG_TX_BACKOFF3(pn) CRA(0x4,pn,0x2d) /* after 3 backoffs/collisions */ | 220 | RxSize256To511 = 0x14, // # frames 256-511 |
243 | #define REG_TX_BACKOFF4(pn) CRA(0x4,pn,0x2e) /* after 4 */ | 221 | RxSize512To1023 = 0x15, // # frames 512-1023 |
244 | #define REG_TX_BACKOFF5(pn) CRA(0x4,pn,0x2f) /* after 5 */ | 222 | RxSize1024To1518 = 0x16, // # frames 1024-1518 |
245 | #define REG_TX_BACKOFF6(pn) CRA(0x4,pn,0x30) /* after 6 */ | 223 | RxSize1519ToMax = 0x17, // # frames 1519-max |
246 | #define REG_TX_BACKOFF7(pn) CRA(0x4,pn,0x31) /* after 7 */ | ||
247 | #define REG_TX_BACKOFF8(pn) CRA(0x4,pn,0x32) /* after 8 */ | ||
248 | #define REG_TX_BACKOFF9(pn) CRA(0x4,pn,0x33) /* after 9 */ | ||
249 | #define REG_TX_BACKOFF10(pn) CRA(0x4,pn,0x34) /* after 10 */ | ||
250 | #define REG_TX_BACKOFF11(pn) CRA(0x4,pn,0x35) /* after 11 */ | ||
251 | #define REG_TX_BACKOFF12(pn) CRA(0x4,pn,0x36) /* after 12 */ | ||
252 | #define REG_TX_BACKOFF13(pn) CRA(0x4,pn,0x37) /* after 13 */ | ||
253 | #define REG_TX_BACKOFF14(pn) CRA(0x4,pn,0x38) /* after 14 */ | ||
254 | #define REG_TX_BACKOFF15(pn) CRA(0x4,pn,0x39) /* after 15 */ | ||
255 | #define REG_TX_UNDERRUN(pn) CRA(0x4,pn,0x3a) /* # frames dropped from underrun */ | ||
256 | #define REG_RX_XGMII_PROT_ERR CRA(0x4,0xa,0x3b) /* # protocol errors detected on XGMII interface */ | ||
257 | #define REG_RX_IPG_SHRINK(pn) CRA(0x4,pn,0x3c) /* # of IPG shrinks detected */ | ||
258 | 224 | ||
259 | #define REG_STAT_STICKY1G(pn) CRA(0x4,pn,0x3e) /* tri-speed sticky bits */ | 225 | TxOutBytes = 0x18, // # octets tx |
260 | #define REG_STAT_STICKY10G CRA(0x4,0xa,0x3e) /* 10GbE sticky bits */ | 226 | TxPause = 0x19, // # pause frames sent |
261 | #define REG_STAT_INIT(pn) CRA(0x4,pn,0x3f) /* Clear all statistics */ | 227 | TxOkBytes = 0x1a, // # octets tx OK |
228 | TxUnicast = 0x1b, // # frames unicast | ||
229 | TxMulticast = 0x1c, // # frames multicast | ||
230 | TxBroadcast = 0x1d, // # frames broadcast | ||
231 | TxMultipleColl = 0x1e, // # frames tx after multiple collisions | ||
232 | TxLateColl = 0x1f, // # late collisions detected | ||
233 | TxXcoll = 0x20, // # frames lost, excessive collisions | ||
234 | TxDefer = 0x21, // # frames deferred on first tx attempt | ||
235 | TxXdefer = 0x22, // # frames excessively deferred | ||
236 | TxCsense = 0x23, // carrier sense errors at frame end | ||
237 | TxSize64 = 0x24, // # frames 64 octets long | ||
238 | TxSize65To127 = 0x25, // # frames 65-127 octets | ||
239 | TxSize128To255 = 0x26, // # frames 128-255 | ||
240 | TxSize256To511 = 0x27, // # frames 256-511 | ||
241 | TxSize512To1023 = 0x28, // # frames 512-1023 | ||
242 | TxSize1024To1518 = 0x29, // # frames 1024-1518 | ||
243 | TxSize1519ToMax = 0x2a, // # frames 1519-max | ||
244 | TxSingleColl = 0x2b, // # frames tx after single collision | ||
245 | TxBackoff2 = 0x2c, // # frames tx ok after 2 backoffs/collisions | ||
246 | TxBackoff3 = 0x2d, // after 3 backoffs/collisions | ||
247 | TxBackoff4 = 0x2e, // after 4 | ||
248 | TxBackoff5 = 0x2f, // after 5 | ||
249 | TxBackoff6 = 0x30, // after 6 | ||
250 | TxBackoff7 = 0x31, // after 7 | ||
251 | TxBackoff8 = 0x32, // after 8 | ||
252 | TxBackoff9 = 0x33, // after 9 | ||
253 | TxBackoff10 = 0x34, // after 10 | ||
254 | TxBackoff11 = 0x35, // after 11 | ||
255 | TxBackoff12 = 0x36, // after 12 | ||
256 | TxBackoff13 = 0x37, // after 13 | ||
257 | TxBackoff14 = 0x38, // after 14 | ||
258 | TxBackoff15 = 0x39, // after 15 | ||
259 | TxUnderrun = 0x3a, // # frames dropped from underrun | ||
260 | // Hole. See REG_RX_XGMII_PROT_ERR below. | ||
261 | RxIpgShrink = 0x3c, // # of IPG shrinks detected | ||
262 | // Duplicate. See REG_STAT_STICKY10G below. | ||
263 | StatSticky1G = 0x3e, // tri-speed sticky bits | ||
264 | StatInit = 0x3f // Clear all statistics | ||
265 | }; | ||
266 | |||
267 | #define REG_RX_XGMII_PROT_ERR CRA(0x4,0xa,0x3b) /* # protocol errors detected on XGMII interface */ | ||
268 | #define REG_STAT_STICKY10G CRA(0x4,0xa,StatSticky1G) /* 10GbE sticky bits */ | ||
269 | |||
270 | #define REG_RX_OK_BYTES(pn) CRA(0x4,pn,RxOkBytes) | ||
271 | #define REG_RX_BAD_BYTES(pn) CRA(0x4,pn,RxBadBytes) | ||
272 | #define REG_TX_OK_BYTES(pn) CRA(0x4,pn,TxOkBytes) | ||
262 | 273 | ||
263 | /* MII-Management Block registers */ | 274 | /* MII-Management Block registers */ |
264 | /* These are for MII-M interface 0, which is the bidirectional LVTTL one. If | 275 | /* These are for MII-M interface 0, which is the bidirectional LVTTL one. If |