st_sdk_pack.c (1123B)
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-2019 Broadcom Inc. All rights reserved. 6 * 7 * File: st_sdk_pack.c 8 * Purpose: ST pack and unpack routines for: 9 * - ST Control messages 10 * 11 * This file is shared between SDK and uKernel. 12 */ 13 14 #if defined(INCLUDE_TELEMETRY) 15 #include <shared/pack.h> 16 #include <bcm_int/esw/st_sdk_msg.h> 17 #include <bcm_int/esw/st_sdk_pack.h> 18 19 /* 20 * ST Initialization control message - pack 21 */ 22 uint8* 23 st_sdk_msg_ctrl_init_pack(uint8 *buf, st_sdk_msg_ctrl_init_t *msg) 24 { 25 _SHR_PACK_U32(buf, msg->flags); 26 _SHR_PACK_U32(buf, msg->init_time_u); 27 _SHR_PACK_U32(buf, msg->init_time_l); 28 _SHR_PACK_U16(buf, msg->max_export_pkt_length); 29 _SHR_PACK_U16(buf, msg->num_instances); 30 _SHR_PACK_U16(buf, msg->num_collectors); 31 32 if (ST_UC_FEATURE_CHECK(ST_MAX_NUM_PORTS)) { 33 _SHR_PACK_U16(buf, msg->max_num_ports); 34 } 35 36 return buf; 37 } 38 #else /* INCLUDE_TELEMETRY */ 39 typedef int bcm_int_telemetry_not_emtpy; 40 #endif /* INCLUDE_TELEMETRY */