This source file includes following definitions.
- color_match
- encode_txq_desc_cmd
- decode_txq_desc_cmd
1
2
3
4 #ifndef _IONIC_IF_H_
5 #define _IONIC_IF_H_
6
7 #pragma pack(push, 1)
8
9 #define IONIC_DEV_INFO_SIGNATURE 0x44455649
10 #define IONIC_DEV_INFO_VERSION 1
11 #define IONIC_IFNAMSIZ 16
12
13
14
15
16 enum ionic_cmd_opcode {
17 IONIC_CMD_NOP = 0,
18
19
20 IONIC_CMD_IDENTIFY = 1,
21 IONIC_CMD_INIT = 2,
22 IONIC_CMD_RESET = 3,
23 IONIC_CMD_GETATTR = 4,
24 IONIC_CMD_SETATTR = 5,
25
26
27 IONIC_CMD_PORT_IDENTIFY = 10,
28 IONIC_CMD_PORT_INIT = 11,
29 IONIC_CMD_PORT_RESET = 12,
30 IONIC_CMD_PORT_GETATTR = 13,
31 IONIC_CMD_PORT_SETATTR = 14,
32
33
34 IONIC_CMD_LIF_IDENTIFY = 20,
35 IONIC_CMD_LIF_INIT = 21,
36 IONIC_CMD_LIF_RESET = 22,
37 IONIC_CMD_LIF_GETATTR = 23,
38 IONIC_CMD_LIF_SETATTR = 24,
39
40 IONIC_CMD_RX_MODE_SET = 30,
41 IONIC_CMD_RX_FILTER_ADD = 31,
42 IONIC_CMD_RX_FILTER_DEL = 32,
43
44
45 IONIC_CMD_Q_INIT = 40,
46 IONIC_CMD_Q_CONTROL = 41,
47
48
49 IONIC_CMD_RDMA_RESET_LIF = 50,
50 IONIC_CMD_RDMA_CREATE_EQ = 51,
51 IONIC_CMD_RDMA_CREATE_CQ = 52,
52 IONIC_CMD_RDMA_CREATE_ADMINQ = 53,
53
54
55 IONIC_CMD_QOS_CLASS_IDENTIFY = 240,
56 IONIC_CMD_QOS_CLASS_INIT = 241,
57 IONIC_CMD_QOS_CLASS_RESET = 242,
58
59
60 IONIC_CMD_FW_DOWNLOAD = 254,
61 IONIC_CMD_FW_CONTROL = 255,
62 };
63
64
65
66
67 enum ionic_status_code {
68 IONIC_RC_SUCCESS = 0,
69 IONIC_RC_EVERSION = 1,
70 IONIC_RC_EOPCODE = 2,
71 IONIC_RC_EIO = 3,
72 IONIC_RC_EPERM = 4,
73 IONIC_RC_EQID = 5,
74 IONIC_RC_EQTYPE = 6,
75 IONIC_RC_ENOENT = 7,
76 IONIC_RC_EINTR = 8,
77 IONIC_RC_EAGAIN = 9,
78 IONIC_RC_ENOMEM = 10,
79 IONIC_RC_EFAULT = 11,
80 IONIC_RC_EBUSY = 12,
81 IONIC_RC_EEXIST = 13,
82 IONIC_RC_EINVAL = 14,
83 IONIC_RC_ENOSPC = 15,
84 IONIC_RC_ERANGE = 16,
85 IONIC_RC_BAD_ADDR = 17,
86 IONIC_RC_DEV_CMD = 18,
87 IONIC_RC_ENOSUPP = 19,
88 IONIC_RC_ERROR = 29,
89
90 IONIC_RC_ERDMA = 30,
91 };
92
93 enum ionic_notifyq_opcode {
94 IONIC_EVENT_LINK_CHANGE = 1,
95 IONIC_EVENT_RESET = 2,
96 IONIC_EVENT_HEARTBEAT = 3,
97 IONIC_EVENT_LOG = 4,
98 };
99
100
101
102
103
104
105
106 struct ionic_admin_cmd {
107 u8 opcode;
108 u8 rsvd;
109 __le16 lif_index;
110 u8 cmd_data[60];
111 };
112
113
114
115
116
117
118
119
120
121
122 struct ionic_admin_comp {
123 u8 status;
124 u8 rsvd;
125 __le16 comp_index;
126 u8 cmd_data[11];
127 u8 color;
128 #define IONIC_COMP_COLOR_MASK 0x80
129 };
130
131 static inline u8 color_match(u8 color, u8 done_color)
132 {
133 return (!!(color & IONIC_COMP_COLOR_MASK)) == done_color;
134 }
135
136
137
138
139
140 struct ionic_nop_cmd {
141 u8 opcode;
142 u8 rsvd[63];
143 };
144
145
146
147
148
149 struct ionic_nop_comp {
150 u8 status;
151 u8 rsvd[15];
152 };
153
154
155
156
157
158
159 struct ionic_dev_init_cmd {
160 u8 opcode;
161 u8 type;
162 u8 rsvd[62];
163 };
164
165
166
167
168
169 struct ionic_dev_init_comp {
170 u8 status;
171 u8 rsvd[15];
172 };
173
174
175
176
177
178 struct ionic_dev_reset_cmd {
179 u8 opcode;
180 u8 rsvd[63];
181 };
182
183
184
185
186
187 struct ionic_dev_reset_comp {
188 u8 status;
189 u8 rsvd[15];
190 };
191
192 #define IONIC_IDENTITY_VERSION_1 1
193
194
195
196
197
198
199 struct ionic_dev_identify_cmd {
200 u8 opcode;
201 u8 ver;
202 u8 rsvd[62];
203 };
204
205
206
207
208
209
210 struct ionic_dev_identify_comp {
211 u8 status;
212 u8 ver;
213 u8 rsvd[14];
214 };
215
216 enum ionic_os_type {
217 IONIC_OS_TYPE_LINUX = 1,
218 IONIC_OS_TYPE_WIN = 2,
219 IONIC_OS_TYPE_DPDK = 3,
220 IONIC_OS_TYPE_FREEBSD = 4,
221 IONIC_OS_TYPE_IPXE = 5,
222 IONIC_OS_TYPE_ESXI = 6,
223 };
224
225
226
227
228
229
230
231
232
233
234 union ionic_drv_identity {
235 struct {
236 __le32 os_type;
237 __le32 os_dist;
238 char os_dist_str[128];
239 __le32 kernel_ver;
240 char kernel_ver_str[32];
241 char driver_ver_str[32];
242 };
243 __le32 words[512];
244 };
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264 union ionic_dev_identity {
265 struct {
266 u8 version;
267 u8 type;
268 u8 rsvd[2];
269 u8 nports;
270 u8 rsvd2[3];
271 __le32 nlifs;
272 __le32 nintrs;
273 __le32 ndbpgs_per_lif;
274 __le32 intr_coal_mult;
275 __le32 intr_coal_div;
276 };
277 __le32 words[512];
278 };
279
280 enum ionic_lif_type {
281 IONIC_LIF_TYPE_CLASSIC = 0,
282 IONIC_LIF_TYPE_MACVLAN = 1,
283 IONIC_LIF_TYPE_NETQUEUE = 2,
284 };
285
286
287
288
289
290
291
292 struct ionic_lif_identify_cmd {
293 u8 opcode;
294 u8 type;
295 u8 ver;
296 u8 rsvd[61];
297 };
298
299
300
301
302
303
304 struct ionic_lif_identify_comp {
305 u8 status;
306 u8 ver;
307 u8 rsvd2[14];
308 };
309
310 enum ionic_lif_capability {
311 IONIC_LIF_CAP_ETH = BIT(0),
312 IONIC_LIF_CAP_RDMA = BIT(1),
313 };
314
315
316
317
318 enum ionic_logical_qtype {
319 IONIC_QTYPE_ADMINQ = 0,
320 IONIC_QTYPE_NOTIFYQ = 1,
321 IONIC_QTYPE_RXQ = 2,
322 IONIC_QTYPE_TXQ = 3,
323 IONIC_QTYPE_EQ = 4,
324 IONIC_QTYPE_MAX = 16,
325 };
326
327
328
329
330
331
332
333 struct ionic_lif_logical_qtype {
334 u8 qtype;
335 u8 rsvd[3];
336 __le32 qid_count;
337 __le32 qid_base;
338 };
339
340 enum ionic_lif_state {
341 IONIC_LIF_DISABLE = 0,
342 IONIC_LIF_ENABLE = 1,
343 IONIC_LIF_HANG_RESET = 2,
344 };
345
346
347
348
349
350
351
352
353
354
355 union ionic_lif_config {
356 struct {
357 u8 state;
358 u8 rsvd[3];
359 char name[IONIC_IFNAMSIZ];
360 __le32 mtu;
361 u8 mac[6];
362 u8 rsvd2[2];
363 __le64 features;
364 __le32 queue_count[IONIC_QTYPE_MAX];
365 };
366 __le32 words[64];
367 };
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402 union ionic_lif_identity {
403 struct {
404 __le64 capabilities;
405
406 struct {
407 u8 version;
408 u8 rsvd[3];
409 __le32 max_ucast_filters;
410 __le32 max_mcast_filters;
411 __le16 rss_ind_tbl_sz;
412 __le32 min_frame_size;
413 __le32 max_frame_size;
414 u8 rsvd2[106];
415 union ionic_lif_config config;
416 } eth;
417
418 struct {
419 u8 version;
420 u8 qp_opcodes;
421 u8 admin_opcodes;
422 u8 rsvd;
423 __le32 npts_per_lif;
424 __le32 nmrs_per_lif;
425 __le32 nahs_per_lif;
426 u8 max_stride;
427 u8 cl_stride;
428 u8 pte_stride;
429 u8 rrq_stride;
430 u8 rsq_stride;
431 u8 dcqcn_profiles;
432 u8 rsvd_dimensions[10];
433 struct ionic_lif_logical_qtype aq_qtype;
434 struct ionic_lif_logical_qtype sq_qtype;
435 struct ionic_lif_logical_qtype rq_qtype;
436 struct ionic_lif_logical_qtype cq_qtype;
437 struct ionic_lif_logical_qtype eq_qtype;
438 } rdma;
439 };
440 __le32 words[512];
441 };
442
443
444
445
446
447
448
449
450 struct ionic_lif_init_cmd {
451 u8 opcode;
452 u8 type;
453 __le16 index;
454 __le32 rsvd;
455 __le64 info_pa;
456 u8 rsvd2[48];
457 };
458
459
460
461
462
463 struct ionic_lif_init_comp {
464 u8 status;
465 u8 rsvd;
466 __le16 hw_index;
467 u8 rsvd2[12];
468 };
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502 struct ionic_q_init_cmd {
503 u8 opcode;
504 u8 rsvd;
505 __le16 lif_index;
506 u8 type;
507 u8 ver;
508 u8 rsvd1[2];
509 __le32 index;
510 __le16 pid;
511 __le16 intr_index;
512 __le16 flags;
513 #define IONIC_QINIT_F_IRQ 0x01
514 #define IONIC_QINIT_F_ENA 0x02
515 #define IONIC_QINIT_F_SG 0x04
516 #define IONIC_QINIT_F_EQ 0x08
517 #define IONIC_QINIT_F_DEBUG 0x80
518 u8 cos;
519 u8 ring_size;
520 __le64 ring_base;
521 __le64 cq_ring_base;
522 __le64 sg_ring_base;
523 __le32 eq_index;
524 u8 rsvd2[16];
525 };
526
527
528
529
530
531
532
533
534
535
536
537 struct ionic_q_init_comp {
538 u8 status;
539 u8 ver;
540 __le16 comp_index;
541 __le32 hw_index;
542 u8 hw_type;
543 u8 rsvd2[6];
544 u8 color;
545 };
546
547
548 #define IONIC_ADDR_LEN 52
549 #define IONIC_ADDR_MASK (BIT_ULL(IONIC_ADDR_LEN) - 1)
550
551 enum ionic_txq_desc_opcode {
552 IONIC_TXQ_DESC_OPCODE_CSUM_NONE = 0,
553 IONIC_TXQ_DESC_OPCODE_CSUM_PARTIAL = 1,
554 IONIC_TXQ_DESC_OPCODE_CSUM_HW = 2,
555 IONIC_TXQ_DESC_OPCODE_TSO = 3,
556 };
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672 #define IONIC_TXQ_DESC_OPCODE_MASK 0xf
673 #define IONIC_TXQ_DESC_OPCODE_SHIFT 4
674 #define IONIC_TXQ_DESC_FLAGS_MASK 0xf
675 #define IONIC_TXQ_DESC_FLAGS_SHIFT 0
676 #define IONIC_TXQ_DESC_NSGE_MASK 0xf
677 #define IONIC_TXQ_DESC_NSGE_SHIFT 8
678 #define IONIC_TXQ_DESC_ADDR_MASK (BIT_ULL(IONIC_ADDR_LEN) - 1)
679 #define IONIC_TXQ_DESC_ADDR_SHIFT 12
680
681
682 #define IONIC_TXQ_DESC_FLAG_VLAN 0x1
683 #define IONIC_TXQ_DESC_FLAG_ENCAP 0x2
684
685
686 #define IONIC_TXQ_DESC_FLAG_CSUM_L3 0x4
687 #define IONIC_TXQ_DESC_FLAG_CSUM_L4 0x8
688
689
690 #define IONIC_TXQ_DESC_FLAG_TSO_SOT 0x4
691 #define IONIC_TXQ_DESC_FLAG_TSO_EOT 0x8
692
693 struct ionic_txq_desc {
694 __le64 cmd;
695 __le16 len;
696 union {
697 __le16 vlan_tci;
698 __le16 hword0;
699 };
700 union {
701 __le16 csum_start;
702 __le16 hdr_len;
703 __le16 hword1;
704 };
705 union {
706 __le16 csum_offset;
707 __le16 mss;
708 __le16 hword2;
709 };
710 };
711
712 static inline u64 encode_txq_desc_cmd(u8 opcode, u8 flags,
713 u8 nsge, u64 addr)
714 {
715 u64 cmd;
716
717 cmd = (opcode & IONIC_TXQ_DESC_OPCODE_MASK) << IONIC_TXQ_DESC_OPCODE_SHIFT;
718 cmd |= (flags & IONIC_TXQ_DESC_FLAGS_MASK) << IONIC_TXQ_DESC_FLAGS_SHIFT;
719 cmd |= (nsge & IONIC_TXQ_DESC_NSGE_MASK) << IONIC_TXQ_DESC_NSGE_SHIFT;
720 cmd |= (addr & IONIC_TXQ_DESC_ADDR_MASK) << IONIC_TXQ_DESC_ADDR_SHIFT;
721
722 return cmd;
723 };
724
725 static inline void decode_txq_desc_cmd(u64 cmd, u8 *opcode, u8 *flags,
726 u8 *nsge, u64 *addr)
727 {
728 *opcode = (cmd >> IONIC_TXQ_DESC_OPCODE_SHIFT) & IONIC_TXQ_DESC_OPCODE_MASK;
729 *flags = (cmd >> IONIC_TXQ_DESC_FLAGS_SHIFT) & IONIC_TXQ_DESC_FLAGS_MASK;
730 *nsge = (cmd >> IONIC_TXQ_DESC_NSGE_SHIFT) & IONIC_TXQ_DESC_NSGE_MASK;
731 *addr = (cmd >> IONIC_TXQ_DESC_ADDR_SHIFT) & IONIC_TXQ_DESC_ADDR_MASK;
732 };
733
734 #define IONIC_TX_MAX_SG_ELEMS 8
735 #define IONIC_RX_MAX_SG_ELEMS 8
736
737
738
739
740
741
742 struct ionic_txq_sg_desc {
743 struct ionic_txq_sg_elem {
744 __le64 addr;
745 __le16 len;
746 __le16 rsvd[3];
747 } elems[IONIC_TX_MAX_SG_ELEMS];
748 };
749
750
751
752
753
754
755
756
757 struct ionic_txq_comp {
758 u8 status;
759 u8 rsvd;
760 __le16 comp_index;
761 u8 rsvd2[11];
762 u8 color;
763 };
764
765 enum ionic_rxq_desc_opcode {
766 IONIC_RXQ_DESC_OPCODE_SIMPLE = 0,
767 IONIC_RXQ_DESC_OPCODE_SG = 1,
768 };
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784 struct ionic_rxq_desc {
785 u8 opcode;
786 u8 rsvd[5];
787 __le16 len;
788 __le64 addr;
789 };
790
791
792
793
794
795
796 struct ionic_rxq_sg_desc {
797 struct ionic_rxq_sg_elem {
798 __le64 addr;
799 __le16 len;
800 __le16 rsvd[3];
801 } elems[IONIC_RX_MAX_SG_ELEMS];
802 };
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847 struct ionic_rxq_comp {
848 u8 status;
849 u8 num_sg_elems;
850 __le16 comp_index;
851 __le32 rss_hash;
852 __le16 csum;
853 __le16 vlan_tci;
854 __le16 len;
855 u8 csum_flags;
856 #define IONIC_RXQ_COMP_CSUM_F_TCP_OK 0x01
857 #define IONIC_RXQ_COMP_CSUM_F_TCP_BAD 0x02
858 #define IONIC_RXQ_COMP_CSUM_F_UDP_OK 0x04
859 #define IONIC_RXQ_COMP_CSUM_F_UDP_BAD 0x08
860 #define IONIC_RXQ_COMP_CSUM_F_IP_OK 0x10
861 #define IONIC_RXQ_COMP_CSUM_F_IP_BAD 0x20
862 #define IONIC_RXQ_COMP_CSUM_F_VLAN 0x40
863 #define IONIC_RXQ_COMP_CSUM_F_CALC 0x80
864 u8 pkt_type_color;
865 #define IONIC_RXQ_COMP_PKT_TYPE_MASK 0x7f
866 };
867
868 enum ionic_pkt_type {
869 IONIC_PKT_TYPE_NON_IP = 0x000,
870 IONIC_PKT_TYPE_IPV4 = 0x001,
871 IONIC_PKT_TYPE_IPV4_TCP = 0x003,
872 IONIC_PKT_TYPE_IPV4_UDP = 0x005,
873 IONIC_PKT_TYPE_IPV6 = 0x008,
874 IONIC_PKT_TYPE_IPV6_TCP = 0x018,
875 IONIC_PKT_TYPE_IPV6_UDP = 0x028,
876 };
877
878 enum ionic_eth_hw_features {
879 IONIC_ETH_HW_VLAN_TX_TAG = BIT(0),
880 IONIC_ETH_HW_VLAN_RX_STRIP = BIT(1),
881 IONIC_ETH_HW_VLAN_RX_FILTER = BIT(2),
882 IONIC_ETH_HW_RX_HASH = BIT(3),
883 IONIC_ETH_HW_RX_CSUM = BIT(4),
884 IONIC_ETH_HW_TX_SG = BIT(5),
885 IONIC_ETH_HW_RX_SG = BIT(6),
886 IONIC_ETH_HW_TX_CSUM = BIT(7),
887 IONIC_ETH_HW_TSO = BIT(8),
888 IONIC_ETH_HW_TSO_IPV6 = BIT(9),
889 IONIC_ETH_HW_TSO_ECN = BIT(10),
890 IONIC_ETH_HW_TSO_GRE = BIT(11),
891 IONIC_ETH_HW_TSO_GRE_CSUM = BIT(12),
892 IONIC_ETH_HW_TSO_IPXIP4 = BIT(13),
893 IONIC_ETH_HW_TSO_IPXIP6 = BIT(14),
894 IONIC_ETH_HW_TSO_UDP = BIT(15),
895 IONIC_ETH_HW_TSO_UDP_CSUM = BIT(16),
896 };
897
898
899
900
901
902
903
904
905
906 struct ionic_q_control_cmd {
907 u8 opcode;
908 u8 type;
909 __le16 lif_index;
910 __le32 index;
911 u8 oper;
912 u8 rsvd[55];
913 };
914
915 typedef struct ionic_admin_comp ionic_q_control_comp;
916
917 enum q_control_oper {
918 IONIC_Q_DISABLE = 0,
919 IONIC_Q_ENABLE = 1,
920 IONIC_Q_HANG_RESET = 2,
921 };
922
923
924
925
926 enum ionic_phy_type {
927 IONIC_PHY_TYPE_NONE = 0,
928 IONIC_PHY_TYPE_COPPER = 1,
929 IONIC_PHY_TYPE_FIBER = 2,
930 };
931
932
933
934
935 enum ionic_xcvr_state {
936 IONIC_XCVR_STATE_REMOVED = 0,
937 IONIC_XCVR_STATE_INSERTED = 1,
938 IONIC_XCVR_STATE_PENDING = 2,
939 IONIC_XCVR_STATE_SPROM_READ = 3,
940 IONIC_XCVR_STATE_SPROM_READ_ERR = 4,
941 };
942
943
944
945
946 enum ionic_xcvr_pid {
947 IONIC_XCVR_PID_UNKNOWN = 0,
948
949
950 IONIC_XCVR_PID_QSFP_100G_CR4 = 1,
951 IONIC_XCVR_PID_QSFP_40GBASE_CR4 = 2,
952 IONIC_XCVR_PID_SFP_25GBASE_CR_S = 3,
953 IONIC_XCVR_PID_SFP_25GBASE_CR_L = 4,
954 IONIC_XCVR_PID_SFP_25GBASE_CR_N = 5,
955
956
957 IONIC_XCVR_PID_QSFP_100G_AOC = 50,
958 IONIC_XCVR_PID_QSFP_100G_ACC = 51,
959 IONIC_XCVR_PID_QSFP_100G_SR4 = 52,
960 IONIC_XCVR_PID_QSFP_100G_LR4 = 53,
961 IONIC_XCVR_PID_QSFP_100G_ER4 = 54,
962 IONIC_XCVR_PID_QSFP_40GBASE_ER4 = 55,
963 IONIC_XCVR_PID_QSFP_40GBASE_SR4 = 56,
964 IONIC_XCVR_PID_QSFP_40GBASE_LR4 = 57,
965 IONIC_XCVR_PID_QSFP_40GBASE_AOC = 58,
966 IONIC_XCVR_PID_SFP_25GBASE_SR = 59,
967 IONIC_XCVR_PID_SFP_25GBASE_LR = 60,
968 IONIC_XCVR_PID_SFP_25GBASE_ER = 61,
969 IONIC_XCVR_PID_SFP_25GBASE_AOC = 62,
970 IONIC_XCVR_PID_SFP_10GBASE_SR = 63,
971 IONIC_XCVR_PID_SFP_10GBASE_LR = 64,
972 IONIC_XCVR_PID_SFP_10GBASE_LRM = 65,
973 IONIC_XCVR_PID_SFP_10GBASE_ER = 66,
974 IONIC_XCVR_PID_SFP_10GBASE_AOC = 67,
975 IONIC_XCVR_PID_SFP_10GBASE_CU = 68,
976 IONIC_XCVR_PID_QSFP_100G_CWDM4 = 69,
977 IONIC_XCVR_PID_QSFP_100G_PSM4 = 70,
978 };
979
980
981
982
983 enum ionic_port_type {
984 IONIC_PORT_TYPE_NONE = 0,
985 IONIC_PORT_TYPE_ETH = 1,
986 IONIC_PORT_TYPE_MGMT = 2,
987 };
988
989
990
991
992 enum ionic_port_admin_state {
993 IONIC_PORT_ADMIN_STATE_NONE = 0,
994 IONIC_PORT_ADMIN_STATE_DOWN = 1,
995 IONIC_PORT_ADMIN_STATE_UP = 2,
996 };
997
998
999
1000
1001 enum ionic_port_oper_status {
1002 IONIC_PORT_OPER_STATUS_NONE = 0,
1003 IONIC_PORT_OPER_STATUS_UP = 1,
1004 IONIC_PORT_OPER_STATUS_DOWN = 2,
1005 };
1006
1007
1008
1009
1010 enum ionic_port_fec_type {
1011 IONIC_PORT_FEC_TYPE_NONE = 0,
1012 IONIC_PORT_FEC_TYPE_FC = 1,
1013 IONIC_PORT_FEC_TYPE_RS = 2,
1014 };
1015
1016
1017
1018
1019 enum ionic_port_pause_type {
1020 IONIC_PORT_PAUSE_TYPE_NONE = 0,
1021 IONIC_PORT_PAUSE_TYPE_LINK = 1,
1022 IONIC_PORT_PAUSE_TYPE_PFC = 2,
1023 };
1024
1025
1026
1027
1028 enum ionic_port_loopback_mode {
1029 IONIC_PORT_LOOPBACK_MODE_NONE = 0,
1030 IONIC_PORT_LOOPBACK_MODE_MAC = 1,
1031 IONIC_PORT_LOOPBACK_MODE_PHY = 2,
1032 };
1033
1034
1035
1036
1037
1038
1039
1040
1041 struct ionic_xcvr_status {
1042 u8 state;
1043 u8 phy;
1044 __le16 pid;
1045 u8 sprom[256];
1046 };
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058 union ionic_port_config {
1059 struct {
1060 #define IONIC_SPEED_100G 100000
1061 #define IONIC_SPEED_50G 50000
1062 #define IONIC_SPEED_40G 40000
1063 #define IONIC_SPEED_25G 25000
1064 #define IONIC_SPEED_10G 10000
1065 #define IONIC_SPEED_1G 1000
1066 __le32 speed;
1067 __le32 mtu;
1068 u8 state;
1069 u8 an_enable;
1070 u8 fec_type;
1071 #define IONIC_PAUSE_TYPE_MASK 0x0f
1072 #define IONIC_PAUSE_FLAGS_MASK 0xf0
1073 #define IONIC_PAUSE_F_TX 0x10
1074 #define IONIC_PAUSE_F_RX 0x20
1075 u8 pause_type;
1076 u8 loopback_mode;
1077 };
1078 __le32 words[64];
1079 };
1080
1081
1082
1083
1084
1085
1086
1087
1088 struct ionic_port_status {
1089 __le32 id;
1090 __le32 speed;
1091 u8 status;
1092 u8 rsvd[51];
1093 struct ionic_xcvr_status xcvr;
1094 };
1095
1096
1097
1098
1099
1100
1101
1102 struct ionic_port_identify_cmd {
1103 u8 opcode;
1104 u8 index;
1105 u8 ver;
1106 u8 rsvd[61];
1107 };
1108
1109
1110
1111
1112
1113
1114 struct ionic_port_identify_comp {
1115 u8 status;
1116 u8 ver;
1117 u8 rsvd[14];
1118 };
1119
1120
1121
1122
1123
1124
1125
1126 struct ionic_port_init_cmd {
1127 u8 opcode;
1128 u8 index;
1129 u8 rsvd[6];
1130 __le64 info_pa;
1131 u8 rsvd2[48];
1132 };
1133
1134
1135
1136
1137
1138 struct ionic_port_init_comp {
1139 u8 status;
1140 u8 rsvd[15];
1141 };
1142
1143
1144
1145
1146
1147
1148 struct ionic_port_reset_cmd {
1149 u8 opcode;
1150 u8 index;
1151 u8 rsvd[62];
1152 };
1153
1154
1155
1156
1157
1158 struct ionic_port_reset_comp {
1159 u8 status;
1160 u8 rsvd[15];
1161 };
1162
1163
1164
1165
1166 enum ionic_stats_ctl_cmd {
1167 IONIC_STATS_CTL_RESET = 0,
1168 };
1169
1170
1171
1172
1173
1174 enum ionic_port_attr {
1175 IONIC_PORT_ATTR_STATE = 0,
1176 IONIC_PORT_ATTR_SPEED = 1,
1177 IONIC_PORT_ATTR_MTU = 2,
1178 IONIC_PORT_ATTR_AUTONEG = 3,
1179 IONIC_PORT_ATTR_FEC = 4,
1180 IONIC_PORT_ATTR_PAUSE = 5,
1181 IONIC_PORT_ATTR_LOOPBACK = 6,
1182 IONIC_PORT_ATTR_STATS_CTRL = 7,
1183 };
1184
1185
1186
1187
1188
1189
1190
1191 struct ionic_port_setattr_cmd {
1192 u8 opcode;
1193 u8 index;
1194 u8 attr;
1195 u8 rsvd;
1196 union {
1197 u8 state;
1198 __le32 speed;
1199 __le32 mtu;
1200 u8 an_enable;
1201 u8 fec_type;
1202 u8 pause_type;
1203 u8 loopback_mode;
1204 u8 stats_ctl;
1205 u8 rsvd2[60];
1206 };
1207 };
1208
1209
1210
1211
1212
1213
1214 struct ionic_port_setattr_comp {
1215 u8 status;
1216 u8 rsvd[14];
1217 u8 color;
1218 };
1219
1220
1221
1222
1223
1224
1225
1226 struct ionic_port_getattr_cmd {
1227 u8 opcode;
1228 u8 index;
1229 u8 attr;
1230 u8 rsvd[61];
1231 };
1232
1233
1234
1235
1236
1237
1238 struct ionic_port_getattr_comp {
1239 u8 status;
1240 u8 rsvd[3];
1241 union {
1242 u8 state;
1243 __le32 speed;
1244 __le32 mtu;
1245 u8 an_enable;
1246 u8 fec_type;
1247 u8 pause_type;
1248 u8 loopback_mode;
1249 u8 rsvd2[11];
1250 };
1251 u8 color;
1252 };
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262 struct ionic_lif_status {
1263 __le64 eid;
1264 u8 port_num;
1265 u8 rsvd;
1266 __le16 link_status;
1267 __le32 link_speed;
1268 __le16 link_down_count;
1269 u8 rsvd2[46];
1270 };
1271
1272
1273
1274
1275
1276
1277 struct ionic_lif_reset_cmd {
1278 u8 opcode;
1279 u8 rsvd;
1280 __le16 index;
1281 __le32 rsvd2[15];
1282 };
1283
1284 typedef struct ionic_admin_comp ionic_lif_reset_comp;
1285
1286 enum ionic_dev_state {
1287 IONIC_DEV_DISABLE = 0,
1288 IONIC_DEV_ENABLE = 1,
1289 IONIC_DEV_HANG_RESET = 2,
1290 };
1291
1292
1293
1294
1295 enum ionic_dev_attr {
1296 IONIC_DEV_ATTR_STATE = 0,
1297 IONIC_DEV_ATTR_NAME = 1,
1298 IONIC_DEV_ATTR_FEATURES = 2,
1299 };
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309 struct ionic_dev_setattr_cmd {
1310 u8 opcode;
1311 u8 attr;
1312 __le16 rsvd;
1313 union {
1314 u8 state;
1315 char name[IONIC_IFNAMSIZ];
1316 __le64 features;
1317 u8 rsvd2[60];
1318 };
1319 };
1320
1321
1322
1323
1324
1325
1326
1327 struct ionic_dev_setattr_comp {
1328 u8 status;
1329 u8 rsvd[3];
1330 union {
1331 __le64 features;
1332 u8 rsvd2[11];
1333 };
1334 u8 color;
1335 };
1336
1337
1338
1339
1340
1341
1342 struct ionic_dev_getattr_cmd {
1343 u8 opcode;
1344 u8 attr;
1345 u8 rsvd[62];
1346 };
1347
1348
1349
1350
1351
1352
1353
1354 struct ionic_dev_getattr_comp {
1355 u8 status;
1356 u8 rsvd[3];
1357 union {
1358 __le64 features;
1359 u8 rsvd2[11];
1360 };
1361 u8 color;
1362 };
1363
1364
1365
1366
1367 #define IONIC_RSS_HASH_KEY_SIZE 40
1368
1369 enum ionic_rss_hash_types {
1370 IONIC_RSS_TYPE_IPV4 = BIT(0),
1371 IONIC_RSS_TYPE_IPV4_TCP = BIT(1),
1372 IONIC_RSS_TYPE_IPV4_UDP = BIT(2),
1373 IONIC_RSS_TYPE_IPV6 = BIT(3),
1374 IONIC_RSS_TYPE_IPV6_TCP = BIT(4),
1375 IONIC_RSS_TYPE_IPV6_UDP = BIT(5),
1376 };
1377
1378
1379
1380
1381 enum ionic_lif_attr {
1382 IONIC_LIF_ATTR_STATE = 0,
1383 IONIC_LIF_ATTR_NAME = 1,
1384 IONIC_LIF_ATTR_MTU = 2,
1385 IONIC_LIF_ATTR_MAC = 3,
1386 IONIC_LIF_ATTR_FEATURES = 4,
1387 IONIC_LIF_ATTR_RSS = 5,
1388 IONIC_LIF_ATTR_STATS_CTRL = 6,
1389 };
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407 struct ionic_lif_setattr_cmd {
1408 u8 opcode;
1409 u8 attr;
1410 __le16 index;
1411 union {
1412 u8 state;
1413 char name[IONIC_IFNAMSIZ];
1414 __le32 mtu;
1415 u8 mac[6];
1416 __le64 features;
1417 struct {
1418 __le16 types;
1419 u8 key[IONIC_RSS_HASH_KEY_SIZE];
1420 u8 rsvd[6];
1421 __le64 addr;
1422 } rss;
1423 u8 stats_ctl;
1424 u8 rsvd[60];
1425 };
1426 };
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436 struct ionic_lif_setattr_comp {
1437 u8 status;
1438 u8 rsvd;
1439 __le16 comp_index;
1440 union {
1441 __le64 features;
1442 u8 rsvd2[11];
1443 };
1444 u8 color;
1445 };
1446
1447
1448
1449
1450
1451
1452
1453 struct ionic_lif_getattr_cmd {
1454 u8 opcode;
1455 u8 attr;
1456 __le16 index;
1457 u8 rsvd[60];
1458 };
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472 struct ionic_lif_getattr_comp {
1473 u8 status;
1474 u8 rsvd;
1475 __le16 comp_index;
1476 union {
1477 u8 state;
1478 __le32 mtu;
1479 u8 mac[6];
1480 __le64 features;
1481 u8 rsvd2[11];
1482 };
1483 u8 color;
1484 };
1485
1486 enum ionic_rx_mode {
1487 IONIC_RX_MODE_F_UNICAST = BIT(0),
1488 IONIC_RX_MODE_F_MULTICAST = BIT(1),
1489 IONIC_RX_MODE_F_BROADCAST = BIT(2),
1490 IONIC_RX_MODE_F_PROMISC = BIT(3),
1491 IONIC_RX_MODE_F_ALLMULTI = BIT(4),
1492 };
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505 struct ionic_rx_mode_set_cmd {
1506 u8 opcode;
1507 u8 rsvd;
1508 __le16 lif_index;
1509 __le16 rx_mode;
1510 __le16 rsvd2[29];
1511 };
1512
1513 typedef struct ionic_admin_comp ionic_rx_mode_set_comp;
1514
1515 enum ionic_rx_filter_match_type {
1516 IONIC_RX_FILTER_MATCH_VLAN = 0,
1517 IONIC_RX_FILTER_MATCH_MAC,
1518 IONIC_RX_FILTER_MATCH_MAC_VLAN,
1519 };
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531 struct ionic_rx_filter_add_cmd {
1532 u8 opcode;
1533 u8 qtype;
1534 __le16 lif_index;
1535 __le32 qid;
1536 __le16 match;
1537 union {
1538 struct {
1539 __le16 vlan;
1540 } vlan;
1541 struct {
1542 u8 addr[6];
1543 } mac;
1544 struct {
1545 __le16 vlan;
1546 u8 addr[6];
1547 } mac_vlan;
1548 u8 rsvd[54];
1549 };
1550 };
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560 struct ionic_rx_filter_add_comp {
1561 u8 status;
1562 u8 rsvd;
1563 __le16 comp_index;
1564 __le32 filter_id;
1565 u8 rsvd2[7];
1566 u8 color;
1567 };
1568
1569
1570
1571
1572
1573
1574
1575 struct ionic_rx_filter_del_cmd {
1576 u8 opcode;
1577 u8 rsvd;
1578 __le16 lif_index;
1579 __le32 filter_id;
1580 u8 rsvd2[56];
1581 };
1582
1583 typedef struct ionic_admin_comp ionic_rx_filter_del_comp;
1584
1585
1586
1587
1588
1589
1590
1591 struct ionic_qos_identify_cmd {
1592 u8 opcode;
1593 u8 ver;
1594 u8 rsvd[62];
1595 };
1596
1597
1598
1599
1600
1601
1602 struct ionic_qos_identify_comp {
1603 u8 status;
1604 u8 ver;
1605 u8 rsvd[14];
1606 };
1607
1608 #define IONIC_QOS_CLASS_MAX 7
1609 #define IONIC_QOS_CLASS_NAME_SZ 32
1610 #define IONIC_QOS_DSCP_MAX_VALUES 64
1611
1612
1613
1614
1615 enum ionic_qos_class {
1616 IONIC_QOS_CLASS_DEFAULT = 0,
1617 IONIC_QOS_CLASS_USER_DEFINED_1 = 1,
1618 IONIC_QOS_CLASS_USER_DEFINED_2 = 2,
1619 IONIC_QOS_CLASS_USER_DEFINED_3 = 3,
1620 IONIC_QOS_CLASS_USER_DEFINED_4 = 4,
1621 IONIC_QOS_CLASS_USER_DEFINED_5 = 5,
1622 IONIC_QOS_CLASS_USER_DEFINED_6 = 6,
1623 };
1624
1625
1626
1627
1628 enum ionic_qos_class_type {
1629 IONIC_QOS_CLASS_TYPE_NONE = 0,
1630 IONIC_QOS_CLASS_TYPE_PCP = 1,
1631 IONIC_QOS_CLASS_TYPE_DSCP = 2,
1632 };
1633
1634
1635
1636
1637 enum ionic_qos_sched_type {
1638 IONIC_QOS_SCHED_TYPE_STRICT = 0,
1639 IONIC_QOS_SCHED_TYPE_DWRR = 1,
1640 };
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663 union ionic_qos_config {
1664 struct {
1665 #define IONIC_QOS_CONFIG_F_ENABLE BIT(0)
1666 #define IONIC_QOS_CONFIG_F_DROP BIT(1)
1667 #define IONIC_QOS_CONFIG_F_RW_DOT1Q_PCP BIT(2)
1668 #define IONIC_QOS_CONFIG_F_RW_IP_DSCP BIT(3)
1669 u8 flags;
1670 u8 sched_type;
1671 u8 class_type;
1672 u8 pause_type;
1673 char name[IONIC_QOS_CLASS_NAME_SZ];
1674 __le32 mtu;
1675
1676 u8 pfc_cos;
1677
1678 union {
1679 u8 dwrr_weight;
1680 __le64 strict_rlmt;
1681 };
1682
1683 union {
1684 u8 rw_dot1q_pcp;
1685 u8 rw_ip_dscp;
1686 };
1687
1688 union {
1689 u8 dot1q_pcp;
1690 struct {
1691 u8 ndscp;
1692 u8 ip_dscp[IONIC_QOS_DSCP_MAX_VALUES];
1693 };
1694 };
1695 };
1696 __le32 words[64];
1697 };
1698
1699
1700
1701
1702
1703
1704
1705
1706 union ionic_qos_identity {
1707 struct {
1708 u8 version;
1709 u8 type;
1710 u8 rsvd[62];
1711 union ionic_qos_config config[IONIC_QOS_CLASS_MAX];
1712 };
1713 __le32 words[512];
1714 };
1715
1716
1717
1718
1719
1720
1721
1722 struct ionic_qos_init_cmd {
1723 u8 opcode;
1724 u8 group;
1725 u8 rsvd[6];
1726 __le64 info_pa;
1727 u8 rsvd1[48];
1728 };
1729
1730 typedef struct ionic_admin_comp ionic_qos_init_comp;
1731
1732
1733
1734
1735
1736 struct ionic_qos_reset_cmd {
1737 u8 opcode;
1738 u8 group;
1739 u8 rsvd[62];
1740 };
1741
1742 typedef struct ionic_admin_comp ionic_qos_reset_comp;
1743
1744
1745
1746
1747
1748
1749
1750
1751 struct ionic_fw_download_cmd {
1752 u8 opcode;
1753 u8 rsvd[3];
1754 __le32 offset;
1755 __le64 addr;
1756 __le32 length;
1757 };
1758
1759 typedef struct ionic_admin_comp ionic_fw_download_comp;
1760
1761 enum ionic_fw_control_oper {
1762 IONIC_FW_RESET = 0,
1763 IONIC_FW_INSTALL = 1,
1764 IONIC_FW_ACTIVATE = 2,
1765 };
1766
1767
1768
1769
1770
1771
1772
1773 struct ionic_fw_control_cmd {
1774 u8 opcode;
1775 u8 rsvd[3];
1776 u8 oper;
1777 u8 slot;
1778 u8 rsvd1[58];
1779 };
1780
1781
1782
1783
1784
1785
1786 struct ionic_fw_control_comp {
1787 u8 status;
1788 u8 rsvd;
1789 __le16 comp_index;
1790 u8 slot;
1791 u8 rsvd1[10];
1792 u8 color;
1793 };
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808 struct ionic_rdma_reset_cmd {
1809 u8 opcode;
1810 u8 rsvd;
1811 __le16 lif_index;
1812 u8 rsvd2[60];
1813 };
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844 struct ionic_rdma_queue_cmd {
1845 u8 opcode;
1846 u8 rsvd;
1847 __le16 lif_index;
1848 __le32 qid_ver;
1849 __le32 cid;
1850 __le16 dbid;
1851 u8 depth_log2;
1852 u8 stride_log2;
1853 __le64 dma_addr;
1854 u8 rsvd2[36];
1855 __le32 xxx_table_index;
1856 };
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871 struct ionic_notifyq_event {
1872 __le64 eid;
1873 __le16 ecode;
1874 u8 data[54];
1875 };
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886 struct ionic_link_change_event {
1887 __le64 eid;
1888 __le16 ecode;
1889 __le16 link_status;
1890 __le32 link_speed;
1891 u8 rsvd[48];
1892 };
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904 struct ionic_reset_event {
1905 __le64 eid;
1906 __le16 ecode;
1907 u8 reset_code;
1908 u8 state;
1909 u8 rsvd[52];
1910 };
1911
1912
1913
1914
1915
1916
1917
1918
1919 struct ionic_heartbeat_event {
1920 __le64 eid;
1921 __le16 ecode;
1922 u8 rsvd[54];
1923 };
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933 struct ionic_log_event {
1934 __le64 eid;
1935 __le16 ecode;
1936 u8 data[54];
1937 };
1938
1939
1940
1941
1942 struct ionic_port_stats {
1943 __le64 frames_rx_ok;
1944 __le64 frames_rx_all;
1945 __le64 frames_rx_bad_fcs;
1946 __le64 frames_rx_bad_all;
1947 __le64 octets_rx_ok;
1948 __le64 octets_rx_all;
1949 __le64 frames_rx_unicast;
1950 __le64 frames_rx_multicast;
1951 __le64 frames_rx_broadcast;
1952 __le64 frames_rx_pause;
1953 __le64 frames_rx_bad_length;
1954 __le64 frames_rx_undersized;
1955 __le64 frames_rx_oversized;
1956 __le64 frames_rx_fragments;
1957 __le64 frames_rx_jabber;
1958 __le64 frames_rx_pripause;
1959 __le64 frames_rx_stomped_crc;
1960 __le64 frames_rx_too_long;
1961 __le64 frames_rx_vlan_good;
1962 __le64 frames_rx_dropped;
1963 __le64 frames_rx_less_than_64b;
1964 __le64 frames_rx_64b;
1965 __le64 frames_rx_65b_127b;
1966 __le64 frames_rx_128b_255b;
1967 __le64 frames_rx_256b_511b;
1968 __le64 frames_rx_512b_1023b;
1969 __le64 frames_rx_1024b_1518b;
1970 __le64 frames_rx_1519b_2047b;
1971 __le64 frames_rx_2048b_4095b;
1972 __le64 frames_rx_4096b_8191b;
1973 __le64 frames_rx_8192b_9215b;
1974 __le64 frames_rx_other;
1975 __le64 frames_tx_ok;
1976 __le64 frames_tx_all;
1977 __le64 frames_tx_bad;
1978 __le64 octets_tx_ok;
1979 __le64 octets_tx_total;
1980 __le64 frames_tx_unicast;
1981 __le64 frames_tx_multicast;
1982 __le64 frames_tx_broadcast;
1983 __le64 frames_tx_pause;
1984 __le64 frames_tx_pripause;
1985 __le64 frames_tx_vlan;
1986 __le64 frames_tx_less_than_64b;
1987 __le64 frames_tx_64b;
1988 __le64 frames_tx_65b_127b;
1989 __le64 frames_tx_128b_255b;
1990 __le64 frames_tx_256b_511b;
1991 __le64 frames_tx_512b_1023b;
1992 __le64 frames_tx_1024b_1518b;
1993 __le64 frames_tx_1519b_2047b;
1994 __le64 frames_tx_2048b_4095b;
1995 __le64 frames_tx_4096b_8191b;
1996 __le64 frames_tx_8192b_9215b;
1997 __le64 frames_tx_other;
1998 __le64 frames_tx_pri_0;
1999 __le64 frames_tx_pri_1;
2000 __le64 frames_tx_pri_2;
2001 __le64 frames_tx_pri_3;
2002 __le64 frames_tx_pri_4;
2003 __le64 frames_tx_pri_5;
2004 __le64 frames_tx_pri_6;
2005 __le64 frames_tx_pri_7;
2006 __le64 frames_rx_pri_0;
2007 __le64 frames_rx_pri_1;
2008 __le64 frames_rx_pri_2;
2009 __le64 frames_rx_pri_3;
2010 __le64 frames_rx_pri_4;
2011 __le64 frames_rx_pri_5;
2012 __le64 frames_rx_pri_6;
2013 __le64 frames_rx_pri_7;
2014 __le64 tx_pripause_0_1us_count;
2015 __le64 tx_pripause_1_1us_count;
2016 __le64 tx_pripause_2_1us_count;
2017 __le64 tx_pripause_3_1us_count;
2018 __le64 tx_pripause_4_1us_count;
2019 __le64 tx_pripause_5_1us_count;
2020 __le64 tx_pripause_6_1us_count;
2021 __le64 tx_pripause_7_1us_count;
2022 __le64 rx_pripause_0_1us_count;
2023 __le64 rx_pripause_1_1us_count;
2024 __le64 rx_pripause_2_1us_count;
2025 __le64 rx_pripause_3_1us_count;
2026 __le64 rx_pripause_4_1us_count;
2027 __le64 rx_pripause_5_1us_count;
2028 __le64 rx_pripause_6_1us_count;
2029 __le64 rx_pripause_7_1us_count;
2030 __le64 rx_pause_1us_count;
2031 __le64 frames_tx_truncated;
2032 };
2033
2034 struct ionic_mgmt_port_stats {
2035 __le64 frames_rx_ok;
2036 __le64 frames_rx_all;
2037 __le64 frames_rx_bad_fcs;
2038 __le64 frames_rx_bad_all;
2039 __le64 octets_rx_ok;
2040 __le64 octets_rx_all;
2041 __le64 frames_rx_unicast;
2042 __le64 frames_rx_multicast;
2043 __le64 frames_rx_broadcast;
2044 __le64 frames_rx_pause;
2045 __le64 frames_rx_bad_length0;
2046 __le64 frames_rx_undersized1;
2047 __le64 frames_rx_oversized2;
2048 __le64 frames_rx_fragments3;
2049 __le64 frames_rx_jabber4;
2050 __le64 frames_rx_64b5;
2051 __le64 frames_rx_65b_127b6;
2052 __le64 frames_rx_128b_255b7;
2053 __le64 frames_rx_256b_511b8;
2054 __le64 frames_rx_512b_1023b9;
2055 __le64 frames_rx_1024b_1518b0;
2056 __le64 frames_rx_gt_1518b1;
2057 __le64 frames_rx_fifo_full2;
2058 __le64 frames_tx_ok3;
2059 __le64 frames_tx_all4;
2060 __le64 frames_tx_bad5;
2061 __le64 octets_tx_ok6;
2062 __le64 octets_tx_total7;
2063 __le64 frames_tx_unicast8;
2064 __le64 frames_tx_multicast9;
2065 __le64 frames_tx_broadcast0;
2066 __le64 frames_tx_pause1;
2067 };
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083 union ionic_port_identity {
2084 struct {
2085 u8 version;
2086 u8 type;
2087 u8 num_lanes;
2088 u8 autoneg;
2089 __le32 min_frame_size;
2090 __le32 max_frame_size;
2091 u8 fec_type[4];
2092 u8 pause_type[2];
2093 u8 loopback_mode[2];
2094 __le32 speeds[16];
2095 u8 rsvd2[44];
2096 union ionic_port_config config;
2097 };
2098 __le32 words[512];
2099 };
2100
2101
2102
2103
2104
2105
2106 struct ionic_port_info {
2107 union ionic_port_config config;
2108 struct ionic_port_status status;
2109 struct ionic_port_stats stats;
2110 };
2111
2112
2113
2114
2115 struct ionic_lif_stats {
2116
2117 __le64 rx_ucast_bytes;
2118 __le64 rx_ucast_packets;
2119 __le64 rx_mcast_bytes;
2120 __le64 rx_mcast_packets;
2121 __le64 rx_bcast_bytes;
2122 __le64 rx_bcast_packets;
2123 __le64 rsvd0;
2124 __le64 rsvd1;
2125
2126 __le64 rx_ucast_drop_bytes;
2127 __le64 rx_ucast_drop_packets;
2128 __le64 rx_mcast_drop_bytes;
2129 __le64 rx_mcast_drop_packets;
2130 __le64 rx_bcast_drop_bytes;
2131 __le64 rx_bcast_drop_packets;
2132 __le64 rx_dma_error;
2133 __le64 rsvd2;
2134
2135 __le64 tx_ucast_bytes;
2136 __le64 tx_ucast_packets;
2137 __le64 tx_mcast_bytes;
2138 __le64 tx_mcast_packets;
2139 __le64 tx_bcast_bytes;
2140 __le64 tx_bcast_packets;
2141 __le64 rsvd3;
2142 __le64 rsvd4;
2143
2144 __le64 tx_ucast_drop_bytes;
2145 __le64 tx_ucast_drop_packets;
2146 __le64 tx_mcast_drop_bytes;
2147 __le64 tx_mcast_drop_packets;
2148 __le64 tx_bcast_drop_bytes;
2149 __le64 tx_bcast_drop_packets;
2150 __le64 tx_dma_error;
2151 __le64 rsvd5;
2152
2153 __le64 rx_queue_disabled;
2154 __le64 rx_queue_empty;
2155 __le64 rx_queue_error;
2156 __le64 rx_desc_fetch_error;
2157 __le64 rx_desc_data_error;
2158 __le64 rsvd6;
2159 __le64 rsvd7;
2160 __le64 rsvd8;
2161
2162 __le64 tx_queue_disabled;
2163 __le64 tx_queue_error;
2164 __le64 tx_desc_fetch_error;
2165 __le64 tx_desc_data_error;
2166 __le64 rsvd9;
2167 __le64 rsvd10;
2168 __le64 rsvd11;
2169 __le64 rsvd12;
2170
2171
2172 __le64 tx_rdma_ucast_bytes;
2173 __le64 tx_rdma_ucast_packets;
2174 __le64 tx_rdma_mcast_bytes;
2175 __le64 tx_rdma_mcast_packets;
2176 __le64 tx_rdma_cnp_packets;
2177 __le64 rsvd13;
2178 __le64 rsvd14;
2179 __le64 rsvd15;
2180
2181
2182 __le64 rx_rdma_ucast_bytes;
2183 __le64 rx_rdma_ucast_packets;
2184 __le64 rx_rdma_mcast_bytes;
2185 __le64 rx_rdma_mcast_packets;
2186 __le64 rx_rdma_cnp_packets;
2187 __le64 rx_rdma_ecn_packets;
2188 __le64 rsvd16;
2189 __le64 rsvd17;
2190
2191 __le64 rsvd18;
2192 __le64 rsvd19;
2193 __le64 rsvd20;
2194 __le64 rsvd21;
2195 __le64 rsvd22;
2196 __le64 rsvd23;
2197 __le64 rsvd24;
2198 __le64 rsvd25;
2199
2200 __le64 rsvd26;
2201 __le64 rsvd27;
2202 __le64 rsvd28;
2203 __le64 rsvd29;
2204 __le64 rsvd30;
2205 __le64 rsvd31;
2206 __le64 rsvd32;
2207 __le64 rsvd33;
2208
2209 __le64 rsvd34;
2210 __le64 rsvd35;
2211 __le64 rsvd36;
2212 __le64 rsvd37;
2213 __le64 rsvd38;
2214 __le64 rsvd39;
2215 __le64 rsvd40;
2216 __le64 rsvd41;
2217
2218 __le64 rsvd42;
2219 __le64 rsvd43;
2220 __le64 rsvd44;
2221 __le64 rsvd45;
2222 __le64 rsvd46;
2223 __le64 rsvd47;
2224 __le64 rsvd48;
2225 __le64 rsvd49;
2226
2227
2228 __le64 rdma_req_rx_pkt_seq_err;
2229 __le64 rdma_req_rx_rnr_retry_err;
2230 __le64 rdma_req_rx_remote_access_err;
2231 __le64 rdma_req_rx_remote_inv_req_err;
2232 __le64 rdma_req_rx_remote_oper_err;
2233 __le64 rdma_req_rx_implied_nak_seq_err;
2234 __le64 rdma_req_rx_cqe_err;
2235 __le64 rdma_req_rx_cqe_flush_err;
2236
2237 __le64 rdma_req_rx_dup_responses;
2238 __le64 rdma_req_rx_invalid_packets;
2239 __le64 rdma_req_tx_local_access_err;
2240 __le64 rdma_req_tx_local_oper_err;
2241 __le64 rdma_req_tx_memory_mgmt_err;
2242 __le64 rsvd52;
2243 __le64 rsvd53;
2244 __le64 rsvd54;
2245
2246
2247 __le64 rdma_resp_rx_dup_requests;
2248 __le64 rdma_resp_rx_out_of_buffer;
2249 __le64 rdma_resp_rx_out_of_seq_pkts;
2250 __le64 rdma_resp_rx_cqe_err;
2251 __le64 rdma_resp_rx_cqe_flush_err;
2252 __le64 rdma_resp_rx_local_len_err;
2253 __le64 rdma_resp_rx_inv_request_err;
2254 __le64 rdma_resp_rx_local_qp_oper_err;
2255
2256 __le64 rdma_resp_rx_out_of_atomic_resource;
2257 __le64 rdma_resp_tx_pkt_seq_err;
2258 __le64 rdma_resp_tx_remote_inv_req_err;
2259 __le64 rdma_resp_tx_remote_access_err;
2260 __le64 rdma_resp_tx_remote_oper_err;
2261 __le64 rdma_resp_tx_rnr_retry_err;
2262 __le64 rsvd57;
2263 __le64 rsvd58;
2264 };
2265
2266
2267
2268
2269 struct ionic_lif_info {
2270 union ionic_lif_config config;
2271 struct ionic_lif_status status;
2272 struct ionic_lif_stats stats;
2273 };
2274
2275 union ionic_dev_cmd {
2276 u32 words[16];
2277 struct ionic_admin_cmd cmd;
2278 struct ionic_nop_cmd nop;
2279
2280 struct ionic_dev_identify_cmd identify;
2281 struct ionic_dev_init_cmd init;
2282 struct ionic_dev_reset_cmd reset;
2283 struct ionic_dev_getattr_cmd getattr;
2284 struct ionic_dev_setattr_cmd setattr;
2285
2286 struct ionic_port_identify_cmd port_identify;
2287 struct ionic_port_init_cmd port_init;
2288 struct ionic_port_reset_cmd port_reset;
2289 struct ionic_port_getattr_cmd port_getattr;
2290 struct ionic_port_setattr_cmd port_setattr;
2291
2292 struct ionic_lif_identify_cmd lif_identify;
2293 struct ionic_lif_init_cmd lif_init;
2294 struct ionic_lif_reset_cmd lif_reset;
2295
2296 struct ionic_qos_identify_cmd qos_identify;
2297 struct ionic_qos_init_cmd qos_init;
2298 struct ionic_qos_reset_cmd qos_reset;
2299
2300 struct ionic_q_init_cmd q_init;
2301 };
2302
2303 union ionic_dev_cmd_comp {
2304 u32 words[4];
2305 u8 status;
2306 struct ionic_admin_comp comp;
2307 struct ionic_nop_comp nop;
2308
2309 struct ionic_dev_identify_comp identify;
2310 struct ionic_dev_init_comp init;
2311 struct ionic_dev_reset_comp reset;
2312 struct ionic_dev_getattr_comp getattr;
2313 struct ionic_dev_setattr_comp setattr;
2314
2315 struct ionic_port_identify_comp port_identify;
2316 struct ionic_port_init_comp port_init;
2317 struct ionic_port_reset_comp port_reset;
2318 struct ionic_port_getattr_comp port_getattr;
2319 struct ionic_port_setattr_comp port_setattr;
2320
2321 struct ionic_lif_identify_comp lif_identify;
2322 struct ionic_lif_init_comp lif_init;
2323 ionic_lif_reset_comp lif_reset;
2324
2325 struct ionic_qos_identify_comp qos_identify;
2326 ionic_qos_init_comp qos_init;
2327 ionic_qos_reset_comp qos_reset;
2328
2329 struct ionic_q_init_comp q_init;
2330 };
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343 union ionic_dev_info_regs {
2344 #define IONIC_DEVINFO_FWVERS_BUFLEN 32
2345 #define IONIC_DEVINFO_SERIAL_BUFLEN 32
2346 struct {
2347 u32 signature;
2348 u8 version;
2349 u8 asic_type;
2350 u8 asic_rev;
2351 u8 fw_status;
2352 u32 fw_heartbeat;
2353 char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN];
2354 char serial_num[IONIC_DEVINFO_SERIAL_BUFLEN];
2355 };
2356 u32 words[512];
2357 };
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369 union ionic_dev_cmd_regs {
2370 struct {
2371 u32 doorbell;
2372 u32 done;
2373 union ionic_dev_cmd cmd;
2374 union ionic_dev_cmd_comp comp;
2375 u8 rsvd[48];
2376 u32 data[478];
2377 };
2378 u32 words[512];
2379 };
2380
2381
2382
2383
2384
2385
2386 union ionic_dev_regs {
2387 struct {
2388 union ionic_dev_info_regs info;
2389 union ionic_dev_cmd_regs devcmd;
2390 };
2391 __le32 words[1024];
2392 };
2393
2394 union ionic_adminq_cmd {
2395 struct ionic_admin_cmd cmd;
2396 struct ionic_nop_cmd nop;
2397 struct ionic_q_init_cmd q_init;
2398 struct ionic_q_control_cmd q_control;
2399 struct ionic_lif_setattr_cmd lif_setattr;
2400 struct ionic_lif_getattr_cmd lif_getattr;
2401 struct ionic_rx_mode_set_cmd rx_mode_set;
2402 struct ionic_rx_filter_add_cmd rx_filter_add;
2403 struct ionic_rx_filter_del_cmd rx_filter_del;
2404 struct ionic_rdma_reset_cmd rdma_reset;
2405 struct ionic_rdma_queue_cmd rdma_queue;
2406 struct ionic_fw_download_cmd fw_download;
2407 struct ionic_fw_control_cmd fw_control;
2408 };
2409
2410 union ionic_adminq_comp {
2411 struct ionic_admin_comp comp;
2412 struct ionic_nop_comp nop;
2413 struct ionic_q_init_comp q_init;
2414 struct ionic_lif_setattr_comp lif_setattr;
2415 struct ionic_lif_getattr_comp lif_getattr;
2416 struct ionic_rx_filter_add_comp rx_filter_add;
2417 struct ionic_fw_control_comp fw_control;
2418 };
2419
2420 #define IONIC_BARS_MAX 6
2421 #define IONIC_PCI_BAR_DBELL 1
2422
2423
2424 #define IONIC_BAR0_SIZE 0x8000
2425
2426 #define IONIC_BAR0_DEV_INFO_REGS_OFFSET 0x0000
2427 #define IONIC_BAR0_DEV_CMD_REGS_OFFSET 0x0800
2428 #define IONIC_BAR0_DEV_CMD_DATA_REGS_OFFSET 0x0c00
2429 #define IONIC_BAR0_INTR_STATUS_OFFSET 0x1000
2430 #define IONIC_BAR0_INTR_CTRL_OFFSET 0x2000
2431 #define IONIC_DEV_CMD_DONE 0x00000001
2432
2433 #define IONIC_ASIC_TYPE_CAPRI 0
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447 struct ionic_doorbell {
2448 __le16 p_index;
2449 u8 ring;
2450 u8 qid_lo;
2451 __le16 qid_hi;
2452 u16 rsvd2;
2453 };
2454
2455 struct ionic_intr_status {
2456 u32 status[2];
2457 };
2458
2459 struct ionic_notifyq_cmd {
2460 __le32 data;
2461 };
2462
2463 union ionic_notifyq_comp {
2464 struct ionic_notifyq_event event;
2465 struct ionic_link_change_event link_change;
2466 struct ionic_reset_event reset;
2467 struct ionic_heartbeat_event heartbeat;
2468 struct ionic_log_event log;
2469 };
2470
2471
2472 struct ionic_identity {
2473 union ionic_drv_identity drv;
2474 union ionic_dev_identity dev;
2475 union ionic_lif_identity lif;
2476 union ionic_port_identity port;
2477 union ionic_qos_identity qos;
2478 };
2479
2480 #pragma pack(pop)
2481
2482 #endif