1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 #ifndef __BFI_ENET_H__
26 #define __BFI_ENET_H__
27
28 #include "bfa_defs.h"
29 #include "bfi.h"
30
31 #define BFI_ENET_CFG_MAX 32
32
33 #define BFI_ENET_TXQ_PRIO_MAX 8
34 #define BFI_ENET_RX_QSET_MAX 16
35 #define BFI_ENET_TXQ_WI_VECT_MAX 4
36
37 #define BFI_ENET_VLAN_ID_MAX 4096
38 #define BFI_ENET_VLAN_BLOCK_SIZE 512
39 #define BFI_ENET_VLAN_BLOCKS_MAX \
40 (BFI_ENET_VLAN_ID_MAX / BFI_ENET_VLAN_BLOCK_SIZE)
41 #define BFI_ENET_VLAN_WORD_SIZE 32
42 #define BFI_ENET_VLAN_WORDS_MAX \
43 (BFI_ENET_VLAN_BLOCK_SIZE / BFI_ENET_VLAN_WORD_SIZE)
44
45 #define BFI_ENET_RSS_RIT_MAX 64
46 #define BFI_ENET_RSS_KEY_LEN 10
47
48 union bfi_addr_be_u {
49 struct {
50 u32 addr_hi;
51 u32 addr_lo;
52 } __packed a32;
53 } __packed;
54
55
56
57
58 #define BFI_ENET_TXQ_WI_SEND (0x402)
59 #define BFI_ENET_TXQ_WI_SEND_LSO (0x403)
60 #define BFI_ENET_TXQ_WI_EXTENSION (0x104)
61
62
63 #define BFI_ENET_TXQ_WI_CF_FCOE_CRC BIT(8)
64 #define BFI_ENET_TXQ_WI_CF_IPID_MODE BIT(5)
65 #define BFI_ENET_TXQ_WI_CF_INS_PRIO BIT(4)
66 #define BFI_ENET_TXQ_WI_CF_INS_VLAN BIT(3)
67 #define BFI_ENET_TXQ_WI_CF_UDP_CKSUM BIT(2)
68 #define BFI_ENET_TXQ_WI_CF_TCP_CKSUM BIT(1)
69 #define BFI_ENET_TXQ_WI_CF_IP_CKSUM BIT(0)
70
71 struct bfi_enet_txq_wi_base {
72 u8 reserved;
73 u8 num_vectors;
74 u16 opcode;
75
76 u16 flags;
77 u16 l4_hdr_size_n_offset;
78 u16 vlan_tag;
79 u16 lso_mss;
80 u32 frame_length;
81 } __packed;
82
83 struct bfi_enet_txq_wi_ext {
84 u16 reserved;
85 u16 opcode;
86 u32 reserved2[3];
87 } __packed;
88
89 struct bfi_enet_txq_wi_vector {
90 u16 reserved;
91 u16 length;
92 union bfi_addr_be_u addr;
93 } __packed;
94
95
96 struct bfi_enet_txq_entry {
97 union {
98 struct bfi_enet_txq_wi_base base;
99 struct bfi_enet_txq_wi_ext ext;
100 } __packed wi;
101 struct bfi_enet_txq_wi_vector vector[BFI_ENET_TXQ_WI_VECT_MAX];
102 } __packed;
103
104 #define wi_hdr wi.base
105 #define wi_ext_hdr wi.ext
106
107 #define BFI_ENET_TXQ_WI_L4_HDR_N_OFFSET(_hdr_size, _offset) \
108 (((_hdr_size) << 10) | ((_offset) & 0x3FF))
109
110
111 struct bfi_enet_rxq_entry {
112 union bfi_addr_be_u rx_buffer;
113 } __packed;
114
115
116
117 #define BFI_ENET_CQ_EF_MAC_ERROR BIT(0)
118 #define BFI_ENET_CQ_EF_FCS_ERROR BIT(1)
119 #define BFI_ENET_CQ_EF_TOO_LONG BIT(2)
120 #define BFI_ENET_CQ_EF_FC_CRC_OK BIT(3)
121
122 #define BFI_ENET_CQ_EF_RSVD1 BIT(4)
123 #define BFI_ENET_CQ_EF_L4_CKSUM_OK BIT(5)
124 #define BFI_ENET_CQ_EF_L3_CKSUM_OK BIT(6)
125 #define BFI_ENET_CQ_EF_HDS_HEADER BIT(7)
126
127 #define BFI_ENET_CQ_EF_UDP BIT(8)
128 #define BFI_ENET_CQ_EF_TCP BIT(9)
129 #define BFI_ENET_CQ_EF_IP_OPTIONS BIT(10)
130 #define BFI_ENET_CQ_EF_IPV6 BIT(11)
131
132 #define BFI_ENET_CQ_EF_IPV4 BIT(12)
133 #define BFI_ENET_CQ_EF_VLAN BIT(13)
134 #define BFI_ENET_CQ_EF_RSS BIT(14)
135 #define BFI_ENET_CQ_EF_RSVD2 BIT(15)
136
137 #define BFI_ENET_CQ_EF_MCAST_MATCH BIT(16)
138 #define BFI_ENET_CQ_EF_MCAST BIT(17)
139 #define BFI_ENET_CQ_EF_BCAST BIT(18)
140 #define BFI_ENET_CQ_EF_REMOTE BIT(19)
141
142 #define BFI_ENET_CQ_EF_LOCAL BIT(20)
143
144
145 struct bfi_enet_cq_entry {
146 u32 flags;
147 u16 vlan_tag;
148 u16 length;
149 u32 rss_hash;
150 u8 valid;
151 u8 reserved1;
152 u8 reserved2;
153 u8 rxq_id;
154 } __packed;
155
156
157 struct bfi_enet_q {
158 union bfi_addr_u pg_tbl;
159 union bfi_addr_u first_entry;
160 u16 pages;
161 u16 page_sz;
162 } __packed;
163
164 struct bfi_enet_txq {
165 struct bfi_enet_q q;
166 u8 priority;
167 u8 rsvd[3];
168 } __packed;
169
170 struct bfi_enet_rxq {
171 struct bfi_enet_q q;
172 u16 rx_buffer_size;
173 u16 rsvd;
174 } __packed;
175
176 struct bfi_enet_cq {
177 struct bfi_enet_q q;
178 } __packed;
179
180 struct bfi_enet_ib_cfg {
181 u8 int_pkt_dma;
182 u8 int_enabled;
183 u8 int_pkt_enabled;
184 u8 continuous_coalescing;
185 u8 msix;
186 u8 rsvd[3];
187 u32 coalescing_timeout;
188 u32 inter_pkt_timeout;
189 u8 inter_pkt_count;
190 u8 rsvd1[3];
191 } __packed;
192
193 struct bfi_enet_ib {
194 union bfi_addr_u index_addr;
195 union {
196 u16 msix_index;
197 u16 intx_bitmask;
198 } __packed intr;
199 u16 rsvd;
200 } __packed;
201
202
203 enum bfi_enet_h2i_msgs {
204
205 BFI_ENET_H2I_RX_CFG_SET_REQ = 1,
206 BFI_ENET_H2I_RX_CFG_CLR_REQ = 2,
207
208 BFI_ENET_H2I_RIT_CFG_REQ = 3,
209 BFI_ENET_H2I_RSS_CFG_REQ = 4,
210 BFI_ENET_H2I_RSS_ENABLE_REQ = 5,
211 BFI_ENET_H2I_RX_PROMISCUOUS_REQ = 6,
212 BFI_ENET_H2I_RX_DEFAULT_REQ = 7,
213
214 BFI_ENET_H2I_MAC_UCAST_SET_REQ = 8,
215 BFI_ENET_H2I_MAC_UCAST_CLR_REQ = 9,
216 BFI_ENET_H2I_MAC_UCAST_ADD_REQ = 10,
217 BFI_ENET_H2I_MAC_UCAST_DEL_REQ = 11,
218
219 BFI_ENET_H2I_MAC_MCAST_ADD_REQ = 12,
220 BFI_ENET_H2I_MAC_MCAST_DEL_REQ = 13,
221 BFI_ENET_H2I_MAC_MCAST_FILTER_REQ = 14,
222
223 BFI_ENET_H2I_RX_VLAN_SET_REQ = 15,
224 BFI_ENET_H2I_RX_VLAN_STRIP_ENABLE_REQ = 16,
225
226
227 BFI_ENET_H2I_TX_CFG_SET_REQ = 17,
228 BFI_ENET_H2I_TX_CFG_CLR_REQ = 18,
229
230
231 BFI_ENET_H2I_PORT_ADMIN_UP_REQ = 19,
232 BFI_ENET_H2I_SET_PAUSE_REQ = 20,
233 BFI_ENET_H2I_DIAG_LOOPBACK_REQ = 21,
234
235
236 BFI_ENET_H2I_GET_ATTR_REQ = 22,
237
238
239 BFI_ENET_H2I_STATS_GET_REQ = 23,
240 BFI_ENET_H2I_STATS_CLR_REQ = 24,
241
242 BFI_ENET_H2I_WOL_MAGIC_REQ = 25,
243 BFI_ENET_H2I_WOL_FRAME_REQ = 26,
244
245 BFI_ENET_H2I_MAX = 27,
246 };
247
248 enum bfi_enet_i2h_msgs {
249
250 BFI_ENET_I2H_RX_CFG_SET_RSP =
251 BFA_I2HM(BFI_ENET_H2I_RX_CFG_SET_REQ),
252 BFI_ENET_I2H_RX_CFG_CLR_RSP =
253 BFA_I2HM(BFI_ENET_H2I_RX_CFG_CLR_REQ),
254
255 BFI_ENET_I2H_RIT_CFG_RSP =
256 BFA_I2HM(BFI_ENET_H2I_RIT_CFG_REQ),
257 BFI_ENET_I2H_RSS_CFG_RSP =
258 BFA_I2HM(BFI_ENET_H2I_RSS_CFG_REQ),
259 BFI_ENET_I2H_RSS_ENABLE_RSP =
260 BFA_I2HM(BFI_ENET_H2I_RSS_ENABLE_REQ),
261 BFI_ENET_I2H_RX_PROMISCUOUS_RSP =
262 BFA_I2HM(BFI_ENET_H2I_RX_PROMISCUOUS_REQ),
263 BFI_ENET_I2H_RX_DEFAULT_RSP =
264 BFA_I2HM(BFI_ENET_H2I_RX_DEFAULT_REQ),
265
266 BFI_ENET_I2H_MAC_UCAST_SET_RSP =
267 BFA_I2HM(BFI_ENET_H2I_MAC_UCAST_SET_REQ),
268 BFI_ENET_I2H_MAC_UCAST_CLR_RSP =
269 BFA_I2HM(BFI_ENET_H2I_MAC_UCAST_CLR_REQ),
270 BFI_ENET_I2H_MAC_UCAST_ADD_RSP =
271 BFA_I2HM(BFI_ENET_H2I_MAC_UCAST_ADD_REQ),
272 BFI_ENET_I2H_MAC_UCAST_DEL_RSP =
273 BFA_I2HM(BFI_ENET_H2I_MAC_UCAST_DEL_REQ),
274
275 BFI_ENET_I2H_MAC_MCAST_ADD_RSP =
276 BFA_I2HM(BFI_ENET_H2I_MAC_MCAST_ADD_REQ),
277 BFI_ENET_I2H_MAC_MCAST_DEL_RSP =
278 BFA_I2HM(BFI_ENET_H2I_MAC_MCAST_DEL_REQ),
279 BFI_ENET_I2H_MAC_MCAST_FILTER_RSP =
280 BFA_I2HM(BFI_ENET_H2I_MAC_MCAST_FILTER_REQ),
281
282 BFI_ENET_I2H_RX_VLAN_SET_RSP =
283 BFA_I2HM(BFI_ENET_H2I_RX_VLAN_SET_REQ),
284
285 BFI_ENET_I2H_RX_VLAN_STRIP_ENABLE_RSP =
286 BFA_I2HM(BFI_ENET_H2I_RX_VLAN_STRIP_ENABLE_REQ),
287
288
289 BFI_ENET_I2H_TX_CFG_SET_RSP =
290 BFA_I2HM(BFI_ENET_H2I_TX_CFG_SET_REQ),
291 BFI_ENET_I2H_TX_CFG_CLR_RSP =
292 BFA_I2HM(BFI_ENET_H2I_TX_CFG_CLR_REQ),
293
294
295 BFI_ENET_I2H_PORT_ADMIN_RSP =
296 BFA_I2HM(BFI_ENET_H2I_PORT_ADMIN_UP_REQ),
297
298 BFI_ENET_I2H_SET_PAUSE_RSP =
299 BFA_I2HM(BFI_ENET_H2I_SET_PAUSE_REQ),
300 BFI_ENET_I2H_DIAG_LOOPBACK_RSP =
301 BFA_I2HM(BFI_ENET_H2I_DIAG_LOOPBACK_REQ),
302
303
304 BFI_ENET_I2H_GET_ATTR_RSP =
305 BFA_I2HM(BFI_ENET_H2I_GET_ATTR_REQ),
306
307
308 BFI_ENET_I2H_STATS_GET_RSP =
309 BFA_I2HM(BFI_ENET_H2I_STATS_GET_REQ),
310 BFI_ENET_I2H_STATS_CLR_RSP =
311 BFA_I2HM(BFI_ENET_H2I_STATS_CLR_REQ),
312
313 BFI_ENET_I2H_WOL_MAGIC_RSP =
314 BFA_I2HM(BFI_ENET_H2I_WOL_MAGIC_REQ),
315 BFI_ENET_I2H_WOL_FRAME_RSP =
316 BFA_I2HM(BFI_ENET_H2I_WOL_FRAME_REQ),
317
318
319 BFI_ENET_I2H_LINK_DOWN_AEN = BFA_I2HM(BFI_ENET_H2I_MAX),
320 BFI_ENET_I2H_LINK_UP_AEN = BFA_I2HM(BFI_ENET_H2I_MAX + 1),
321
322 BFI_ENET_I2H_PORT_ENABLE_AEN = BFA_I2HM(BFI_ENET_H2I_MAX + 2),
323 BFI_ENET_I2H_PORT_DISABLE_AEN = BFA_I2HM(BFI_ENET_H2I_MAX + 3),
324
325 BFI_ENET_I2H_BW_UPDATE_AEN = BFA_I2HM(BFI_ENET_H2I_MAX + 4),
326 };
327
328
329 enum bfi_enet_err {
330 BFI_ENET_CMD_OK = 0,
331 BFI_ENET_CMD_FAIL = 1,
332 BFI_ENET_CMD_DUP_ENTRY = 2,
333 BFI_ENET_CMD_CAM_FULL = 3,
334 BFI_ENET_CMD_NOT_OWNER = 4,
335 BFI_ENET_CMD_NOT_EXEC = 5,
336 BFI_ENET_CMD_WAITING = 6,
337 BFI_ENET_CMD_PORT_DISABLED = 7,
338 };
339
340
341
342
343
344
345
346 struct bfi_enet_req {
347 struct bfi_msgq_mhdr mh;
348 } __packed;
349
350
351
352
353
354
355
356
357
358
359 struct bfi_enet_enable_req {
360 struct bfi_msgq_mhdr mh;
361 u8 enable;
362 u8 rsvd[3];
363 } __packed;
364
365
366 struct bfi_enet_rsp {
367 struct bfi_msgq_mhdr mh;
368 u8 error;
369 u8 rsvd;
370 u16 cmd_offset;
371 } __packed;
372
373
374
375
376
377
378 struct bfi_enet_attr_req {
379 struct bfi_msgq_mhdr mh;
380 } __packed;
381
382
383
384
385 struct bfi_enet_attr_rsp {
386 struct bfi_msgq_mhdr mh;
387 u8 error;
388 u8 rsvd;
389 u16 cmd_offset;
390 u32 max_cfg;
391 u32 max_ucmac;
392 u32 rit_size;
393 } __packed;
394
395
396
397
398
399
400 enum bfi_enet_tx_vlan_mode {
401 BFI_ENET_TX_VLAN_NOP = 0,
402 BFI_ENET_TX_VLAN_INS = 1,
403 BFI_ENET_TX_VLAN_WI = 2,
404 };
405
406 struct bfi_enet_tx_cfg {
407 u8 vlan_mode;
408 u8 rsvd;
409 u16 vlan_id;
410 u8 admit_tagged_frame;
411 u8 apply_vlan_filter;
412 u8 add_to_vswitch;
413 u8 rsvd1[1];
414 } __packed;
415
416 struct bfi_enet_tx_cfg_req {
417 struct bfi_msgq_mhdr mh;
418 u8 num_queues;
419 u8 rsvd[3];
420
421 struct {
422 struct bfi_enet_txq q;
423 struct bfi_enet_ib ib;
424 } __packed q_cfg[BFI_ENET_TXQ_PRIO_MAX];
425
426 struct bfi_enet_ib_cfg ib_cfg;
427
428 struct bfi_enet_tx_cfg tx_cfg;
429 };
430
431 struct bfi_enet_tx_cfg_rsp {
432 struct bfi_msgq_mhdr mh;
433 u8 error;
434 u8 hw_id;
435 u8 rsvd[2];
436 struct {
437 u32 q_dbell;
438 u32 i_dbell;
439 u8 hw_qid;
440 u8 rsvd[3];
441 } __packed q_handles[BFI_ENET_TXQ_PRIO_MAX];
442 };
443
444
445
446
447
448
449 enum bfi_enet_rxq_type {
450 BFI_ENET_RXQ_SINGLE = 1,
451 BFI_ENET_RXQ_LARGE_SMALL = 2,
452 BFI_ENET_RXQ_HDS = 3,
453 BFI_ENET_RXQ_HDS_OPT_BASED = 4,
454 };
455
456 enum bfi_enet_hds_type {
457 BFI_ENET_HDS_FORCED = 0x01,
458 BFI_ENET_HDS_IPV6_UDP = 0x02,
459 BFI_ENET_HDS_IPV6_TCP = 0x04,
460 BFI_ENET_HDS_IPV4_TCP = 0x08,
461 BFI_ENET_HDS_IPV4_UDP = 0x10,
462 };
463
464 struct bfi_enet_rx_cfg {
465 u8 rxq_type;
466 u8 rsvd[1];
467 u16 frame_size;
468
469 struct {
470 u8 max_header_size;
471 u8 force_offset;
472 u8 type;
473 u8 rsvd1;
474 } __packed hds;
475
476 u8 multi_buffer;
477 u8 strip_vlan;
478 u8 drop_untagged;
479 u8 rsvd2;
480 } __packed;
481
482
483
484
485
486
487 struct bfi_enet_rx_cfg_req {
488 struct bfi_msgq_mhdr mh;
489 u8 num_queue_sets;
490 u8 rsvd[3];
491
492 struct {
493 struct bfi_enet_rxq ql;
494 struct bfi_enet_rxq qs;
495 struct bfi_enet_cq cq;
496 struct bfi_enet_ib ib;
497 } __packed q_cfg[BFI_ENET_RX_QSET_MAX];
498
499 struct bfi_enet_ib_cfg ib_cfg;
500
501 struct bfi_enet_rx_cfg rx_cfg;
502 } __packed;
503
504 struct bfi_enet_rx_cfg_rsp {
505 struct bfi_msgq_mhdr mh;
506 u8 error;
507 u8 hw_id;
508 u8 rsvd[2];
509 struct {
510 u32 ql_dbell;
511 u32 qs_dbell;
512 u32 i_dbell;
513 u8 hw_lqid;
514 u8 hw_sqid;
515 u8 hw_cqid;
516 u8 rsvd;
517 } __packed q_handles[BFI_ENET_RX_QSET_MAX];
518 } __packed;
519
520
521
522
523
524
525 struct bfi_enet_rit_req {
526 struct bfi_msgq_mhdr mh;
527 u16 size;
528 u8 rsvd[2];
529 u8 table[BFI_ENET_RSS_RIT_MAX];
530 } __packed;
531
532
533
534
535
536
537 enum bfi_enet_rss_type {
538 BFI_ENET_RSS_IPV6 = 0x01,
539 BFI_ENET_RSS_IPV6_TCP = 0x02,
540 BFI_ENET_RSS_IPV4 = 0x04,
541 BFI_ENET_RSS_IPV4_TCP = 0x08
542 };
543
544 struct bfi_enet_rss_cfg {
545 u8 type;
546 u8 mask;
547 u8 rsvd[2];
548 u32 key[BFI_ENET_RSS_KEY_LEN];
549 } __packed;
550
551 struct bfi_enet_rss_cfg_req {
552 struct bfi_msgq_mhdr mh;
553 struct bfi_enet_rss_cfg cfg;
554 } __packed;
555
556
557
558
559
560
561
562
563
564 struct bfi_enet_ucast_req {
565 struct bfi_msgq_mhdr mh;
566 u8 mac_addr[ETH_ALEN];
567 u8 rsvd[2];
568 } __packed;
569
570
571 struct bfi_enet_mac_n_vlan_req {
572 struct bfi_msgq_mhdr mh;
573 u16 vlan_id;
574 u8 mac_addr[ETH_ALEN];
575 } __packed;
576
577
578
579
580
581
582 struct bfi_enet_mcast_add_req {
583 struct bfi_msgq_mhdr mh;
584 u8 mac_addr[ETH_ALEN];
585 u8 rsvd[2];
586 } __packed;
587
588
589
590
591 struct bfi_enet_mcast_add_rsp {
592 struct bfi_msgq_mhdr mh;
593 u8 error;
594 u8 rsvd;
595 u16 cmd_offset;
596 u16 handle;
597 u8 rsvd1[2];
598 } __packed;
599
600
601
602
603 struct bfi_enet_mcast_del_req {
604 struct bfi_msgq_mhdr mh;
605 u16 handle;
606 u8 rsvd[2];
607 } __packed;
608
609
610
611
612
613
614 struct bfi_enet_rx_vlan_req {
615 struct bfi_msgq_mhdr mh;
616 u8 block_idx;
617 u8 rsvd[3];
618 u32 bit_mask[BFI_ENET_VLAN_WORDS_MAX];
619 } __packed;
620
621
622
623
624
625
626 struct bfi_enet_set_pause_req {
627 struct bfi_msgq_mhdr mh;
628 u8 rsvd[2];
629 u8 tx_pause;
630 u8 rx_pause;
631 } __packed;
632
633
634
635
636
637
638 struct bfi_enet_diag_lb_req {
639 struct bfi_msgq_mhdr mh;
640 u8 rsvd[2];
641 u8 mode;
642 u8 enable;
643 } __packed;
644
645
646 enum {
647 BFI_ENET_DIAG_LB_OPMODE_EXT = 0,
648 BFI_ENET_DIAG_LB_OPMODE_CBL = 1,
649 };
650
651
652
653
654
655
656
657 struct bfi_enet_stats_req {
658 struct bfi_msgq_mhdr mh;
659 u16 stats_mask;
660 u8 rsvd[2];
661 u32 rx_enet_mask;
662 u32 tx_enet_mask;
663 union bfi_addr_u host_buffer;
664 } __packed;
665
666
667 #define BFI_ENET_STATS_MAC BIT(0)
668 #define BFI_ENET_STATS_BPC BIT(1)
669 #define BFI_ENET_STATS_RAD BIT(2)
670 #define BFI_ENET_STATS_RX_FC BIT(3)
671 #define BFI_ENET_STATS_TX_FC BIT(4)
672
673 #define BFI_ENET_STATS_ALL 0x1f
674
675
676 struct bfi_enet_stats_txf {
677 u64 ucast_octets;
678 u64 ucast;
679 u64 ucast_vlan;
680
681 u64 mcast_octets;
682 u64 mcast;
683 u64 mcast_vlan;
684
685 u64 bcast_octets;
686 u64 bcast;
687 u64 bcast_vlan;
688
689 u64 errors;
690 u64 filter_vlan;
691 u64 filter_mac_sa;
692 } __packed;
693
694
695 struct bfi_enet_stats_rxf {
696 u64 ucast_octets;
697 u64 ucast;
698 u64 ucast_vlan;
699
700 u64 mcast_octets;
701 u64 mcast;
702 u64 mcast_vlan;
703
704 u64 bcast_octets;
705 u64 bcast;
706 u64 bcast_vlan;
707 u64 frame_drops;
708 } __packed;
709
710
711 struct bfi_enet_stats_fc_tx {
712 u64 txf_ucast_octets;
713 u64 txf_ucast;
714 u64 txf_ucast_vlan;
715
716 u64 txf_mcast_octets;
717 u64 txf_mcast;
718 u64 txf_mcast_vlan;
719
720 u64 txf_bcast_octets;
721 u64 txf_bcast;
722 u64 txf_bcast_vlan;
723
724 u64 txf_parity_errors;
725 u64 txf_timeout;
726 u64 txf_fid_parity_errors;
727 } __packed;
728
729
730 struct bfi_enet_stats_fc_rx {
731 u64 rxf_ucast_octets;
732 u64 rxf_ucast;
733 u64 rxf_ucast_vlan;
734
735 u64 rxf_mcast_octets;
736 u64 rxf_mcast;
737 u64 rxf_mcast_vlan;
738
739 u64 rxf_bcast_octets;
740 u64 rxf_bcast;
741 u64 rxf_bcast_vlan;
742 } __packed;
743
744
745 struct bfi_enet_stats_rad {
746 u64 rx_frames;
747 u64 rx_octets;
748 u64 rx_vlan_frames;
749
750 u64 rx_ucast;
751 u64 rx_ucast_octets;
752 u64 rx_ucast_vlan;
753
754 u64 rx_mcast;
755 u64 rx_mcast_octets;
756 u64 rx_mcast_vlan;
757
758 u64 rx_bcast;
759 u64 rx_bcast_octets;
760 u64 rx_bcast_vlan;
761
762 u64 rx_drops;
763 } __packed;
764
765
766 struct bfi_enet_stats_bpc {
767
768 u64 tx_pause[8];
769 u64 tx_zero_pause[8];
770
771 u64 tx_first_pause[8];
772
773
774 u64 rx_pause[8];
775 u64 rx_zero_pause[8];
776
777 u64 rx_first_pause[8];
778 } __packed;
779
780
781 struct bfi_enet_stats_mac {
782 u64 stats_clr_cnt;
783 u64 frame_64;
784 u64 frame_65_127;
785 u64 frame_128_255;
786 u64 frame_256_511;
787 u64 frame_512_1023;
788 u64 frame_1024_1518;
789 u64 frame_1519_1522;
790
791
792 u64 rx_bytes;
793 u64 rx_packets;
794 u64 rx_fcs_error;
795 u64 rx_multicast;
796 u64 rx_broadcast;
797 u64 rx_control_frames;
798 u64 rx_pause;
799 u64 rx_unknown_opcode;
800 u64 rx_alignment_error;
801 u64 rx_frame_length_error;
802 u64 rx_code_error;
803 u64 rx_carrier_sense_error;
804 u64 rx_undersize;
805 u64 rx_oversize;
806 u64 rx_fragments;
807 u64 rx_jabber;
808 u64 rx_drop;
809
810
811 u64 tx_bytes;
812 u64 tx_packets;
813 u64 tx_multicast;
814 u64 tx_broadcast;
815 u64 tx_pause;
816 u64 tx_deferral;
817 u64 tx_excessive_deferral;
818 u64 tx_single_collision;
819 u64 tx_muliple_collision;
820 u64 tx_late_collision;
821 u64 tx_excessive_collision;
822 u64 tx_total_collision;
823 u64 tx_pause_honored;
824 u64 tx_drop;
825 u64 tx_jabber;
826 u64 tx_fcs_error;
827 u64 tx_control_frame;
828 u64 tx_oversize;
829 u64 tx_undersize;
830 u64 tx_fragments;
831 } __packed;
832
833
834
835
836 struct bfi_enet_stats {
837 struct bfi_enet_stats_mac mac_stats;
838 struct bfi_enet_stats_bpc bpc_stats;
839 struct bfi_enet_stats_rad rad_stats;
840 struct bfi_enet_stats_rad rlb_stats;
841 struct bfi_enet_stats_fc_rx fc_rx_stats;
842 struct bfi_enet_stats_fc_tx fc_tx_stats;
843 struct bfi_enet_stats_rxf rxf_stats[BFI_ENET_CFG_MAX];
844 struct bfi_enet_stats_txf txf_stats[BFI_ENET_CFG_MAX];
845 } __packed;
846
847 #endif