-
Notifications
You must be signed in to change notification settings - Fork 476
/
saiport.h
4251 lines (3591 loc) · 121 KB
/
saiport.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
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
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
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
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
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
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
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
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Copyright (c) 2014 Microsoft Open Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
* LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS
* FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing
* permissions and limitations under the License.
*
* Microsoft would like to thank the following companies for their review and
* assistance with these files: Intel Corporation, Mellanox Technologies Ltd,
* Dell Products, L.P., Facebook, Inc., Marvell International Ltd.
*
* @file saiport.h
*
* @brief This module defines SAI Port interface
*/
#if !defined (__SAIPORT_H_)
#define __SAIPORT_H_
#include <saitypes.h>
/**
* @defgroup SAIPORT SAI - Port specific API definitions
*
* @{
*/
/**
* @brief Attribute data for #SAI_PORT_ATTR_TYPE
*/
typedef enum _sai_port_type_t
{
/** Actual port. N.B. Different from the physical port. */
SAI_PORT_TYPE_LOGICAL,
/** CPU Port */
SAI_PORT_TYPE_CPU,
/** Fabric Port */
SAI_PORT_TYPE_FABRIC,
/** Recycle Port */
SAI_PORT_TYPE_RECYCLE,
} sai_port_type_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_OPER_STATUS
*/
typedef enum _sai_port_oper_status_t
{
/** Unknown */
SAI_PORT_OPER_STATUS_UNKNOWN,
/** Up */
SAI_PORT_OPER_STATUS_UP,
/** Down */
SAI_PORT_OPER_STATUS_DOWN,
/** Test Running */
SAI_PORT_OPER_STATUS_TESTING,
/** Not Present */
SAI_PORT_OPER_STATUS_NOT_PRESENT
} sai_port_oper_status_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_ERROR_STATUS
*
* Note enum values must be powers of 2 to be used as Bit mask to query multiple errors
*
* @flags strict
*/
typedef enum _sai_port_error_status_t
{
/** No errors */
SAI_PORT_ERROR_STATUS_CLEAR = 0,
/** MAC Local fault asserted */
SAI_PORT_ERROR_STATUS_MAC_LOCAL_FAULT = 1 << 0,
/** MAC Remote fault asserted */
SAI_PORT_ERROR_STATUS_MAC_REMOTE_FAULT = 1 << 1,
/** FEC loss of sync asserted */
SAI_PORT_ERROR_STATUS_FEC_SYNC_LOSS = 1 << 2,
/** FEC loss of alignment marker asserted */
SAI_PORT_ERROR_STATUS_FEC_LOSS_ALIGNMENT_MARKER = 1 << 3,
/** High SER asserted */
SAI_PORT_ERROR_STATUS_HIGH_SER = 1 << 4,
/** High BER asserted */
SAI_PORT_ERROR_STATUS_HIGH_BER = 1 << 5,
/** Rate of data units with CRC errors passed its threshold */
SAI_PORT_ERROR_STATUS_CRC_RATE = 1 << 6,
/** Data Unit CRC Error */
SAI_PORT_ERROR_STATUS_DATA_UNIT_CRC_ERROR = 1 << 7,
/** Data Unit Size Error */
SAI_PORT_ERROR_STATUS_DATA_UNIT_SIZE = 1 << 8,
/** Data Unit Misalignment Error */
SAI_PORT_ERROR_STATUS_DATA_UNIT_MISALIGNMENT_ERROR = 1 << 9,
/** Uncorrectable RS-FEC code word error */
SAI_PORT_ERROR_STATUS_CODE_GROUP_ERROR = 1 << 10,
/** SerDes Signal is out of sync */
SAI_PORT_ERROR_STATUS_SIGNAL_LOCAL_ERROR = 1 << 11,
/** Port is not accepting reachability data units */
SAI_PORT_ERROR_STATUS_NO_RX_REACHABILITY = 1 << 12
} sai_port_error_status_t;
/**
* @brief Defines the operational status of the port
*/
typedef struct _sai_port_oper_status_notification_t
{
/**
* @brief Port id.
*
* @objects SAI_OBJECT_TYPE_PORT, SAI_OBJECT_TYPE_BRIDGE_PORT, SAI_OBJECT_TYPE_LAG
*/
sai_object_id_t port_id;
/** Port operational status */
sai_port_oper_status_t port_state;
/** Bitmap of various port error or fault status */
sai_port_error_status_t port_error_status;
} sai_port_oper_status_notification_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_GLOBAL_FLOW_CONTROL_MODE
*/
typedef enum _sai_port_flow_control_mode_t
{
/** Disable flow control for both tx and rx */
SAI_PORT_FLOW_CONTROL_MODE_DISABLE,
/** Enable flow control for tx only */
SAI_PORT_FLOW_CONTROL_MODE_TX_ONLY,
/** Enable flow control for rx only */
SAI_PORT_FLOW_CONTROL_MODE_RX_ONLY,
/** Enable flow control for both tx and rx */
SAI_PORT_FLOW_CONTROL_MODE_BOTH_ENABLE,
} sai_port_flow_control_mode_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_INTERNAL_LOOPBACK_MODE
* To be deprecated, use sai_port_loopback_mode_t instead.
*/
typedef enum _sai_port_internal_loopback_mode_t
{
/** Disable internal loopback */
SAI_PORT_INTERNAL_LOOPBACK_MODE_NONE,
/** Port internal loopback at PHY module */
SAI_PORT_INTERNAL_LOOPBACK_MODE_PHY,
/** Port internal loopback at MAC module */
SAI_PORT_INTERNAL_LOOPBACK_MODE_MAC
} sai_port_internal_loopback_mode_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_LOOPBACK_MODE
*/
typedef enum _sai_port_loopback_mode_t
{
/** Disable loopback */
SAI_PORT_LOOPBACK_MODE_NONE,
/** Port loopback at PHY module */
SAI_PORT_LOOPBACK_MODE_PHY,
/** Port loopback at MAC module */
SAI_PORT_LOOPBACK_MODE_MAC,
/** Port loopback at PHY remote end */
SAI_PORT_LOOPBACK_MODE_PHY_REMOTE,
/** Port loopback at MAC remote end */
SAI_PORT_LOOPBACK_MODE_MAC_REMOTE
} sai_port_loopback_mode_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_MEDIA_TYPE
*/
typedef enum _sai_port_media_type_t
{
/** Media not present */
SAI_PORT_MEDIA_TYPE_NOT_PRESENT,
/** Media type not known */
SAI_PORT_MEDIA_TYPE_UNKNOWN,
/** Media type fiber. Remote advertise medium information as fiber */
SAI_PORT_MEDIA_TYPE_FIBER,
/** Media type copper. Remote advertise medium information as copper */
SAI_PORT_MEDIA_TYPE_COPPER,
/** Media type Back plane. */
SAI_PORT_MEDIA_TYPE_BACKPLANE,
} sai_port_media_type_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_CABLE_PAIR_STATE
* Copper cable pair states
*/
typedef enum _sai_port_cable_pair_state_t
{
/** Cable pair state is good */
SAI_PORT_CABLE_PAIR_STATE_OK,
/** The Cable pair state open */
SAI_PORT_CABLE_PAIR_STATE_OPEN,
/** The Cable pair state short (within pair) */
SAI_PORT_CABLE_PAIR_STATE_SHORT,
/** The Cable pair state is shorted with another pair (inter-short) cross talk */
SAI_PORT_CABLE_PAIR_STATE_CROSSTALK,
/** Cable state unknown */
SAI_PORT_CABLE_PAIR_STATE_UNKNOWN
} sai_port_cable_pair_state_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_CABLE_TYPE
* Copper cable types
*/
typedef enum _sai_port_cable_type_t
{
/** Cable type Unknown */
SAI_PORT_CABLE_TYPE_UNKNOWN,
/** Cable type CAT5 */
SAI_PORT_CABLE_TYPE_CAT5,
/** Cable type CAT5E */
SAI_PORT_CABLE_TYPE_CAT5E,
/** Cable type CAT6 */
SAI_PORT_CABLE_TYPE_CAT6,
/** Cable type CAT6A */
SAI_PORT_CABLE_TYPE_CAT6A,
/** Cable type CAT7 */
SAI_PORT_CABLE_TYPE_CAT7
} sai_port_cable_type_t;
/**
* @brief Breakout Mode types based on number
* of SerDes lanes used in a port
*/
typedef enum _sai_port_breakout_mode_type_t
{
/** 1 lane breakout Mode */
SAI_PORT_BREAKOUT_MODE_TYPE_1_LANE = 0,
/** 2 lanes breakout Mode */
SAI_PORT_BREAKOUT_MODE_TYPE_2_LANE = 1,
/** 4 lanes breakout Mode */
SAI_PORT_BREAKOUT_MODE_TYPE_4_LANE = 2,
/** 8 lanes breakout Mode */
SAI_PORT_BREAKOUT_MODE_TYPE_8_LANE = 3,
/** Breakout mode max count */
SAI_PORT_BREAKOUT_MODE_TYPE_MAX
} sai_port_breakout_mode_type_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_FEC_MODE
*/
typedef enum _sai_port_fec_mode_t
{
/** No FEC */
SAI_PORT_FEC_MODE_NONE,
/** Enable RS-FEC - 25G, 50G, 100G ports. The specific RS-FEC mode will be automatically determined. */
SAI_PORT_FEC_MODE_RS,
/** Enable FC-FEC - 10G, 25G, 40G, 50G ports */
SAI_PORT_FEC_MODE_FC,
} sai_port_fec_mode_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_FEC_MODE_EXTENDED
*/
typedef enum _sai_port_fec_mode_extended_t
{
/** No FEC */
SAI_PORT_FEC_MODE_EXTENDED_NONE,
/** Enable RS-528 FEC (CL91) - 25G, 50G, 100G ports */
SAI_PORT_FEC_MODE_EXTENDED_RS528,
/** Enable RS544-FEC - 100G PAM4, 200G ports */
SAI_PORT_FEC_MODE_EXTENDED_RS544,
/** Enable RS544-FEC (interleaved) - 100G, 200G, 400G ports */
SAI_PORT_FEC_MODE_EXTENDED_RS544_INTERLEAVED,
/** Enable FC-FEC (CL74) - 10G, 25G, 40G, 50G ports */
SAI_PORT_FEC_MODE_EXTENDED_FC,
} sai_port_fec_mode_extended_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_DATAPATH_ENABLE
*/
typedef enum _sai_port_datapath_enable_t
{
/** PASS through data path */
SAI_PORT_DATAPATH_ENABLE_PASS_THROUGH_MODE,
/** PCS IEEE data path */
SAI_PORT_DATAPATH_ENABLE_PCS_IEEE_MODE,
} sai_port_datapath_enable_t;
/**
* @brief Priority flow control mode
*/
typedef enum _sai_port_priority_flow_control_mode_t
{
/** Same value for RX/TX */
SAI_PORT_PRIORITY_FLOW_CONTROL_MODE_COMBINED,
/** Separate values for RX/TX */
SAI_PORT_PRIORITY_FLOW_CONTROL_MODE_SEPARATE,
} sai_port_priority_flow_control_mode_t;
/**
* @brief PTP mode
*/
typedef enum _sai_port_ptp_mode_t
{
/** No special processing for PTP packets */
SAI_PORT_PTP_MODE_NONE,
/** Single-step Timestamp mode for the PTP packets */
SAI_PORT_PTP_MODE_SINGLE_STEP_TIMESTAMP,
/** Two-step Timestamp mode for the PTP packets */
SAI_PORT_PTP_MODE_TWO_STEP_TIMESTAMP,
} sai_port_ptp_mode_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_INTERFACE_TYPE
* Used for selecting electrical interface with specific electrical pin and signal quality
*/
typedef enum _sai_port_interface_type_t
{
/** Interface type none */
SAI_PORT_INTERFACE_TYPE_NONE,
/** Interface type CR */
SAI_PORT_INTERFACE_TYPE_CR,
/** Interface type CR2 */
SAI_PORT_INTERFACE_TYPE_CR2,
/** Interface type CR4 */
SAI_PORT_INTERFACE_TYPE_CR4,
/** Interface type SR */
SAI_PORT_INTERFACE_TYPE_SR,
/** Interface type SR2 */
SAI_PORT_INTERFACE_TYPE_SR2,
/** Interface type SR4 */
SAI_PORT_INTERFACE_TYPE_SR4,
/** Interface type LR */
SAI_PORT_INTERFACE_TYPE_LR,
/** Interface type LR4 */
SAI_PORT_INTERFACE_TYPE_LR4,
/** Interface type KR */
SAI_PORT_INTERFACE_TYPE_KR,
/** Interface type KR4 */
SAI_PORT_INTERFACE_TYPE_KR4,
/** Interface type CAUI */
SAI_PORT_INTERFACE_TYPE_CAUI,
/** Interface type GMII */
SAI_PORT_INTERFACE_TYPE_GMII,
/** Interface type SFI */
SAI_PORT_INTERFACE_TYPE_SFI,
/** Interface type XLAUI */
SAI_PORT_INTERFACE_TYPE_XLAUI,
/** Interface type KR2 */
SAI_PORT_INTERFACE_TYPE_KR2,
/** Interface type CAUI */
SAI_PORT_INTERFACE_TYPE_CAUI4,
/** Interface type XAUI */
SAI_PORT_INTERFACE_TYPE_XAUI,
/** Interface type XFI */
SAI_PORT_INTERFACE_TYPE_XFI,
/** Interface type XGMII */
SAI_PORT_INTERFACE_TYPE_XGMII,
/** Interface type CR8 */
SAI_PORT_INTERFACE_TYPE_CR8,
/** Interface type KR8 */
SAI_PORT_INTERFACE_TYPE_KR8,
/** Interface type SR8 */
SAI_PORT_INTERFACE_TYPE_SR8,
/** Interface type LR8 */
SAI_PORT_INTERFACE_TYPE_LR8,
/** Interface type USXGMII */
SAI_PORT_INTERFACE_TYPE_USXGMII,
/** Interface type MAX */
SAI_PORT_INTERFACE_TYPE_MAX,
} sai_port_interface_type_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_LINK_TRAINING_FAILURE_STATUS
* Used for Link Training failure status and error codes
*/
typedef enum _sai_port_link_training_failure_status_t
{
/** No Error detected */
SAI_PORT_LINK_TRAINING_FAILURE_STATUS_NO_ERROR,
/** Failure detected */
SAI_PORT_LINK_TRAINING_FAILURE_STATUS_FRAME_LOCK_ERROR,
/** SNR lower than threshold */
SAI_PORT_LINK_TRAINING_FAILURE_STATUS_SNR_LOWER_THRESHOLD,
/** Link training timeout */
SAI_PORT_LINK_TRAINING_FAILURE_STATUS_TIME_OUT
} sai_port_link_training_failure_status_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_LINK_TRAINING_RX_STATUS
* Used for receiver status for link training
*/
typedef enum _sai_port_link_training_rx_status_t
{
/** Receiver not trained */
SAI_PORT_LINK_TRAINING_RX_STATUS_NOT_TRAINED,
/** Receiver trained */
SAI_PORT_LINK_TRAINING_RX_STATUS_TRAINED,
} sai_port_link_training_rx_status_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_PRBS_CONFIG
* PRBS configuration to enable transmitter, receiver or both
*/
typedef enum _sai_port_prbs_config_t
{
/** PRBS Disable */
SAI_PORT_PRBS_CONFIG_DISABLE,
/** Enable both PRBS Transmitter and Receiver */
SAI_PORT_PRBS_CONFIG_ENABLE_TX_RX,
/** Enable PRBS Receiver */
SAI_PORT_PRBS_CONFIG_ENABLE_RX,
/** Enable PRBS Transmitter */
SAI_PORT_PRBS_CONFIG_ENABLE_TX
} sai_port_prbs_config_t;
/**
* @brief Attribute data for #SAI_PORT_CONNECTOR_ATTR_FAILOVER_MODE
* Used for Failover mode configuration on port
*/
typedef enum _sai_port_connector_failover_mode_t
{
/** Failover mode disable */
SAI_PORT_CONNECTOR_FAILOVER_MODE_DISABLE,
/** Configure Failover mode on primary port */
SAI_PORT_CONNECTOR_FAILOVER_MODE_PRIMARY,
/** Configure Failover mode on secondary port */
SAI_PORT_CONNECTOR_FAILOVER_MODE_SECONDARY
} sai_port_connector_failover_mode_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_MDIX_MODE_STATUS
* Used for MDIX mode status
*/
typedef enum _sai_port_mdix_mode_status_t
{
/** MDIX mode status straight */
SAI_PORT_MDIX_MODE_STATUS_STRAIGHT,
/** MDIX mode status cross over */
SAI_PORT_MDIX_MODE_STATUS_CROSSOVER
} sai_port_mdix_mode_status_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_MDIX_MODE_CONFIG
* Used for MDIX mode configuration
*/
typedef enum _sai_port_mdix_mode_config_t
{
/** MDIX mode status auto */
SAI_PORT_MDIX_MODE_CONFIG_AUTO,
/** MDIX mode status straight */
SAI_PORT_MDIX_MODE_CONFIG_STRAIGHT,
/** MDIX mode status cross over */
SAI_PORT_MDIX_MODE_CONFIG_CROSSOVER
} sai_port_mdix_mode_config_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_AUTO_NEG_CONFIG_MODE
* Used for auto negotiation mode to configure master or slave mode
*/
typedef enum _sai_port_auto_neg_config_mode_t
{
/** Auto neg configuration mode disabled */
SAI_PORT_AUTO_NEG_CONFIG_MODE_DISABLED,
/** Auto neg mode auto */
SAI_PORT_AUTO_NEG_CONFIG_MODE_AUTO,
/** Auto neg mode slave */
SAI_PORT_AUTO_NEG_CONFIG_MODE_SLAVE,
/** Auto neg mode master */
SAI_PORT_AUTO_NEG_CONFIG_MODE_MASTER
} sai_port_auto_neg_config_mode_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_MODULE_TYPE
* Used for configuring Fiber module type
*/
typedef enum _sai_port_module_type_t
{
/** Module Type Fiber */
SAI_PORT_MODULE_TYPE_1000BASE_X,
/** Module Type 100FX */
SAI_PORT_MODULE_TYPE_100FX,
/** Module Type SGMII-Slave */
SAI_PORT_MODULE_TYPE_SGMII_SLAVE,
} sai_port_module_type_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_DUAL_MEDIA
* Used to configure media type for dual media supported PHY
*/
typedef enum _sai_port_dual_media_t
{
/** Dual media not supported */
SAI_PORT_DUAL_MEDIA_NONE,
/** Force Copper mode, Fiber is inactive/disabled */
SAI_PORT_DUAL_MEDIA_COPPER_ONLY,
/** Force Fiber mode, Copper is inactive/disabled */
SAI_PORT_DUAL_MEDIA_FIBER_ONLY,
/** Both Copper and Fiber supported, but Copper preferred */
SAI_PORT_DUAL_MEDIA_COPPER_PREFERRED,
/** Both Copper and Fiber supported, but Fiber preferred */
SAI_PORT_DUAL_MEDIA_FIBER_PREFERRED
} sai_port_dual_media_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_HOST_TX_READY_STATUS
*/
typedef enum _sai_port_host_tx_ready_status_t
{
/** Host TX ready status not_ready */
SAI_PORT_HOST_TX_READY_STATUS_NOT_READY,
/** Host TX ready status ready */
SAI_PORT_HOST_TX_READY_STATUS_READY
} sai_port_host_tx_ready_status_t;
/**
* @brief Attribute data for #SAI_PORT_ATTR_PATH_TRACING_TIMESTAMP_TYPE
*/
typedef enum _sai_port_path_tracing_timestamp_type_t
{
/** Timestamp nanosecond bits [8:15] */
SAI_PORT_PATH_TRACING_TIMESTAMP_TYPE_8_15,
/** Timestamp nanosecond bits [12:19] */
SAI_PORT_PATH_TRACING_TIMESTAMP_TYPE_12_19,
/** Timestamp nanosecond bits [16:23] */
SAI_PORT_PATH_TRACING_TIMESTAMP_TYPE_16_23,
/** Timestamp nanosecond bits [20:27] */
SAI_PORT_PATH_TRACING_TIMESTAMP_TYPE_20_27,
} sai_port_path_tracing_timestamp_type_t;
/**
* @brief Attribute Id in sai_set_port_attribute() and
* sai_get_port_attribute() calls
*/
typedef enum _sai_port_attr_t
{
/**
* @brief Start of attributes
*/
SAI_PORT_ATTR_START,
/* READ-ONLY */
/**
* @brief Port Type
*
* @type sai_port_type_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_TYPE = SAI_PORT_ATTR_START,
/**
* @brief Operational Status
*
* @type sai_port_oper_status_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_OPER_STATUS,
/**
* @brief Breakout mode(s) supported
*
* @type sai_s32_list_t sai_port_breakout_mode_type_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_SUPPORTED_BREAKOUT_MODE_TYPE,
/**
* @brief Current breakout mode
*
* @type sai_port_breakout_mode_type_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_CURRENT_BREAKOUT_MODE_TYPE,
/**
* @brief Number of queues on port
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_QOS_NUMBER_OF_QUEUES,
/**
* @brief List of Queues for the port
*
* @type sai_object_list_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_QUEUE
*/
SAI_PORT_ATTR_QOS_QUEUE_LIST,
/**
* @brief Number of Scheduler groups on port
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_QOS_NUMBER_OF_SCHEDULER_GROUPS,
/**
* @brief List of Scheduler groups for the port
*
* @type sai_object_list_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_SCHEDULER_GROUP
*/
SAI_PORT_ATTR_QOS_SCHEDULER_GROUP_LIST,
/**
* @brief The sum of the headroom size of the ingress priority groups belonging to this port
* should not exceed the SAI_PORT_ATTR_QOS_MAXIMUM_HEADROOM_SIZE value.
*
* This attribute is applicable only for per-port, per-PG headroom model
* (which means SAI_BUFFER_POOL_ATTR_XOFF_SIZE is zero)
*
* For the platforms which don't have this limitation, 0 should be returned.
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_QOS_MAXIMUM_HEADROOM_SIZE,
/**
* @brief Query list of supported port speed(full-duplex) in Mbps
*
* @type sai_u32_list_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_SUPPORTED_SPEED,
/**
* @brief Query list of supported port FEC mode
*
* @type sai_s32_list_t sai_port_fec_mode_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_SUPPORTED_FEC_MODE,
/**
* @brief Query extended list of supported port FEC modes
*
* @type sai_s32_list_t sai_port_fec_mode_extended_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_SUPPORTED_FEC_MODE_EXTENDED,
/**
* @brief Query list of Supported HALF-Duplex speed in Mbps
*
* @type sai_u32_list_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_SUPPORTED_HALF_DUPLEX_SPEED,
/**
* @brief Query auto-negotiation support
*
* @type bool
* @flags READ_ONLY
*/
SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE,
/**
* @brief Query port supported flow control mode
*
* @type sai_port_flow_control_mode_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_SUPPORTED_FLOW_CONTROL_MODE,
/**
* @brief Query port supported asymmetric pause mode
*
* @type bool
* @flags READ_ONLY
*/
SAI_PORT_ATTR_SUPPORTED_ASYMMETRIC_PAUSE_MODE,
/**
* @brief Query port supported MEDIA type
*
* @type sai_port_media_type_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_SUPPORTED_MEDIA_TYPE,
/**
* @brief Query list of Advertised remote port speed (Full-Duplex) in Mbps
*
* @type sai_u32_list_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_REMOTE_ADVERTISED_SPEED,
/**
* @brief Query list of Advertised remote port FEC control
*
* @type sai_s32_list_t sai_port_fec_mode_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_REMOTE_ADVERTISED_FEC_MODE,
/**
* @brief Query extended list of Advertised remote port FEC control
*
* @type sai_s32_list_t sai_port_fec_mode_extended_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_REMOTE_ADVERTISED_FEC_MODE_EXTENDED,
/**
* @brief Query list of Remote Port's Advertised HALF-Duplex speed in Mbps
*
* @type sai_u32_list_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_REMOTE_ADVERTISED_HALF_DUPLEX_SPEED,
/**
* @brief Query Remote Port's auto-negotiation Advertisement
*
* @type bool
* @flags READ_ONLY
*/
SAI_PORT_ATTR_REMOTE_ADVERTISED_AUTO_NEG_MODE,
/**
* @brief Query Remote port Advertised flow control mode
*
* @type sai_port_flow_control_mode_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_REMOTE_ADVERTISED_FLOW_CONTROL_MODE,
/**
* @brief Query Remote port Advertised asymmetric pause mode
*
* @type bool
* @flags READ_ONLY
*/
SAI_PORT_ATTR_REMOTE_ADVERTISED_ASYMMETRIC_PAUSE_MODE,
/**
* @brief Query Remote port Advertised MEDIA type
*
* @type sai_port_media_type_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_REMOTE_ADVERTISED_MEDIA_TYPE,
/**
* @brief Query Remote port Advertised OUI Code
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_REMOTE_ADVERTISED_OUI_CODE,
/**
* @brief Number of ingress priority groups
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_NUMBER_OF_INGRESS_PRIORITY_GROUPS,
/**
* @brief List of ingress priority groups
*
* @type sai_object_list_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_INGRESS_PRIORITY_GROUP
*/
SAI_PORT_ATTR_INGRESS_PRIORITY_GROUP_LIST,
/**
* @brief List of port's lanes eye values
*
* @type sai_port_eye_values_list_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_EYE_VALUES,
/**
* @brief Operational speed in Mbps
*
* If port is down, the returned value should be zero.
* If auto negotiation is on, the returned value should be the negotiated speed.
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_OPER_SPEED,
/* READ-WRITE */
/**
* @brief Hardware Lane list
*
* @type sai_u32_list_t
* @flags MANDATORY_ON_CREATE | CREATE_ONLY | KEY
*/
SAI_PORT_ATTR_HW_LANE_LIST,
/**
* @brief Speed in Mbps
*
* On get, returns the configured port speed.
*
* @type sai_uint32_t
* @flags MANDATORY_ON_CREATE | CREATE_AND_SET
*/
SAI_PORT_ATTR_SPEED,
/**
* @brief Full Duplex setting
*
* @type bool
* @flags CREATE_ONLY
* @default true
*/
SAI_PORT_ATTR_FULL_DUPLEX_MODE,
/**
* @brief Auto Negotiation configuration
*
* @type bool
* @flags CREATE_AND_SET
* @default false
*/
SAI_PORT_ATTR_AUTO_NEG_MODE,
/**
* @brief Admin Mode
*
* @type bool
* @flags CREATE_AND_SET
* @default false
*/
SAI_PORT_ATTR_ADMIN_STATE,
/**
* @brief Media Type
*
* @type sai_port_media_type_t
* @flags CREATE_AND_SET
* @default SAI_PORT_MEDIA_TYPE_NOT_PRESENT
*/
SAI_PORT_ATTR_MEDIA_TYPE,
/**
* @brief Query/Configure list of Advertised port speed (Full-Duplex) in Mbps
*
* Used when auto negotiation is on. Empty list means all supported values are enabled.
*
* @type sai_u32_list_t
* @flags CREATE_AND_SET
* @default empty
*/
SAI_PORT_ATTR_ADVERTISED_SPEED,
/**
* @brief Query/Configure list of Advertised port FEC Mode
*
* @type sai_s32_list_t sai_port_fec_mode_t
* @flags CREATE_AND_SET
* @default empty
* @validonly SAI_PORT_ATTR_USE_EXTENDED_FEC == false
*/
SAI_PORT_ATTR_ADVERTISED_FEC_MODE,
/**
* @brief Query/Configure extended list of Advertised port FEC Mode
*
* @type sai_s32_list_t sai_port_fec_mode_extended_t
* @flags CREATE_AND_SET
* @default empty
* @validonly SAI_PORT_ATTR_USE_EXTENDED_FEC == true
*/
SAI_PORT_ATTR_ADVERTISED_FEC_MODE_EXTENDED,
/**
* @brief Query/Configure list of Advertised HALF-Duplex speed in Mbps
*
* @type sai_u32_list_t
* @flags CREATE_AND_SET
* @default empty