topo_pkt.h (2115B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 6 * 7 * File: topo_pkt.h 8 * Purpose: 9 */ 10 11 #ifndef _STKTASK_TOPO_PKT_H_ 12 #define _STKTASK_TOPO_PKT_H_ 13 14 #include <sdk_config.h> 15 16 /**************************************************************** 17 * 18 * Topology packet format description 19 * 20 * See topology.txt for more information. 21 */ 22 23 #define TOPO_PKT_VERSION 0 24 25 /* These are relative to start of topo packet, post CPUTRANS header */ 26 #define TOPO_VER_OFS 0 27 #define TOPO_RSVD_OFS (TOPO_VER_OFS + sizeof(uint32)) 28 #define TOPO_MSEQ_NUM_OFS (TOPO_RSVD_OFS + sizeof(uint32)) 29 #define TOPO_BASE_LEN_OFS (TOPO_MSEQ_NUM_OFS + sizeof(uint32)) 30 #define TOPO_FLAGS_OFS (TOPO_BASE_LEN_OFS + sizeof(uint32)) 31 #define TOPO_MOD_IDS_OFS (TOPO_FLAGS_OFS + sizeof(uint32)) 32 #define TOPO_HEADER_BYTES(_units) \ 33 (TOPO_MOD_IDS_OFS + (_units) * sizeof(uint32)) 34 #define TOPO_CMP_START_OFS TOPO_MOD_IDS_OFS 35 36 #ifndef TOPO_PKT_BYTES_MAX 37 #define TOPO_PKT_BYTES_MAX (1500) /* Max supported topo pkt size */ 38 #endif 39 40 #define BCM_ST_TOPO_CLIENT_ID SHARED_CLIENT_ID_TOPOLOGY 41 42 /* Topo packet and stack task related API functions */ 43 44 extern int topo_pkt_handle_init(uint32 topo_atp_flags); 45 extern int topo_pkt_expect_set(int enable); 46 extern int bcm_stack_topo_update(cpudb_ref_t db_ref); 47 extern int bcm_stack_topo_create(cpudb_ref_t db_ref, topo_cpu_t *tp_cpu); 48 49 extern int topo_pkt_gen( 50 cpudb_ref_t db_ref, 51 cpudb_entry_t *entry, 52 uint8 *pkt_data, 53 int len, 54 int *packed_bytes); 55 56 extern int topo_pkt_parse( 57 cpudb_ref_t db_ref, 58 cpudb_entry_t *entry, 59 uint8 *topo_data, 60 int len, 61 topo_cpu_t *tp_cpu, 62 int *ap_data_ofs); 63 64 extern int topo_delay_set(int delay_us); 65 extern int topo_delay_get(int *delay_us); 66 67 extern int topo_master_delay_set(int delay_us); 68 extern int topo_master_delay_get(int *delay_us); 69 70 #endif /* _STKTASK_TOPO_PKT_H_ */