sat.h (30523B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 7 * 8 * DO NOT EDIT THIS FILE! 9 * This file is auto-generated. 10 * Edits to this file will be lost when it is regenerated. 11 */ 12 13 #ifndef __BCM_SAT_H__ 14 #define __BCM_SAT_H__ 15 16 #include <bcm/types.h> 17 #include <bcm/pkt.h> 18 19 /* SAT endpoint flags */ 20 #define BCM_SAT_ENDPOINT_WITH_ID 0x01 /* Use the specified 21 endpoint ID */ 22 #define BCM_SAT_ENDPOINT_REPLACE 0x02 /* Replace an existing 23 SAT endpoint */ 24 #define BCM_SAT_ENDPOINT_UPMEP 0x04 /* Endpoint associated 25 with SAT UP-MEP */ 26 #define BCM_SAT_ENDPOINT_DOWNMEP 0x08 /* Endpoint associated 27 with SAT DOWN-MEP */ 28 #define BCM_SAT_ENDPOINT_MATCH_INNER_VLAN 0x10 /* Selection of SAT MEP 29 based on C VLAN */ 30 #define BCM_SAT_ENDPOINT_MATCH_OUTER_VLAN 0x20 /* Selection of SAT MEP 31 based on C VLAN */ 32 33 /* SAT action flags */ 34 #define BCM_SAT_ACTION_FWD_ACTION_DROP 0x01 /* Forward action for the 35 SAT packet is to drop */ 36 #define BCM_SAT_ACTION_FWD_ACTION_REDIRECT 0x02 /* Forward action for the 37 SAT packet is redirect 38 to DGLP port */ 39 #define BCM_SAT_ACTION_FWD_ACTION_LLF 0x04 /* Forward action for the 40 SAT packet is perform 41 latching loop back 42 function (LLF) and 43 redirect packet to 44 SGLP port */ 45 #define BCM_SAT_ACTION_COPY_TO_CPU 0x08 /* Copy SAT packet to CPU */ 46 #define BCM_SAT_ACTION_SAMPLE_TIMESTAMP 0x10 /* Sample time stamp into 47 the OLP header */ 48 49 /* SAT Timestamp Formats */ 50 typedef enum bcm_sat_timestamp_format_e { 51 bcmSATTimestampFormatIEEE1588v1 = 0x00, /* Low-order 64 bits of the IEEE 52 1588-2008 (1588v2) Precision Time 53 Protocol timestamp format [IEEE1588] */ 54 bcmSATTimestampFormatNTP = 0x01 /* Network Time Protocol version 4 55 64-bit timestamp format [RFC5905] */ 56 } bcm_sat_timestamp_format_t; 57 58 /* SAT endpoint ID type */ 59 typedef int bcm_sat_endpoint_t; 60 61 /* SAT endpoint object. */ 62 typedef struct bcm_sat_endpoint_info_s { 63 bcm_sat_endpoint_t ep_id; /* The ID associated with this endpoint */ 64 uint32 flags; /* The flags associated with this 65 endpoint */ 66 bcm_gport_t src_gport; /* The source gport associated with this 67 endpoint */ 68 bcm_vlan_t outer_vlan; /* Outer-most VLAN tag (vlanID+ 3bits 69 dot1p +CFI) associated with this 70 endpoint */ 71 bcm_vlan_t inner_vlan; /* Configure with CVLAN tag (vlanID+ 72 3bits dot1p +CFI) for two-tag 73 operation or set to 0 for one-tag */ 74 bcm_mac_t dst_mac_address; /* The destination MAC address 75 associated with this endpoint */ 76 bcm_mac_t src_mac_address; /* The source MAC address associated 77 with this endpoint */ 78 uint16 ether_type; /* Ether type of the packet */ 79 uint32 action_flags; /* SAT action flags */ 80 uint8 pkt_pri; /* Egress priority marking for packet 81 redirected to DGPP */ 82 bcm_gport_t dest_gport; /* Local endpoint SAT PDUs are forwarded 83 to this OLP destination port for 84 processing */ 85 bcm_sat_timestamp_format_t timestamp_format; /* SAT timestamp format */ 86 uint16 session_id; /* SAT session ID to identify the test 87 among the MEPs */ 88 } bcm_sat_endpoint_info_t; 89 90 /* Callback function type for SAT endpoint traversal */ 91 typedef int (*bcm_sat_endpoint_traverse_cb)( 92 int unit, 93 bcm_sat_endpoint_info_t *endpoint_info, 94 void *user_data); 95 96 #ifndef BCM_HIDE_DISPATCHABLE 97 98 /* Create or replace an SAT endpoint object */ 99 extern int bcm_sat_endpoint_create( 100 int unit, 101 bcm_sat_endpoint_info_t *endpoint_info); 102 103 /* Get an SAT endpoint object */ 104 extern int bcm_sat_endpoint_get( 105 int unit, 106 bcm_sat_endpoint_t endpoint, 107 uint32 flags, 108 bcm_sat_endpoint_info_t *endpoint_info); 109 110 /* Destroy an SAT endpoint object */ 111 extern int bcm_sat_endpoint_destroy( 112 int unit, 113 bcm_sat_endpoint_t endpoint, 114 uint32 flags); 115 116 /* Destroy all SAT endpoint objects associated with a given endpoint type */ 117 extern int bcm_sat_endpoint_destroy_all( 118 int unit, 119 uint32 flags); 120 121 /* 122 * Traverse the set of SAT endpoints associated with the specified 123 * endpoint type, calling a specified callback for each one 124 */ 125 extern int bcm_sat_endpoint_traverse( 126 int unit, 127 uint32 flags, 128 bcm_sat_endpoint_traverse_cb cb, 129 void *user_data); 130 131 #endif /* BCM_HIDE_DISPATCHABLE */ 132 133 /* Miscellaneous SAT defines */ 134 #define BCM_SAT_GTF_NUM_OF_PRIORITIES 2 /* Number of element in 135 gtf */ 136 #define BCM_SAT_PAYLOAD_MAX_PATTERN_SIZE 8 /* SAT payload pattern 137 max size */ 138 #define BCM_SAT_GTF_PACKET_LENGTH_NUM_OF_PATTERNS 8 /* Number of pattern of 139 GTF packet length */ 140 #define BCM_SAT_GTF_PACKET_MAX_PATTERN_LENGTH 32 /* SAT packet max pattern 141 length */ 142 #define BCM_SAT_GTF_MAX_STAMPS 3 /* Max stamps of SAT GTF */ 143 #define BCM_SAT_CTF_IDENTIFIER_ANY 0xFFFFFFFF /* SAT ctf idenifier */ 144 #define BCM_SAT_CTF_STAT_MAX_NUM_OF_BINS 10 /* SAT ctf bins number */ 145 146 /* SAT config flags */ 147 #define BCM_SAT_CONFIG_CRC_REVERSED_DATA 0x01 /* During CRC calculation 148 the packet data bits 149 are reversed */ 150 #define BCM_SAT_CONFIG_CRC_INVERT 0x02 /* During CRC calculation 151 the result is inverted 152 and reversed before 153 stamping */ 154 #define BCM_SAT_CONFIG_CRC_HIGH_RESET 0x04 /* During CRC 155 calculations, reset 156 CRC value is taken to 157 be 32'hffffffff */ 158 #define BCM_SAT_CONFIG_PRBS_USE_NXOR 0x08 /* During PRBS 159 calculations the next 160 bit is created using 161 NXOR (and not XOR) */ 162 163 /* SAT GTF create flags */ 164 #define BCM_SAT_GTF_WITH_ID 0x01 /* Use the specified gtf ID */ 165 166 /* SAT GTF packet config flags */ 167 #define BCM_SAT_GTF_PACKET_EDIT_ADD_END_TLV 0x01 /* If set, add an END TLV 168 at the end of the 169 packet */ 170 #define BCM_SAT_GTF_PACKET_EDIT_ADD_CRC 0x02 /* If set, add CRC */ 171 172 /* SAT GTF rate pattern flags */ 173 #define BCM_SAT_GTF_RATE_PATTERN_STOP_INTERVAL_EQ_BURST 0x01 /* If set, INTERVAL state 174 limit is set to the 175 configuration, 176 otherwise to the 177 number of packets sent 178 in BURST state */ 179 180 /* SAT GTF rate flags */ 181 #define BCM_SAT_GTF_RATE_IN_BYTES 0x0 /* If set, gtf rate is 182 configured in bytes 183 per second */ 184 #define BCM_SAT_GTF_RATE_IN_PACKETS 0x01 /* If set, gtf rate is 185 configured in packets 186 per second */ 187 #define BCM_SAT_GTF_RATE_WITH_GRANULARITY 0x02 /* If set, the 188 granularity can be 189 changed; if not, 190 granularity will be 1 */ 191 192 /* SAT CTF create flags */ 193 #define BCM_SAT_CTF_WITH_ID 0x01 /* Use the specified ctf ID */ 194 195 /* SAT CTF packet config flags */ 196 #define BCM_SAT_CTF_PACKET_INFO_ADD_END_TLV 0x01 /* If set, add end tlv, 197 otherwise not add end 198 tlv */ 199 #define BCM_SAT_CTF_PACKET_INFO_ADD_CRC 0x02 /* If set, add crc, 200 otherwise not add crc */ 201 202 /* SAT CTF Stat Get flags */ 203 #define BCM_SAT_CTF_STAT_DO_NOT_CLR_ON_READ 0x01 /* If set, do not clear 204 counter when reading, 205 otherwise clear 206 counter */ 207 208 /* SAT CTF Report Config flags */ 209 #define BCM_SAT_CTF_REPORT_ADD_SEQ_NUM 0x01 /* If set, add sequence 210 number to reports */ 211 #define BCM_SAT_CTF_REPORT_ADD_DELAY 0x02 /* If set, add delay to 212 reports */ 213 214 /* SAT gtf ID type */ 215 typedef int bcm_sat_gtf_t; 216 217 /* SAT ctf ID type */ 218 typedef int bcm_sat_ctf_t; 219 220 /* SAT GTF Priority */ 221 typedef enum bcm_sat_gtf_pri_e { 222 bcmSatGtfPriAll = -1, /* Relevant to both CIR generator and EIR generator */ 223 bcmSatGtfPriCir = 0, /* Only relevant to CIR generator */ 224 bcmSatGtfPriEir = 1 /* Only relevant to EIR generator */ 225 } bcm_sat_gtf_pri_t; 226 227 /* SAT Header Type */ 228 typedef enum bcm_sat_header_type_e { 229 bcmSatHeaderUserDefined = 0, /* User defined SAT header */ 230 bcmSatHeaderY1731 = 1, /* SAT Header defined by Y1731 */ 231 bcmSatHeaderMEF = 2, /* SAT Header defined by MEF */ 232 bcmSatHeadersCount = 3 /* Always Last. Not a usable value. */ 233 } bcm_sat_header_type_t; 234 235 /* SAT Payload Type */ 236 typedef enum bcm_sat_payload_type_e { 237 bcmSatPayloadConstant8Bytes = 0, /* 8 byte repeatable pattern */ 238 bcmSatPayloadConstant4Bytes = 1, /* 4 byte repeatable pattern */ 239 bcmSatPayloadPRBS = 2, /* PRBS-31 */ 240 bcmSatPayloadsCount = 3 /* Always Last. Not a usable value. */ 241 } bcm_sat_payload_type_t; 242 243 /* SAT Stamp Type */ 244 typedef enum bcm_sat_stamp_type_e { 245 bcmSatStampInvalid = 0, /* Invalid stamp type */ 246 bcmSatStampConstant2Bit = 1, /* 2 bit stamp - constant value to stamp 247 into the packet */ 248 bcmSatStampCounter8Bit = 2, /* 8 bit counter */ 249 bcmSatStampCounter16Bit = 3, /* 16 bit counter */ 250 bcmSatStampConstant16Bit = 4, /* 16 bit stamp - constant value to stamp 251 into the packet */ 252 bcmSatStampCount = 5 /* Always Last. Not a usable value. */ 253 } bcm_sat_stamp_type_t; 254 255 /* SAT Stamp Field */ 256 typedef enum bcm_sat_stamp_field_e { 257 bcmSatStampFieldUserDefined = 0, /* Stamp user defined field */ 258 bcmSatStampFieldTc = 1, /* Stamp Tc */ 259 bcmSatStampFieldDp = 2, /* Stamp Dp */ 260 bcmSatStampFieldSrcMac = 3, /* Stamp Src Mac */ 261 bcmSatStampFieldDestMac = 4, /* Stamp Dest Mac */ 262 bcmSatStampFieldInnerVlan = 5, /* Stamp Inner Vlan */ 263 bcmSatStampFieldOuterVlan = 6, /* Stamp Outer Vlan */ 264 bcmSatStampFieldsCount = 7 /* Always Last. Not a usable value. */ 265 } bcm_sat_stamp_field_t; 266 267 /* SAT gtf rate pattern mode */ 268 typedef enum bcm_sat_gtf_rate_pattern_mode_e { 269 bcmSatGtfRatePatternContinues = 0, /* Plain */ 270 bcmSatGtfRatePatternSimpleBurst = 1, /* Burst only */ 271 bcmSatGtfRatePatternCombined = 2, /* Combined mode */ 272 bcmSatGtfRatePatternInterval = 3, /* Interval mode */ 273 bcmSatGtfRatePatternsCount = 4 /* Always Last. Not a usable value. */ 274 } bcm_sat_gtf_rate_pattern_mode_t; 275 276 /* SAT gtf counter types */ 277 typedef enum bcm_sat_gtf_stat_counter_e { 278 bcmSatGtfStatPacketCount = 0, /* Count number of packets transmitted */ 279 bcmSatGtfStatCount = 1 /* Always Last. Not a usable value. */ 280 } bcm_sat_gtf_stat_counter_t; 281 282 /* SAT event types */ 283 typedef enum bcm_sat_event_type_e { 284 bcmSATEventReport = 0, 285 bcmSATEventCount = 1 /* Always Last. Not a usable value. */ 286 } bcm_sat_event_type_t; 287 288 /* Sat common configuration Object */ 289 typedef struct bcm_sat_config_s { 290 bcm_sat_timestamp_format_t timestamp_format; /* SAT timestamp format */ 291 uint32 config_flags; 292 uint32 seq_number_wrap_around; /* SEQ number wrap-around */ 293 } bcm_sat_config_t; 294 295 /* 296 * Offsets of payload, timestamp and sequence number in user defined 297 * header 298 */ 299 typedef struct bcm_sat_header_user_define_offsets_s { 300 int payload_offset; /* Payload offset */ 301 int timestamp_offset; /* Timestamp offset */ 302 int seq_number_offset; /* Sequence number offset */ 303 int crc_byte_offset; /* offset of CRC covered byte */ 304 } bcm_sat_header_user_define_offsets_t; 305 306 /* Configure sat payload */ 307 typedef struct bcm_sat_payload_s { 308 bcm_sat_payload_type_t payload_type; /* Payload type */ 309 uint8 payload_pattern[BCM_SAT_PAYLOAD_MAX_PATTERN_SIZE]; /* Payload pattern */ 310 } bcm_sat_payload_t; 311 312 /* Configure sat stamp */ 313 typedef struct bcm_sat_stamp_s { 314 bcm_sat_stamp_type_t stamp_type; /* Stamp type */ 315 bcm_sat_stamp_field_t field_type; /* Stamp field type */ 316 uint32 inc_step; /* Increment step - by what value the 317 counter should be incremented */ 318 uint32 inc_period_packets; /* Increment period - counter may be 319 incremented every 1/2/4/8 packets */ 320 uint32 value; /* Stamp value */ 321 uint32 offset; /* Stamp offset in bits - where to stamp 322 the counter, beginning from start of 323 packet */ 324 } bcm_sat_stamp_t; 325 326 /* Configure sat packet of gtf */ 327 typedef struct bcm_sat_gtf_packet_edit_s { 328 uint32 packet_length[BCM_SAT_GTF_PACKET_LENGTH_NUM_OF_PATTERNS]; /* Packet length */ 329 uint32 packet_length_pattern[BCM_SAT_GTF_PACKET_MAX_PATTERN_LENGTH]; /* Packet length pattern */ 330 uint32 pattern_length; /* Pattern length */ 331 bcm_sat_stamp_t stamps[BCM_SAT_GTF_MAX_STAMPS]; /* Configurae stamp */ 332 uint32 number_of_stamps; /* Number of stamps valid in stamps */ 333 uint32 number_of_ctfs; /* Number of CTFs which collect 334 information from the current gtf */ 335 uint32 flags; 336 } bcm_sat_gtf_packet_edit_t; 337 338 /* Sat gtf packet config */ 339 typedef struct bcm_sat_gtf_packet_config_s { 340 bcm_sat_header_type_t sat_header_type; /* Sat header type */ 341 bcm_pkt_t header_info; /* Sat header info */ 342 bcm_sat_payload_t payload; /* Sat payload */ 343 bcm_sat_gtf_packet_edit_t packet_edit[BCM_SAT_GTF_NUM_OF_PRIORITIES]; /* Packet edit for each element of the 344 gtf */ 345 uint32 packet_context_id; /* Core ID for jericho */ 346 bcm_sat_header_user_define_offsets_t offsets; /* Offsets of payload, timestamp and 347 sequence number in user defined 348 header */ 349 } bcm_sat_gtf_packet_config_t; 350 351 /* Configure sat gtf bandwidth */ 352 typedef struct bcm_sat_gtf_bandwidth_s { 353 uint32 flags; 354 uint32 rate; /* traffic rate. Units: kbps */ 355 uint32 max_burst; /* traffic burst. Units: kbit */ 356 uint32 granularity; /* packet per second */ 357 } bcm_sat_gtf_bandwidth_t; 358 359 /* Configure sat gtf rate pattern */ 360 typedef struct bcm_sat_gtf_rate_pattern_s { 361 bcm_sat_gtf_rate_pattern_mode_t rate_pattern_mode; /* rate pattern mode */ 362 uint32 high_threshold; /* High threshold */ 363 uint32 low_threshold; /* Lower threshold */ 364 uint32 stop_iter_count; /* Stop Iterations */ 365 uint32 stop_burst_count; /* Stop Burst count - Burst state is 366 left when number of packets 367 transmitted in this state is 368 greater-equal than this value */ 369 uint32 stop_interval_count; /* Stop interval count */ 370 uint32 burst_packet_weight; /* Burst Pkt Weight - on each packet 371 transmitted in Burst state packet 372 counter increased by this value */ 373 uint32 interval_packet_weight; /* Inteval Packet weight - on each 374 packet transmitted in Interval state 375 packet counter increased by this 376 value */ 377 uint32 flags; 378 } bcm_sat_gtf_rate_pattern_t; 379 380 /* Sat ctf packet config */ 381 typedef struct bcm_sat_ctf_packet_info_s { 382 bcm_sat_header_type_t sat_header_type; /* Sat header type */ 383 bcm_sat_payload_t payload; /* Sat payload */ 384 uint32 flags; 385 bcm_sat_header_user_define_offsets_t offsets; /* Offsets of payload, timestamp and 386 sequence number in user defined 387 header */ 388 } bcm_sat_ctf_packet_info_t; 389 390 /* Sat ctf is recognized by this parameters */ 391 typedef struct bcm_sat_ctf_identifier_s { 392 uint32 tc; /* Class of service */ 393 uint32 color; /* Color */ 394 uint32 trap_id; /* Trap ID */ 395 uint32 session_id; /* SAT session ID */ 396 } bcm_sat_ctf_identifier_t; 397 398 /* Sat ctf bin limit */ 399 typedef struct bcm_sat_ctf_bin_limit_s { 400 uint32 bin_select; /* bin select */ 401 uint32 bin_limit; /* bin limit */ 402 } bcm_sat_ctf_bin_limit_t; 403 404 /* Sat ctf stat object for configuration */ 405 typedef struct bcm_sat_ctf_stat_config_s { 406 uint32 use_global_bin_config; /* Use global bin config */ 407 uint32 bin_min_delay; /* Bin min delay, for linear bins */ 408 uint32 bin_step; /* Bin step, for linear bins */ 409 uint32 update_counters_in_unvavail_state; /* Update counters in unavail state */ 410 } bcm_sat_ctf_stat_config_t; 411 412 /* Sat ctf stat */ 413 typedef struct bcm_sat_ctf_stat_s { 414 uint64 received_packet_cnt; /* Counter packet counter */ 415 uint64 out_of_order_packet_cnt; /* Counter for out of order packet */ 416 uint64 err_packet_cnt; /* Counter for error packet */ 417 uint64 received_octet_cnt; /* Counter for received octet */ 418 uint64 out_of_order_octet_cnt; /* Counter for out of order octet */ 419 uint64 err_octet_cnt; /* Counter for error octet */ 420 uint64 last_packet_delay; /* counter for last packet delay */ 421 uint64 bin_delay_counters[BCM_SAT_CTF_STAT_MAX_NUM_OF_BINS]; /* Counters for bin delay */ 422 uint64 accumulated_delay_count; /* Counter for accumulated delay */ 423 uint64 max_packet_delay; /* max packet delay */ 424 uint64 min_packet_delay; /* min packet delay */ 425 uint64 time_of_day_stamp; /* Time of day stamp */ 426 uint64 sec_in_avail_state_counter; /* Counter for sec in avail state */ 427 uint64 last_packet_seq_number; /* Last received packet sequence number */ 428 } bcm_sat_ctf_stat_t; 429 430 /* Sat gtf stat */ 431 typedef struct bcm_sat_gtf_stat_multi_s { 432 uint64 transmitted_packet_cnt; /* Counter transmitted packet */ 433 uint64 transmitted_byte_cnt; /* Counter transmitted byte */ 434 } bcm_sat_gtf_stat_multi_t; 435 436 /* Sat ctf state for configuration */ 437 typedef struct bcm_sat_ctf_availability_config_s { 438 uint32 switch_state_num_of_slots; /* Number of slot */ 439 uint32 switch_state_threshold_per_slot; /* Threshold per slot */ 440 } bcm_sat_ctf_availability_config_t; 441 442 /* Sat ctf report object */ 443 typedef struct bcm_sat_ctf_report_config_s { 444 uint32 report_sampling_percent; /* Report sampling percent */ 445 uint32 flags; 446 } bcm_sat_ctf_report_config_t; 447 448 /* Sat ctf report event data */ 449 typedef struct bcm_sat_report_event_data_s { 450 int sequence_number; /* Sequence number */ 451 int sequence_number_valid; /* Sequence number valid */ 452 int delay; /* Delay */ 453 int delay_valid; /* Delay valid */ 454 bcm_sat_ctf_t ctf_id; /* SAT CTF id */ 455 } bcm_sat_report_event_data_t; 456 457 /* Initialize a SAT header user define offset structure */ 458 extern void bcm_sat_header_user_define_offsets_t_init( 459 bcm_sat_header_user_define_offsets_t *offsets); 460 461 /* Initialize a SAT payload structure */ 462 extern void bcm_sat_payload_t_init( 463 bcm_sat_payload_t *payload); 464 465 /* Initialize a SAT config structure */ 466 extern void bcm_sat_config_t_init( 467 bcm_sat_config_t *conf); 468 469 /* Initialize a SAT stamp structure */ 470 extern void bcm_sat_stamp_t_init( 471 bcm_sat_stamp_t *stamp); 472 473 /* Initialize a SAT GTF packet edit structure */ 474 extern void bcm_sat_gtf_packet_edit_t_init( 475 bcm_sat_gtf_packet_edit_t *packet_edit); 476 477 /* Initialize a SAT GTF packet config structure */ 478 extern void bcm_sat_gtf_packet_config_t_init( 479 bcm_sat_gtf_packet_config_t *pkt_cfg); 480 481 /* Initialize a SAT GTF bandwidth structure */ 482 extern void bcm_sat_gtf_bandwidth_t_init( 483 bcm_sat_gtf_bandwidth_t *bw); 484 485 /* Initialize a SAT GTF rate pattern structure */ 486 extern void bcm_sat_gtf_rate_pattern_t_init( 487 bcm_sat_gtf_rate_pattern_t *rate_pattern); 488 489 /* Initialize a SAT endpoint structure */ 490 extern void bcm_sat_endpoint_info_t_init( 491 bcm_sat_endpoint_info_t *endpoint_info); 492 493 #ifndef BCM_HIDE_DISPATCHABLE 494 495 /* Set common configuration */ 496 extern int bcm_sat_config_set( 497 int unit, 498 bcm_sat_config_t *conf); 499 500 /* Get common configuration */ 501 extern int bcm_sat_config_get( 502 int unit, 503 bcm_sat_config_t *conf); 504 505 /* Create a gtf object */ 506 extern int bcm_sat_gtf_create( 507 int unit, 508 uint32 flags, 509 bcm_sat_gtf_t *gtf_id); 510 511 /* Destroy a gtf object */ 512 extern int bcm_sat_gtf_destroy( 513 int unit, 514 bcm_sat_gtf_t gtf_id); 515 516 /* Destroy all gtf objects. */ 517 extern int bcm_sat_gtf_destroy_all( 518 int unit); 519 520 #endif /* BCM_HIDE_DISPATCHABLE */ 521 522 /* Gtf callback function prototype. */ 523 typedef int (*bcm_sat_gtf_traverse_cb)( 524 int unit, 525 bcm_sat_gtf_t gtf_id, 526 void *user_data); 527 528 #ifndef BCM_HIDE_DISPATCHABLE 529 530 /* Traverse all the gtfs, calling a specified callback for each one */ 531 extern int bcm_sat_gtf_traverse( 532 int unit, 533 bcm_sat_gtf_traverse_cb cb, 534 void *user_data); 535 536 /* Set gtf packet format */ 537 extern int bcm_sat_gtf_packet_config( 538 int unit, 539 bcm_sat_gtf_t gtf_id, 540 bcm_sat_gtf_packet_config_t *config); 541 542 /* Set gtf packet format */ 543 extern int bcm_sat_gtf_packet_config_set( 544 int unit, 545 bcm_sat_gtf_t gtf_id, 546 bcm_sat_gtf_packet_config_t *config); 547 548 /* Set gtf packet format */ 549 extern int bcm_sat_gtf_packet_config_get( 550 int unit, 551 bcm_sat_gtf_t gtf_id, 552 bcm_sat_gtf_packet_config_t *config); 553 554 /* Set gtf bandwidth */ 555 extern int bcm_sat_gtf_bandwidth_set( 556 int unit, 557 bcm_sat_gtf_t gtf_id, 558 int priority, 559 bcm_sat_gtf_bandwidth_t *bw); 560 561 /* Get gtf bandwidth */ 562 extern int bcm_sat_gtf_bandwidth_get( 563 int unit, 564 bcm_sat_gtf_t gtf_id, 565 int priority, 566 bcm_sat_gtf_bandwidth_t *bw); 567 568 /* Set gtf rate pattern */ 569 extern int bcm_sat_gtf_rate_pattern_set( 570 int unit, 571 bcm_sat_gtf_t gtf_id, 572 int priority, 573 bcm_sat_gtf_rate_pattern_t *config); 574 575 /* Get gtf rate pattern */ 576 extern int bcm_sat_gtf_rate_pattern_get( 577 int unit, 578 bcm_sat_gtf_t gtf_id, 579 int priority, 580 bcm_sat_gtf_rate_pattern_t *config); 581 582 /* Start gtf packet generation */ 583 extern int bcm_sat_gtf_packet_start( 584 int unit, 585 bcm_sat_gtf_t gtf_id, 586 bcm_sat_gtf_pri_t priority); 587 588 /* Stop gtf packet generation */ 589 extern int bcm_sat_gtf_packet_stop( 590 int unit, 591 bcm_sat_gtf_t gtf_id, 592 bcm_sat_gtf_pri_t priority); 593 594 /* Get gtf stats */ 595 extern int bcm_sat_gtf_stat_get( 596 int unit, 597 bcm_sat_gtf_t gtf_id, 598 int priority, 599 uint32 flags, 600 bcm_sat_gtf_stat_counter_t type, 601 uint64 *value); 602 603 /* Get gtf stats */ 604 extern int bcm_sat_gtf_stat_multi_get( 605 int unit, 606 bcm_sat_gtf_t gtf_id, 607 bcm_sat_gtf_stat_multi_t *stat); 608 609 /* Create a ctf object */ 610 extern int bcm_sat_ctf_create( 611 int unit, 612 uint32 flags, 613 bcm_sat_ctf_t *ctf_id); 614 615 /* Destroy a ctf object */ 616 extern int bcm_sat_ctf_destroy( 617 int unit, 618 bcm_sat_ctf_t ctf_id); 619 620 /* Destroy all ctf objects */ 621 extern int bcm_sat_ctf_destroy_all( 622 int unit); 623 624 #endif /* BCM_HIDE_DISPATCHABLE */ 625 626 /* Ctf callback function prototype. */ 627 typedef int (*bcm_sat_ctf_traverse_cb)( 628 int unit, 629 bcm_sat_ctf_t ctf_id, 630 void *user_data); 631 632 #ifndef BCM_HIDE_DISPATCHABLE 633 634 /* Traverse all the ctfs, calling a specified callback for each one */ 635 extern int bcm_sat_ctf_traverse( 636 int unit, 637 bcm_sat_ctf_traverse_cb cb, 638 void *user_data); 639 640 /* Set ctf packet format */ 641 extern int bcm_sat_ctf_packet_config( 642 int unit, 643 bcm_sat_ctf_t ctf_id, 644 bcm_sat_ctf_packet_info_t *packet_info); 645 646 #endif /* BCM_HIDE_DISPATCHABLE */ 647 648 /* Initialize a SAT CTF packet info structure */ 649 extern void bcm_sat_ctf_packet_info_t_init( 650 bcm_sat_ctf_packet_info_t *packet_info); 651 652 /* Initialize a SAT identifier structure */ 653 extern void bcm_sat_ctf_identifier_t_init( 654 bcm_sat_ctf_identifier_t *identifier); 655 656 /* Initialize a SAT CTF bin limit structure */ 657 extern void bcm_sat_ctf_bin_limit_t_init( 658 bcm_sat_ctf_bin_limit_t *bins); 659 660 /* Initialize a SAT CTF stat config structure */ 661 extern void bcm_sat_ctf_stat_config_t_init( 662 bcm_sat_ctf_stat_config_t *stat_cfg); 663 664 /* Initialize a SAT CTF sat structure */ 665 extern void bcm_sat_ctf_stat_t_init( 666 bcm_sat_ctf_stat_t *stat); 667 668 /* Initialize a SAT CTF availability config structure */ 669 extern void bcm_sat_ctf_availability_config_t_init( 670 bcm_sat_ctf_availability_config_t *config); 671 672 /* Initialize a SAT CTF report config structure */ 673 extern void bcm_sat_ctf_report_config_t_init( 674 bcm_sat_ctf_report_config_t *reports); 675 676 #ifndef BCM_HIDE_DISPATCHABLE 677 678 /* Map identifier to ctf */ 679 extern int bcm_sat_ctf_identifier_map( 680 int unit, 681 bcm_sat_ctf_identifier_t *identifier, 682 bcm_sat_ctf_t ctf_id); 683 684 /* Unmap identifier to ctf */ 685 extern int bcm_sat_ctf_identifier_unmap( 686 int unit, 687 bcm_sat_ctf_identifier_t *identifier); 688 689 /* Add specific trap ID */ 690 extern int bcm_sat_ctf_trap_add( 691 int unit, 692 uint32 trap_id); 693 694 /* Remove specific trap ID */ 695 extern int bcm_sat_ctf_trap_remove( 696 int unit, 697 uint32 trap_id); 698 699 /* Remove all trap IDs */ 700 extern int bcm_sat_ctf_trap_remove_all( 701 int unit); 702 703 /* Set ctf bin limit */ 704 extern int bcm_sat_ctf_bin_limit_set( 705 int unit, 706 int bins_count, 707 bcm_sat_ctf_bin_limit_t *bins); 708 709 /* Get ctf bin limit */ 710 extern int bcm_sat_ctf_bin_limit_get( 711 int unit, 712 int max_bins_count, 713 bcm_sat_ctf_bin_limit_t *bins, 714 int *bins_count); 715 716 /* Configure ctf stat */ 717 extern int bcm_sat_ctf_stat_config_set( 718 int unit, 719 bcm_sat_ctf_t ctf_id, 720 bcm_sat_ctf_stat_config_t *stat); 721 722 /* Get ctf stat */ 723 extern int bcm_sat_ctf_stat_get( 724 int unit, 725 bcm_sat_ctf_t ctf_id, 726 uint32 flags, 727 bcm_sat_ctf_stat_t *stat); 728 729 /* Set ctf availability */ 730 extern int bcm_sat_ctf_availability_config_set( 731 int unit, 732 bcm_sat_ctf_t ctf_id, 733 bcm_sat_ctf_availability_config_t *config); 734 735 /* Map trap data to session ID */ 736 extern int bcm_sat_ctf_trap_data_to_session_map( 737 int unit, 738 uint32 trap_data, 739 uint32 trap_data_mask, 740 uint32 session_id); 741 742 /* Unmap trap data to session ID */ 743 extern int bcm_sat_ctf_trap_data_to_session_unmap( 744 int unit, 745 uint32 trap_data, 746 uint32 trap_data_mask); 747 748 /* Set ctf report */ 749 extern int bcm_sat_ctf_reports_config_set( 750 int unit, 751 bcm_sat_ctf_t ctf_id, 752 bcm_sat_ctf_report_config_t *reports); 753 754 #endif /* BCM_HIDE_DISPATCHABLE */ 755 756 /* Callback function type for SAT event handling */ 757 typedef int (*bcm_sat_event_cb)( 758 int unit, 759 bcm_sat_event_type_t event_type, 760 void *user_provided_struct, 761 void *user_data); 762 763 #ifndef BCM_HIDE_DISPATCHABLE 764 765 /* Register a callback for handling SAT events */ 766 extern int bcm_sat_event_register( 767 int unit, 768 bcm_sat_event_type_t event_type, 769 bcm_sat_event_cb cb, 770 void *user_data); 771 772 /* Unregister a callback for handling SAT events */ 773 extern int bcm_sat_event_unregister( 774 int unit, 775 bcm_sat_event_type_t event_type, 776 bcm_sat_event_cb cb); 777 778 #endif /* BCM_HIDE_DISPATCHABLE */ 779 780 #endif /* __BCM_SAT_H__ */