OpenNSL API Guide and Reference Manual
port.h
Go to the documentation of this file.
1 
4 /*****************************************************************************
5  *
6  * (C) Copyright Broadcom Corporation 2013-2016
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  *
11  * You may obtain a copy of the License at
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  ***************************************************************************/
24 #ifndef __OPENNSL_PORT_H__
25 #define __OPENNSL_PORT_H__
26 
27 #include <shared/portmode.h>
28 #include <shared/port.h>
29 #include <shared/phyconfig.h>
30 #include <shared/phyreg.h>
31 #include <shared/switch.h>
32 #include <opennsl/types.h>
33 #include <opennsl/stat.h>
34 #include <shared/port_ability.h>
35 
36 #define OPENNSL_PIPES_MAX _SHR_SWITCH_MAX_PIPES
37 
38 typedef struct opennsl_port_config_s {
66 /* __doxy_func_body_end__ */
67 
70 
71 #define OPENNSL_PORT_ABILITY_10MB _SHR_PA_SPEED_10MB
72 #define OPENNSL_PORT_ABILITY_100MB _SHR_PA_SPEED_100MB
73 #define OPENNSL_PORT_ABILITY_1000MB _SHR_PA_SPEED_1000MB
74 #define OPENNSL_PORT_ABILITY_2500MB _SHR_PA_SPEED_2500MB
75 #define OPENNSL_PORT_ABILITY_3000MB _SHR_PA_SPEED_3000MB
76 #define OPENNSL_PORT_ABILITY_5000MB _SHR_PA_SPEED_5000MB
77 #define OPENNSL_PORT_ABILITY_6000MB _SHR_PA_SPEED_6000MB
78 #define OPENNSL_PORT_ABILITY_10GB _SHR_PA_SPEED_10GB
79 #define OPENNSL_PORT_ABILITY_11GB _SHR_PA_SPEED_11GB
80 #define OPENNSL_PORT_ABILITY_12GB _SHR_PA_SPEED_12GB
81 #define OPENNSL_PORT_ABILITY_12P5GB _SHR_PA_SPEED_12P5GB
82 #define OPENNSL_PORT_ABILITY_13GB _SHR_PA_SPEED_13GB
83 #define OPENNSL_PORT_ABILITY_15GB _SHR_PA_SPEED_15GB
84 #define OPENNSL_PORT_ABILITY_16GB _SHR_PA_SPEED_16GB
85 #define OPENNSL_PORT_ABILITY_20GB _SHR_PA_SPEED_20GB
86 #define OPENNSL_PORT_ABILITY_21GB _SHR_PA_SPEED_21GB
87 #define OPENNSL_PORT_ABILITY_23GB _SHR_PA_SPEED_23GB
88 #define OPENNSL_PORT_ABILITY_24GB _SHR_PA_SPEED_24GB
89 #define OPENNSL_PORT_ABILITY_25GB _SHR_PA_SPEED_25GB
90 #define OPENNSL_PORT_ABILITY_27GB _SHR_PA_SPEED_27GB
91 #define OPENNSL_PORT_ABILITY_30GB _SHR_PA_SPEED_30GB
92 #define OPENNSL_PORT_ABILITY_32GB _SHR_PA_SPEED_32GB
93 #define OPENNSL_PORT_ABILITY_40GB _SHR_PA_SPEED_40GB
94 #define OPENNSL_PORT_ABILITY_42GB _SHR_PA_SPEED_42GB
95 #define OPENNSL_PORT_ABILITY_48GB _SHR_PA_SPEED_48GB
96 #define OPENNSL_PORT_ABILITY_50GB _SHR_PA_SPEED_50GB
97 #define OPENNSL_PORT_ABILITY_53GB _SHR_PA_SPEED_53GB
98 #define OPENNSL_PORT_ABILITY_100GB _SHR_PA_SPEED_100GB
99 #define OPENNSL_PORT_ABILITY_106GB _SHR_PA_SPEED_106GB
100 #define OPENNSL_PORT_ABILITY_120GB _SHR_PA_SPEED_120GB
101 #define OPENNSL_PORT_ABILITY_127GB _SHR_PA_SPEED_127GB
102 #define OPENNSL_PORT_ABILITY_INTERFACE_TBI _SHR_PA_INTF_TBI
103 #define OPENNSL_PORT_ABILITY_INTERFACE_MII _SHR_PA_INTF_MII
104 #define OPENNSL_PORT_ABILITY_INTERFACE_GMII _SHR_PA_INTF_GMII
105 #define OPENNSL_PORT_ABILITY_INTERFACE_SGMII _SHR_PA_INTF_SGMII
106 #define OPENNSL_PORT_ABILITY_INTERFACE_XGMII _SHR_PA_INTF_XGMII
107 #define OPENNSL_PORT_ABILITY_INTERFACE_QSGMII _SHR_PA_INTF_QSGMII
108 #define OPENNSL_PORT_ABILITY_INTERFACE_CGMII _SHR_PA_INTF_CGMII
109 #define OPENNSL_PORT_ABILITY_MEDIUM_COPPER _SHR_PA_MEDIUM_COPPER
110 #define OPENNSL_PORT_ABILITY_MEDIUM_FIBER _SHR_PA_MEDIUM_FIBER
111 #define OPENNSL_PORT_ABILITY_MEDIUM_BACKPLANE _SHR_PA_MEDIUM_BACKPLANE
112 #define OPENNSL_PORT_ABILITY_LB_NONE _SHR_PA_LB_NONE
113 #define OPENNSL_PORT_ABILITY_LB_MAC _SHR_PA_LB_MAC
114 #define OPENNSL_PORT_ABILITY_LB_PHY _SHR_PA_LB_PHY
115 #define OPENNSL_PORT_ABILITY_LB_LINE _SHR_PA_LB_LINE
116 #define OPENNSL_PORT_ABILITY_AUTONEG _SHR_PA_AUTONEG
117 #define OPENNSL_PORT_ABILITY_COMBO _SHR_PA_COMBO
118 #define OPENNSL_PORT_ABILITY_PAUSE_TX _SHR_PA_PAUSE_TX
119 #define OPENNSL_PORT_ABILITY_PAUSE_RX _SHR_PA_PAUSE_RX
120 #define OPENNSL_PORT_ABILITY_PAUSE _SHR_PA_PAUSE
121 #define OPENNSL_PORT_ABILITY_PAUSE_ASYMM _SHR_PA_PAUSE_ASYMM
129 #define OPENNSL_PORT_ABILITY_FEC_NONE _SHR_PA_FEC_NONE
130 #define OPENNSL_PORT_ABILITY_FEC_CL74 _SHR_PA_FEC_CL74
131 #define OPENNSL_PORT_ABILITY_FEC_CL91 _SHR_PA_FEC_CL91
132 #define OPENNSL_PORT_ABILITY_EEE_100MB_BASETX _SHR_PA_EEE_100MB_BASETX
134 #define OPENNSL_PORT_ABILITY_EEE_1GB_BASET _SHR_PA_EEE_1GB_BASET
136 #define OPENNSL_PORT_ABILITY_EEE_10GB_BASET _SHR_PA_EEE_10GB_BASET
138 #define OPENNSL_PORT_ABILITY_EEE_10GB_KX _SHR_PA_EEE_10GB_KX
140 #define OPENNSL_PORT_ABILITY_EEE_10GB_KX4 _SHR_PA_EEE_10GB_KX4
142 #define OPENNSL_PORT_ABILITY_EEE_10GB_KR _SHR_PA_EEE_10GB_KR
144 #define OPENNSL_PORT_ABILITY_CHANNEL_LONG _SHR_PA_CHANNEL_LONG
145 #define OPENNSL_PORT_ABILITY_CHANNEL_SHORT _SHR_PA_CHANNEL_SHORT
154 typedef _shr_port_mode_t opennsl_port_abil_t;
155 
156 #define OPENNSL_PORT_ABIL_10MB_HD _SHR_PM_10MB_HD
157 #define OPENNSL_PORT_ABIL_10MB_FD _SHR_PM_10MB_FD
158 #define OPENNSL_PORT_ABIL_100MB_HD _SHR_PM_100MB_HD
159 #define OPENNSL_PORT_ABIL_100MB_FD _SHR_PM_100MB_FD
160 #define OPENNSL_PORT_ABIL_1000MB_HD _SHR_PM_1000MB_HD
161 #define OPENNSL_PORT_ABIL_1000MB_FD _SHR_PM_1000MB_FD
162 #define OPENNSL_PORT_ABIL_2500MB_HD _SHR_PM_2500MB_HD
163 #define OPENNSL_PORT_ABIL_2500MB_FD _SHR_PM_2500MB_FD
164 #define OPENNSL_PORT_ABIL_3000MB_HD _SHR_PM_3000MB_HD
165 #define OPENNSL_PORT_ABIL_3000MB_FD _SHR_PM_3000MB_FD
166 #define OPENNSL_PORT_ABIL_10GB_HD _SHR_PM_10GB_HD
167 #define OPENNSL_PORT_ABIL_10GB_FD _SHR_PM_10GB_FD
168 #define OPENNSL_PORT_ABIL_12GB_HD _SHR_PM_12GB_HD
169 #define OPENNSL_PORT_ABIL_12GB_FD _SHR_PM_12GB_FD
170 #define OPENNSL_PORT_ABIL_13GB_HD _SHR_PM_13GB_HD
171 #define OPENNSL_PORT_ABIL_13GB_FD _SHR_PM_13GB_FD
172 #define OPENNSL_PORT_ABIL_16GB_HD _SHR_PM_16GB_HD
173 #define OPENNSL_PORT_ABIL_16GB_FD _SHR_PM_16GB_FD
174 #define OPENNSL_PORT_ABIL_TBI _SHR_PM_TBI
175 #define OPENNSL_PORT_ABIL_MII _SHR_PM_MII
176 #define OPENNSL_PORT_ABIL_GMII _SHR_PM_GMII
177 #define OPENNSL_PORT_ABIL_SGMII _SHR_PM_SGMII
178 #define OPENNSL_PORT_ABIL_XGMII _SHR_PM_XGMII
179 #define OPENNSL_PORT_ABIL_LB_MAC _SHR_PM_LB_MAC
180 #define OPENNSL_PORT_ABIL_LB_PHY _SHR_PM_LB_PHY
181 #define OPENNSL_PORT_ABIL_LB_NONE _SHR_PM_LB_NONE
182 #define OPENNSL_PORT_ABIL_AN _SHR_PM_AN
183 #define OPENNSL_PORT_ABIL_COMBO _SHR_PM_COMBO
184 #define OPENNSL_PORT_ABIL_PAUSE_TX _SHR_PM_PAUSE_TX
185 #define OPENNSL_PORT_ABIL_PAUSE_RX _SHR_PM_PAUSE_RX
186 #define OPENNSL_PORT_ABIL_PAUSE _SHR_PM_PAUSE
187 #define OPENNSL_PORT_ABIL_10B OPENNSL_PORT_ABIL_TBI
188 #define OPENNSL_PORT_ABIL_PAUSE_ASYMM _SHR_PM_PAUSE_ASYMM
195 #define OPENNSL_PORT_ABIL_10MB _SHR_PM_10MB
196 #define OPENNSL_PORT_ABIL_100MB _SHR_PM_100MB
197 #define OPENNSL_PORT_ABIL_1000MB _SHR_PM_1000MB
198 #define OPENNSL_PORT_ABIL_2500MB _SHR_PM_2500MB
199 #define OPENNSL_PORT_ABIL_3000MB _SHR_PM_3000MB
200 #define OPENNSL_PORT_ABIL_10GB _SHR_PM_10GB
201 #define OPENNSL_PORT_ABIL_12GB _SHR_PM_12GB
202 #define OPENNSL_PORT_ABIL_13GB _SHR_PM_13GB
203 #define OPENNSL_PORT_ABIL_16GB _SHR_PM_16GB
204 #define OPENNSL_PORT_ABIL_HD _SHR_PM_HD
205 #define OPENNSL_PORT_ABIL_FD _SHR_PM_FD
206 #define OPENNSL_PORT_ABIL_SPD_ANY _SHR_PM_SPEED_ALL
207 #define OPENNSL_PORT_ABIL_SPD_MAX(abil) \
208  _SHR_PM_SPEED_MAX(abil)
209 #define OPENNSL_PORT_ABILITY_SPEED_MAX(abil) _SHR_PA_SPEED_MAX(abil)
210 #ifndef OPENNSL_HIDE_DISPATCHABLE
211 
212 /***************************************************************************/
229 extern int opennsl_port_init(
230  int unit) LIB_DLL_EXPORTED ;
231 
232 /***************************************************************************/
250 extern int opennsl_port_clear(
251  int unit) LIB_DLL_EXPORTED ;
252 
253 /***************************************************************************/
281 extern int opennsl_port_probe(
282  int unit,
283  opennsl_pbmp_t pbmp,
284  opennsl_pbmp_t *okay_pbmp) LIB_DLL_EXPORTED ;
285 
286 /***************************************************************************/
314 extern int opennsl_port_detach(
315  int unit,
316  opennsl_pbmp_t pbmp,
317  opennsl_pbmp_t *detached) LIB_DLL_EXPORTED ;
318 
319 /***************************************************************************/
336 extern int opennsl_port_config_get(
337  int unit,
339 
340 #endif /* OPENNSL_HIDE_DISPATCHABLE */
341 
342 /***************************************************************************/
350 extern char *opennsl_port_name(
351  int unit,
352  int port) LIB_DLL_EXPORTED ;
353 
354 #ifndef OPENNSL_HIDE_DISPATCHABLE
355 
356 /***************************************************************************/
372 extern int opennsl_port_enable_set(
373  int unit,
375  int enable) LIB_DLL_EXPORTED ;
376 
377 /***************************************************************************/
393 extern int opennsl_port_enable_get(
394  int unit,
396  int *enable) LIB_DLL_EXPORTED ;
397 
398 /***************************************************************************/
407 extern int opennsl_port_advert_set(
408  int unit,
410  opennsl_port_abil_t ability_mask) LIB_DLL_EXPORTED ;
411 
412 /***************************************************************************/
436  int unit,
439 
440 /***************************************************************************/
449 extern int opennsl_port_advert_get(
450  int unit,
452  opennsl_port_abil_t *ability_mask) LIB_DLL_EXPORTED ;
453 
454 /***************************************************************************/
478  int unit,
481 
482 /***************************************************************************/
492  int unit,
494  opennsl_port_abil_t *ability_mask) LIB_DLL_EXPORTED ;
495 
496 /***************************************************************************/
510  int unit,
513 
514 /***************************************************************************/
523 extern int opennsl_port_ability_get(
524  int unit,
526  opennsl_port_abil_t *local_ability_mask) LIB_DLL_EXPORTED ;
527 
528 /***************************************************************************/
543  int unit,
545  opennsl_port_ability_t *local_ability_mask) LIB_DLL_EXPORTED ;
546 
547 #endif /* OPENNSL_HIDE_DISPATCHABLE */
548 
549 #ifndef OPENNSL_HIDE_DISPATCHABLE
550 
551 /***************************************************************************/
585  int unit,
588 
589 /***************************************************************************/
623  int unit,
625  opennsl_vlan_t *vid_ptr) LIB_DLL_EXPORTED ;
626 
627 /***************************************************************************/
647  int unit,
649  int priority) LIB_DLL_EXPORTED ;
650 
651 /***************************************************************************/
671  int unit,
673  int *priority) LIB_DLL_EXPORTED ;
674 
675 #endif /* OPENNSL_HIDE_DISPATCHABLE */
676 
677 #define OPENNSL_PORT_DSCP_MAP_NONE 0
678 #define OPENNSL_PORT_DSCP_MAP_ZERO 1
680 #define OPENNSL_PORT_DSCP_MAP_ALL 2
681 #define OPENNSL_PORT_DSCP_MAP_UNTAGGED_ONLY 3
683 #define OPENNSL_PORT_DSCP_MAP_DEFAULT 4
686 #ifndef OPENNSL_HIDE_DISPATCHABLE
687 
688 /***************************************************************************/
702  int unit,
704  int mode) LIB_DLL_EXPORTED ;
705 
706 /***************************************************************************/
720  int unit,
722  int *mode) LIB_DLL_EXPORTED ;
723 
724 /***************************************************************************/
774 extern int opennsl_port_dscp_map_set(
775  int unit,
777  int srccp,
778  int mapcp,
779  int prio) LIB_DLL_EXPORTED ;
780 
781 /***************************************************************************/
831 extern int opennsl_port_dscp_map_get(
832  int unit,
834  int srccp,
835  int *mapcp,
836  int *prio) LIB_DLL_EXPORTED ;
837 
838 /***************************************************************************/
854 extern int opennsl_port_linkscan_set(
855  int unit,
857  int linkscan) LIB_DLL_EXPORTED ;
858 
859 /***************************************************************************/
875 extern int opennsl_port_linkscan_get(
876  int unit,
878  int *linkscan) LIB_DLL_EXPORTED ;
879 
880 /***************************************************************************/
900 extern int opennsl_port_autoneg_set(
901  int unit,
903  int autoneg) LIB_DLL_EXPORTED ;
904 
905 /***************************************************************************/
925 extern int opennsl_port_autoneg_get(
926  int unit,
928  int *autoneg) LIB_DLL_EXPORTED ;
929 
930 /***************************************************************************/
969 extern int opennsl_port_speed_max(
970  int unit,
972  int *speed) LIB_DLL_EXPORTED ;
973 
974 /***************************************************************************/
1013 extern int opennsl_port_speed_set(
1014  int unit,
1016  int speed) LIB_DLL_EXPORTED ;
1017 
1018 /***************************************************************************/
1057 extern int opennsl_port_speed_get(
1058  int unit,
1060  int *speed) LIB_DLL_EXPORTED ;
1061 
1062 #endif /* OPENNSL_HIDE_DISPATCHABLE */
1063 
1066 
1067 #define OPENNSL_PORT_IF_NOCXN _SHR_PORT_IF_NOCXN
1068 #define OPENNSL_PORT_IF_NULL _SHR_PORT_IF_NULL
1069 #define OPENNSL_PORT_IF_MII _SHR_PORT_IF_MII
1071 #define OPENNSL_PORT_IF_GMII _SHR_PORT_IF_GMII
1073 #define OPENNSL_PORT_IF_SGMII _SHR_PORT_IF_SGMII
1074 #define OPENNSL_PORT_IF_TBI _SHR_PORT_IF_TBI
1077 #define OPENNSL_PORT_IF_XGMII _SHR_PORT_IF_XGMII
1078 #define OPENNSL_PORT_IF_RGMII _SHR_PORT_IF_RGMII
1080 #define OPENNSL_PORT_IF_SFI _SHR_PORT_IF_SFI
1082 #define OPENNSL_PORT_IF_XFI _SHR_PORT_IF_XFI
1084 #define OPENNSL_PORT_IF_KR _SHR_PORT_IF_KR
1086 #define OPENNSL_PORT_IF_KR2 _SHR_PORT_IF_KR2
1088 #define OPENNSL_PORT_IF_KR4 _SHR_PORT_IF_KR4
1090 #define OPENNSL_PORT_IF_CR _SHR_PORT_IF_CR
1092 #define OPENNSL_PORT_IF_CR2 _SHR_PORT_IF_CR2
1094 #define OPENNSL_PORT_IF_CR4 _SHR_PORT_IF_CR4
1096 #define OPENNSL_PORT_IF_XLAUI _SHR_PORT_IF_XLAUI
1098 #define OPENNSL_PORT_IF_XLAUI2 _SHR_PORT_IF_XLAUI2
1100 #define OPENNSL_PORT_IF_RXAUI _SHR_PORT_IF_RXAUI
1101 #define OPENNSL_PORT_IF_XAUI _SHR_PORT_IF_XAUI
1102 #define OPENNSL_PORT_IF_SPAUI _SHR_PORT_IF_SPAUI
1103 #define OPENNSL_PORT_IF_QSGMII _SHR_PORT_IF_QSGMII
1104 #define OPENNSL_PORT_IF_ILKN _SHR_PORT_IF_ILKN
1105 #define OPENNSL_PORT_IF_RCY _SHR_PORT_IF_RCY
1106 #define OPENNSL_PORT_IF_FAT_PIPE _SHR_PORT_IF_FAT_PIPE
1107 #define OPENNSL_PORT_IF_SR _SHR_PORT_IF_SR
1108 #define OPENNSL_PORT_IF_SR2 _SHR_PORT_IF_SR2
1110 #define OPENNSL_PORT_IF_CAUI _SHR_PORT_IF_CAUI
1111 #define OPENNSL_PORT_IF_LR _SHR_PORT_IF_LR
1112 #define OPENNSL_PORT_IF_LR4 _SHR_PORT_IF_LR4
1113 #define OPENNSL_PORT_IF_SR4 _SHR_PORT_IF_SR4
1114 #define OPENNSL_PORT_IF_KX _SHR_PORT_IF_KX
1115 #define OPENNSL_PORT_IF_ZR _SHR_PORT_IF_ZR
1116 #define OPENNSL_PORT_IF_SR10 _SHR_PORT_IF_SR10
1117 #define OPENNSL_PORT_IF_CR10 _SHR_PORT_IF_CR10
1118 #define OPENNSL_PORT_IF_KR10 _SHR_PORT_IF_KR10
1120 #define OPENNSL_PORT_IF_LR10 _SHR_PORT_IF_LR10
1121 #define OPENNSL_PORT_IF_OTL _SHR_PORT_IF_OTL
1122 #define OPENNSL_PORT_IF_CPU _SHR_PORT_IF_CPU
1123 #define OPENNSL_PORT_IF_ER _SHR_PORT_IF_ER
1124 #define OPENNSL_PORT_IF_ER2 _SHR_PORT_IF_ER2
1126 #define OPENNSL_PORT_IF_ER4 _SHR_PORT_IF_ER4
1128 #define OPENNSL_PORT_IF_CX _SHR_PORT_IF_CX
1129 #define OPENNSL_PORT_IF_CX2 _SHR_PORT_IF_CX2
1130 #define OPENNSL_PORT_IF_CX4 _SHR_PORT_IF_CX4
1131 #define OPENNSL_PORT_IF_CAUI_C2C _SHR_PORT_IF_CAUI_C2C
1132 #define OPENNSL_PORT_IF_CAUI_C2M _SHR_PORT_IF_CAUI_C2M
1133 #define OPENNSL_PORT_IF_VSR _SHR_PORT_IF_VSR
1135 #define OPENNSL_PORT_IF_LR2 _SHR_PORT_IF_LR2
1137 #define OPENNSL_PORT_IF_LRM _SHR_PORT_IF_LRM
1139 #define OPENNSL_PORT_IF_XLPPI _SHR_PORT_IF_XLPPI
1141 #define OPENNSL_PORT_IF_LBG _SHR_PORT_IF_LBG
1142 #define OPENNSL_PORT_IF_CAUI4 _SHR_PORT_IF_CAUI4
1143 #define OPENNSL_PORT_IF_OAMP _SHR_PORT_IF_OAMP
1144 #define OPENNSL_PORT_IF_OLP _SHR_PORT_IF_OLP
1145 #define OPENNSL_PORT_IF_ERP _SHR_PORT_IF_ERP
1146 #define OPENNSL_PORT_IF_SAT _SHR_PORT_IF_SAT
1147 #define OPENNSL_PORT_IF_RCY_MIRROR _SHR_PORT_IF_RCY_MIRROR
1148 #define OPENNSL_PORT_IF_EVENTOR _SHR_PORT_IF_EVENTOR
1149 #define OPENNSL_PORT_IF_COUNT _SHR_PORT_IF_COUNT
1150 #define OPENNSL_PORT_IF_10B OPENNSL_PORT_IF_TBI
1151 #ifndef OPENNSL_HIDE_DISPATCHABLE
1152 
1153 /***************************************************************************/
1174 extern int opennsl_port_interface_set(
1175  int unit,
1178 
1179 /***************************************************************************/
1200 extern int opennsl_port_interface_get(
1201  int unit,
1204 
1205 #endif /* OPENNSL_HIDE_DISPATCHABLE */
1206 
1209 
1210 #define OPENNSL_PORT_DUPLEX_HALF _SHR_PORT_DUPLEX_HALF
1211 #define OPENNSL_PORT_DUPLEX_FULL _SHR_PORT_DUPLEX_FULL
1212 #define OPENNSL_PORT_DUPLEX_COUNT _SHR_PORT_DUPLEX_COUNT
1213 
1214 typedef enum opennsl_port_pause_e {
1220 /* __doxy_func_body_end__ */
1221 
1222 #ifndef OPENNSL_HIDE_DISPATCHABLE
1223 
1224 /***************************************************************************/
1253 extern int opennsl_port_duplex_set(
1254  int unit,
1256  int duplex) LIB_DLL_EXPORTED ;
1257 
1258 /***************************************************************************/
1287 extern int opennsl_port_duplex_get(
1288  int unit,
1290  int *duplex) LIB_DLL_EXPORTED ;
1291 
1292 /***************************************************************************/
1328 extern int opennsl_port_pause_set(
1329  int unit,
1331  int pause_tx,
1332  int pause_rx) LIB_DLL_EXPORTED ;
1333 
1334 /***************************************************************************/
1371 extern int opennsl_port_pause_get(
1372  int unit,
1374  int *pause_tx,
1375  int *pause_rx) LIB_DLL_EXPORTED ;
1376 
1377 /***************************************************************************/
1404 extern int opennsl_port_pause_addr_set(
1405  int unit,
1408 
1409 /***************************************************************************/
1436 extern int opennsl_port_pause_addr_get(
1437  int unit,
1440 
1441 /***************************************************************************/
1460 extern int opennsl_port_pause_sym_set(
1461  int unit,
1463  int pause) LIB_DLL_EXPORTED ;
1464 
1465 /***************************************************************************/
1484 extern int opennsl_port_pause_sym_get(
1485  int unit,
1487  int *pause) LIB_DLL_EXPORTED ;
1488 
1489 #endif /* OPENNSL_HIDE_DISPATCHABLE */
1490 
1491 #ifndef OPENNSL_HIDE_DISPATCHABLE
1492 
1493 /***************************************************************************/
1521 extern int opennsl_port_frame_max_set(
1522  int unit,
1524  int size) LIB_DLL_EXPORTED ;
1525 
1526 /***************************************************************************/
1554 extern int opennsl_port_frame_max_get(
1555  int unit,
1557  int *size) LIB_DLL_EXPORTED ;
1558 
1559 /***************************************************************************/
1582 extern int opennsl_port_l3_mtu_set(
1583  int unit,
1585  int size) LIB_DLL_EXPORTED ;
1586 
1587 /***************************************************************************/
1610 extern int opennsl_port_l3_mtu_get(
1611  int unit,
1613  int *size) LIB_DLL_EXPORTED ;
1614 
1615 #endif /* OPENNSL_HIDE_DISPATCHABLE */
1616 
1617 #define OPENNSL_PORT_PHY_CLAUSE45 _SHR_PORT_PHY_CLAUSE45
1618 #define OPENNSL_PORT_PHY_CLAUSE45_ADDR(_devad, _regad) \
1619  _SHR_PORT_PHY_CLAUSE45_ADDR(_devad, _regad)
1620 #ifndef OPENNSL_HIDE_DISPATCHABLE
1621 
1622 /***************************************************************************/
1649 extern int opennsl_port_phy_modify(
1650  int unit,
1652  uint32 flags,
1653  uint32 phy_reg_addr,
1654  uint32 phy_data,
1655  uint32 phy_mask) LIB_DLL_EXPORTED ;
1656 
1657 #endif /* OPENNSL_HIDE_DISPATCHABLE */
1658 
1661 
1662 #define OPENNSL_PORT_MDIX_AUTO _SHR_PORT_MDIX_AUTO
1663 #define OPENNSL_PORT_MDIX_FORCE_AUTO _SHR_PORT_MDIX_FORCE_AUTO
1664 #define OPENNSL_PORT_MDIX_NORMAL _SHR_PORT_MDIX_NORMAL
1665 #define OPENNSL_PORT_MDIX_XOVER _SHR_PORT_MDIX_XOVER
1666 #define OPENNSL_PORT_MDIX_COUNT _SHR_PORT_MDIX_COUNT
1667 
1669 
1670 #define OPENNSL_PORT_MDIX_STATUS_NORMAL _SHR_PORT_MDIX_STATUS_NORMAL
1671 #define OPENNSL_PORT_MDIX_STATUS_XOVER _SHR_PORT_MDIX_STATUS_XOVER
1672 #define OPENNSL_PORT_MDIX_STATUS_COUNT _SHR_PORT_MDIX_STATUS_COUNT
1673 
1675 
1676 #define OPENNSL_PORT_MEDIUM_NONE _SHR_PORT_MEDIUM_NONE
1677 #define OPENNSL_PORT_MEDIUM_COPPER _SHR_PORT_MEDIUM_COPPER
1678 #define OPENNSL_PORT_MEDIUM_FIBER _SHR_PORT_MEDIUM_FIBER
1679 #define OPENNSL_PORT_MEDIUM_COUNT _SHR_PORT_MEDIUM_COUNT
1680 
1689 /* __doxy_func_body_end__ */
1690 
1691 #ifndef OPENNSL_HIDE_DISPATCHABLE
1692 
1693 /***************************************************************************/
1713 extern int opennsl_port_loopback_set(
1714  int unit,
1716  int loopback) LIB_DLL_EXPORTED ;
1717 
1718 /***************************************************************************/
1738 extern int opennsl_port_loopback_get(
1739  int unit,
1741  int *loopback) LIB_DLL_EXPORTED ;
1742 
1743 /***************************************************************************/
1771 extern int opennsl_port_stp_set(
1772  int unit,
1774  int state) LIB_DLL_EXPORTED ;
1775 
1776 /***************************************************************************/
1804 extern int opennsl_port_stp_get(
1805  int unit,
1807  int *state) LIB_DLL_EXPORTED ;
1808 
1809 #endif /* OPENNSL_HIDE_DISPATCHABLE */
1810 
1811 #define OPENNSL_PORT_LEARN_ARL 0x01
1812 #define OPENNSL_PORT_LEARN_CPU 0x02
1813 #define OPENNSL_PORT_LEARN_FWD 0x04
1814 #define OPENNSL_PORT_LEARN_PENDING 0x08
1815 #ifndef OPENNSL_HIDE_DISPATCHABLE
1816 
1817 /***************************************************************************/
1843 extern int opennsl_port_learn_set(
1844  int unit,
1846  uint32 flags) LIB_DLL_EXPORTED ;
1847 
1848 /***************************************************************************/
1874 extern int opennsl_port_learn_get(
1875  int unit,
1877  uint32 *flags) LIB_DLL_EXPORTED ;
1878 
1879 #endif /* OPENNSL_HIDE_DISPATCHABLE */
1880 
1881 #define OPENNSL_PORT_LINK_STATUS_UP 1
1882 #ifndef OPENNSL_HIDE_DISPATCHABLE
1883 
1884 /***************************************************************************/
1908 extern int opennsl_port_link_status_get(
1909  int unit,
1911  int *status) LIB_DLL_EXPORTED ;
1912 
1913 /***************************************************************************/
1932  int unit,
1934 
1935 #endif /* OPENNSL_HIDE_DISPATCHABLE */
1936 
1937 #define OPENNSL_PORT_IFILTER_OFF 0
1938 #define OPENNSL_PORT_IFILTER_ON 1
1939 #ifndef OPENNSL_HIDE_DISPATCHABLE
1940 
1941 /***************************************************************************/
1964 extern int opennsl_port_ifilter_set(
1965  int unit,
1967  int mode) LIB_DLL_EXPORTED ;
1968 
1969 #endif /* OPENNSL_HIDE_DISPATCHABLE */
1970 
1971 #define OPENNSL_PORT_VLAN_MEMBER_INGRESS 0x00000001
1972 #define OPENNSL_PORT_VLAN_MEMBER_EGRESS 0x00000002
1973 #ifndef OPENNSL_HIDE_DISPATCHABLE
1974 
1975 /***************************************************************************/
2013 extern int opennsl_port_vlan_member_set(
2014  int unit,
2016  uint32 flags) LIB_DLL_EXPORTED ;
2017 
2018 /***************************************************************************/
2056 extern int opennsl_port_vlan_member_get(
2057  int unit,
2059  uint32 *flags) LIB_DLL_EXPORTED ;
2060 
2061 #endif /* OPENNSL_HIDE_DISPATCHABLE */
2062 
2063 #ifndef OPENNSL_HIDE_DISPATCHABLE
2064 
2065 /***************************************************************************/
2085  int unit,
2087  uint32 *count) LIB_DLL_EXPORTED ;
2088 
2089 #endif /* OPENNSL_HIDE_DISPATCHABLE */
2090 
2091 #define OPENNSL_PORT_PRBS_POLYNOMIAL_X7_X6_1 _SHR_PORT_PRBS_POLYNOMIAL_X7_X6_1
2092 #define OPENNSL_PORT_PRBS_POLYNOMIAL_X15_X14_1 _SHR_PORT_PRBS_POLYNOMIAL_X15_X14_1
2093 #define OPENNSL_PORT_PRBS_POLYNOMIAL_X23_X18_1 _SHR_PORT_PRBS_POLYNOMIAL_X23_X18_1
2094 #define OPENNSL_PORT_PRBS_POLYNOMIAL_X31_X28_1 _SHR_PORT_PRBS_POLYNOMIAL_X31_X28_1
2095 #define OPENNSL_PORT_PRBS_POLYNOMIAL_X9_X5_1 _SHR_PORT_PRBS_POLYNOMIAL_X9_X5_1
2096 #define OPENNSL_PORT_PRBS_POLYNOMIAL_X11_X9_1 _SHR_PORT_PRBS_POLYNOMIAL_X11_X9_1
2097 #define OPENNSL_PORT_PRBS_POLYNOMIAL_X58_X31_1 _SHR_PORT_PRBS_POLYNOMIAL_X58_X31_1
2098 #ifndef OPENNSL_HIDE_DISPATCHABLE
2099 
2100 /***************************************************************************/
2122 extern int opennsl_port_egress_set(
2123  int unit,
2125  int modid,
2127 
2128 /***************************************************************************/
2150 extern int opennsl_port_egress_get(
2151  int unit,
2153  int modid,
2155 
2156 #endif /* OPENNSL_HIDE_DISPATCHABLE */
2157 
2158 #define OPENNSL_PORT_FLOOD_BLOCK_BCAST 0x1
2159 #define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_UCAST 0x2
2160 #define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_MCAST 0x4
2161 #define OPENNSL_PORT_FLOOD_BLOCK_ALL 0x8
2162 #define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_IP_MCAST 0x10
2163 #define OPENNSL_PORT_FLOOD_BLOCK_UNKNOWN_NONIP_MCAST 0x20
2164 #define OPENNSL_PORT_FLOOD_BLOCK_KNOWN_MCAST 0x40
2165 #ifndef OPENNSL_HIDE_DISPATCHABLE
2166 
2167 /***************************************************************************/
2187 extern int opennsl_port_flood_block_set(
2188  int unit,
2189  opennsl_port_t ingress_port,
2190  opennsl_port_t egress_port,
2191  uint32 flags) LIB_DLL_EXPORTED ;
2192 
2193 /***************************************************************************/
2213 extern int opennsl_port_flood_block_get(
2214  int unit,
2215  opennsl_port_t ingress_port,
2216  opennsl_port_t egress_port,
2217  uint32 *flags) LIB_DLL_EXPORTED ;
2218 
2219 /***************************************************************************/
2241 extern int opennsl_port_sample_rate_set(
2242  int unit,
2244  int ingress_rate,
2245  int egress_rate) LIB_DLL_EXPORTED ;
2246 
2247 /***************************************************************************/
2269 extern int opennsl_port_sample_rate_get(
2270  int unit,
2272  int *ingress_rate,
2273  int *egress_rate) LIB_DLL_EXPORTED ;
2274 
2275 #endif /* OPENNSL_HIDE_DISPATCHABLE */
2276 
2277 #define OPENNSL_PORT_DTAG_MODE_NONE 0
2278 #define OPENNSL_PORT_DTAG_MODE_INTERNAL 1
2279 #define OPENNSL_PORT_DTAG_MODE_EXTERNAL 2
2280 #ifndef OPENNSL_HIDE_DISPATCHABLE
2281 
2282 /***************************************************************************/
2304 extern int opennsl_port_dtag_mode_set(
2305  int unit,
2307  int mode) LIB_DLL_EXPORTED ;
2308 
2309 /***************************************************************************/
2331 extern int opennsl_port_dtag_mode_get(
2332  int unit,
2334  int *mode) LIB_DLL_EXPORTED ;
2335 
2336 #endif /* OPENNSL_HIDE_DISPATCHABLE */
2337 
2338 #define OPENNSL_PORT_ATTR_ENABLE_MASK 0x00000001
2339 #define OPENNSL_PORT_ATTR_LINKSTAT_MASK 0x00000002
2340 #define OPENNSL_PORT_ATTR_AUTONEG_MASK 0x00000004
2341 #define OPENNSL_PORT_ATTR_SPEED_MASK 0x00000008
2342 #define OPENNSL_PORT_ATTR_DUPLEX_MASK 0x00000010
2343 #define OPENNSL_PORT_ATTR_LINKSCAN_MASK 0x00000020
2344 #define OPENNSL_PORT_ATTR_LEARN_MASK 0x00000040
2345 #define OPENNSL_PORT_ATTR_DISCARD_MASK 0x00000080
2346 #define OPENNSL_PORT_ATTR_VLANFILTER_MASK 0x00000100
2347 #define OPENNSL_PORT_ATTR_UNTAG_PRI_MASK 0x00000200
2348 #define OPENNSL_PORT_ATTR_UNTAG_VLAN_MASK 0x00000400
2349 #define OPENNSL_PORT_ATTR_STP_STATE_MASK 0x00000800
2350 #define OPENNSL_PORT_ATTR_PFM_MASK 0x00001000
2351 #define OPENNSL_PORT_ATTR_LOOPBACK_MASK 0x00002000
2352 #define OPENNSL_PORT_ATTR_PHY_MASTER_MASK 0x00004000
2353 #define OPENNSL_PORT_ATTR_INTERFACE_MASK 0x00008000
2354 #define OPENNSL_PORT_ATTR_PAUSE_TX_MASK 0x00010000
2355 #define OPENNSL_PORT_ATTR_PAUSE_RX_MASK 0x00020000
2356 #define OPENNSL_PORT_ATTR_PAUSE_MAC_MASK 0x00040000
2357 #define OPENNSL_PORT_ATTR_LOCAL_ADVERT_MASK 0x00080000
2358 #define OPENNSL_PORT_ATTR_REMOTE_ADVERT_MASK 0x00100000
2359 #define OPENNSL_PORT_ATTR_ENCAP_MASK 0x00200000
2360 #define OPENNSL_PORT_ATTR_RATE_MCAST_MASK 0x00400000
2361 #define OPENNSL_PORT_ATTR_RATE_BCAST_MASK 0x00800000
2362 #define OPENNSL_PORT_ATTR_RATE_DLFBC_MASK 0x01000000
2363 #define OPENNSL_PORT_ATTR_SPEED_MAX_MASK 0x02000000
2364 #define OPENNSL_PORT_ATTR_ABILITY_MASK 0x04000000
2365 #define OPENNSL_PORT_ATTR_FRAME_MAX_MASK 0x08000000
2366 #define OPENNSL_PORT_ATTR_MDIX_MASK 0x10000000
2367 #define OPENNSL_PORT_ATTR_MDIX_STATUS_MASK 0x20000000
2368 #define OPENNSL_PORT_ATTR_MEDIUM_MASK 0x40000000
2369 #define OPENNSL_PORT_ATTR_FAULT_MASK 0x80000000
2370 #define OPENNSL_PORT_ATTR2_PORT_ABILITY 0x00000001
2371 #define OPENNSL_PORT_ATTR_ALL_MASK 0xffffffff
2372 
2373 typedef struct opennsl_port_info_s {
2376  int enable;
2378  int autoneg;
2379  int speed;
2380  int duplex;
2381  int linkscan;
2383  int discard;
2388  int pfm;
2389  int loopback;
2392  int pause_tx;
2393  int pause_rx;
2416 /* __doxy_func_body_end__ */
2417 
2418 #ifndef OPENNSL_HIDE_DISPATCHABLE
2419 
2420 /***************************************************************************/
2459 extern int opennsl_port_selective_get(
2460  int unit,
2463 
2464 /***************************************************************************/
2503 extern int opennsl_port_selective_set(
2504  int unit,
2507 
2508 #endif /* OPENNSL_HIDE_DISPATCHABLE */
2509 
2510 #ifndef OPENNSL_HIDE_DISPATCHABLE
2511 
2512 /***************************************************************************/
2532  int unit,
2534  int prio,
2536 
2537 /***************************************************************************/
2557  int unit,
2559  int prio,
2561 
2562 /***************************************************************************/
2575  int unit,
2577  int pkt_pri,
2578  int cfi,
2579  int internal_pri,
2581 
2582 /***************************************************************************/
2595  int unit,
2597  int pkt_pri,
2598  int cfi,
2599  int *internal_pri,
2601 
2602 #endif /* OPENNSL_HIDE_DISPATCHABLE */
2603 
2605 typedef enum opennsl_port_class_e {
2619 /* __doxy_func_body_end__ */
2620 
2621 #ifndef OPENNSL_HIDE_DISPATCHABLE
2622 
2623 /***************************************************************************/
2642 extern int opennsl_port_class_set(
2643  int unit,
2645  opennsl_port_class_t pclass,
2646  uint32 class_id) LIB_DLL_EXPORTED ;
2647 
2648 /***************************************************************************/
2667 extern int opennsl_port_class_get(
2668  int unit,
2670  opennsl_port_class_t pclass,
2671  uint32 *class_id) LIB_DLL_EXPORTED ;
2672 
2673 #endif /* OPENNSL_HIDE_DISPATCHABLE */
2674 
2737 /* __doxy_func_body_end__ */
2738 
2739 #ifndef OPENNSL_HIDE_DISPATCHABLE
2740 
2741 /***************************************************************************/
2762 extern int opennsl_port_control_set(
2763  int unit,
2765  opennsl_port_control_t type,
2766  int value) LIB_DLL_EXPORTED ;
2767 
2768 /***************************************************************************/
2789 extern int opennsl_port_control_get(
2790  int unit,
2792  opennsl_port_control_t type,
2793  int *value) LIB_DLL_EXPORTED ;
2794 
2795 /***************************************************************************/
2814  int unit,
2817 
2818 #endif /* OPENNSL_HIDE_DISPATCHABLE */
2819 
2820 /***************************************************************************/
2830 extern void opennsl_port_info_t_init(
2832 
2833 /***************************************************************************/
2848 extern void opennsl_port_ability_t_init(
2850 
2851 /***************************************************************************/
2867 extern void opennsl_port_config_t_init(
2869 
2872 
2873 #define OPENNSL_PORT_PHY_CONTROL_FORWARD_ERROR_CORRECTION _SHR_PORT_PHY_CONTROL_FORWARD_ERROR_CORRECTION
2874 #define OPENNSL_PORT_PHY_CONTROL_FEC_OFF _SHR_PORT_PHY_CONTROL_FEC_OFF
2875 #define OPENNSL_PORT_PHY_CONTROL_FEC_ON _SHR_PORT_PHY_CONTROL_FEC_ON
2876 #define OPENNSL_PORT_PHY_CONTROL_SOFTWARE_RX_LOS _SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS
2877 #define OPENNSL_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_LINK_WAIT_TIMER_US _SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_LINK_WAIT_TIMER_US
2878 #define OPENNSL_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_RESTART_TIMER_US _SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_RESTART_TIMER_US
2879 #define OPENNSL_PORT_PHY_CONTROL_RX_LOS_NONE _SHR_PORT_PHY_CONTROL_RX_LOS_NONE
2880 #define OPENNSL_PORT_PHY_CONTROL_RX_LOS_SOFTWARE _SHR_PORT_PHY_CONTROL_RX_LOS_SOFTWARE
2881 #define OPENNSL_PORT_PHY_CONTROL_RX_LOS_FIRMWARE _SHR_PORT_PHY_CONTROL_RX_LOS_FIRMWARE
2882 #ifndef OPENNSL_HIDE_DISPATCHABLE
2883 
2884 /***************************************************************************/
2902 extern int opennsl_port_phy_control_set(
2903  int unit,
2906  uint32 value) LIB_DLL_EXPORTED ;
2907 
2908 /***************************************************************************/
2926 extern int opennsl_port_phy_control_get(
2927  int unit,
2930  uint32 *value) LIB_DLL_EXPORTED ;
2931 
2932 /***************************************************************************/
2951 extern int opennsl_port_gport_get(
2952  int unit,
2955 
2956 /***************************************************************************/
2976 extern int opennsl_port_local_get(
2977  int unit,
2978  opennsl_gport_t gport,
2979  opennsl_port_t *local_port) LIB_DLL_EXPORTED ;
2980 
2981 #endif /* OPENNSL_HIDE_DISPATCHABLE */
2982 
2983 #ifndef OPENNSL_HIDE_DISPATCHABLE
2984 
2985 /***************************************************************************/
2998 extern int opennsl_port_stat_enable_set(
2999  int unit,
3001  int enable) LIB_DLL_EXPORTED ;
3002 
3003 #endif /* OPENNSL_HIDE_DISPATCHABLE */
3004 
3005 #define OPENNSL_PORT_CONTROL_SAMPLE_DEST_CPU 0x1
3007 #define OPENNSL_PORT_CONTROL_SAMPLE_DEST_MIRROR 0x2
3014 typedef enum opennsl_port_field_egress_class_select_e {
3017 /* __doxy_func_body_end__ */
3018 
3019 #ifndef OPENNSL_HIDE_DISPATCHABLE
3020 
3021 /***************************************************************************/
3037  int unit,
3038  opennsl_gport_t gport,
3039  int prio,
3040  int priority_group ) LIB_DLL_EXPORTED ;
3041 
3042 /***************************************************************************/
3058  int unit,
3059  opennsl_gport_t gport,
3060  int prio,
3061  int *priority_group) LIB_DLL_EXPORTED ;
3062 
3063 #endif /* OPENNSL_HIDE_DISPATCHABLE */
3064 
3070 /* __doxy_func_body_end__ */
3071 
3072 #ifndef OPENNSL_HIDE_DISPATCHABLE
3073 
3074 /***************************************************************************/
3092  int unit,
3093  opennsl_gport_t gport,
3094  int priority_group,
3096 
3097 /***************************************************************************/
3115  int unit,
3116  opennsl_gport_t gport,
3117  int priority_group,
3119 
3120 #endif /* OPENNSL_HIDE_DISPATCHABLE */
3121 
3122 /***************************************************************************/
3137 
3138 #include <opennsl/portX.h>
3139 #endif /* __OPENNSL_PORT_H__ */
3140