blob: 9149da24e79229a137501e4053cb718c9b081e47 [file] [log] [blame]
Andrew Jeffery9c766792022-08-10 23:12:49 +09301#ifndef PLATFORM_H
2#define PLATFORM_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stddef.h>
9#include <stdint.h>
10
11#include "base.h"
12#include "pdr.h"
Manojkiran Eda9a8e4972022-11-28 16:38:21 +053013#include "pldm_types.h"
Andrew Jeffery9c766792022-08-10 23:12:49 +093014
15/* Maximum size for request */
16#define PLDM_SET_STATE_EFFECTER_STATES_REQ_BYTES 19
17#define PLDM_GET_STATE_SENSOR_READINGS_REQ_BYTES 4
18#define PLDM_GET_NUMERIC_EFFECTER_VALUE_REQ_BYTES 2
19#define PLDM_GET_SENSOR_READING_REQ_BYTES 3
20#define PLDM_SET_EVENT_RECEIVER_REQ_BYTES 5
21/* Response lengths are inclusive of completion code */
22#define PLDM_SET_STATE_EFFECTER_STATES_RESP_BYTES 1
23
24#define PLDM_SET_NUMERIC_EFFECTER_VALUE_RESP_BYTES 1
25#define PLDM_SET_NUMERIC_EFFECTER_VALUE_MIN_REQ_BYTES 4
26
27#define PLDM_GET_PDR_REQ_BYTES 13
28
29#define PLDM_SET_EVENT_RECEIVER_RESP_BYTES 1
Dung Caod6ae8982022-11-02 10:00:10 +070030
31/* Platform event supported request */
32#define PLDM_EVENT_MESSAGE_BUFFER_SIZE_REQ_BYTES 2
33#define PLDM_EVENT_MESSAGE_BUFFER_SIZE_RESP_BYTES 3
34
Dung Cao1bf8c872022-11-29 05:32:58 +070035#define PLDM_EVENT_MESSAGE_SUPPORTED_REQ_BYTES 1
36#define PLDM_EVENT_MESSAGE_SUPPORTED_MIN_RESP_BYTES 4
37
Thu Nguyen159a98b2022-11-02 10:00:10 +070038#define PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_REQ_BYTES 8
39#define PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_MIN_RESP_BYTES 4
Thu Nguyen8eb20f22022-11-16 22:34:55 +070040#define PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_RESP_BYTES 14
41#define PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_CHECKSUM_BYTES 4
Thu Nguyen159a98b2022-11-02 10:00:10 +070042
Andrew Jeffery9c766792022-08-10 23:12:49 +093043/* Minimum response length */
44#define PLDM_GET_PDR_MIN_RESP_BYTES 12
45#define PLDM_GET_NUMERIC_EFFECTER_VALUE_MIN_RESP_BYTES 5
46#define PLDM_GET_SENSOR_READING_MIN_RESP_BYTES 8
47#define PLDM_GET_STATE_SENSOR_READINGS_MIN_RESP_BYTES 2
48#define PLDM_GET_PDR_REPOSITORY_INFO_RESP_BYTES 41
49
50/* Minimum length for PLDM PlatformEventMessage request */
51#define PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES 3
52#define PLDM_PLATFORM_EVENT_MESSAGE_STATE_SENSOR_STATE_REQ_BYTES 6
53#define PLDM_PLATFORM_EVENT_MESSAGE_RESP_BYTES 2
54#define PLDM_PLATFORM_EVENT_MESSAGE_FORMAT_VERSION 1
55
56/* Minumum length of senson event data */
57#define PLDM_SENSOR_EVENT_DATA_MIN_LENGTH 5
58#define PLDM_SENSOR_EVENT_SENSOR_OP_STATE_DATA_LENGTH 2
59#define PLDM_SENSOR_EVENT_STATE_SENSOR_STATE_DATA_LENGTH 3
60#define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_MIN_DATA_LENGTH 4
61#define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_MAX_DATA_LENGTH 7
62#define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_8BIT_DATA_LENGTH 4
63#define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_16BIT_DATA_LENGTH 5
64#define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_32BIT_DATA_LENGTH 7
65
66/* Minimum length of data for pldmPDRRepositoryChgEvent */
67#define PLDM_PDR_REPOSITORY_CHG_EVENT_MIN_LENGTH 2
68#define PLDM_PDR_REPOSITORY_CHANGE_RECORD_MIN_LENGTH 2
69
Andrew Jeffery7992eb82023-04-06 16:13:53 +093070/* Minimum length of numeric sensor PDR */
71#define PLDM_PDR_NUMERIC_SENSOR_PDR_FIXED_LENGTH 57
72#define PLDM_PDR_NUMERIC_SENSOR_PDR_VARIED_SENSOR_DATA_SIZE_MIN_LENGTH 3
73#define PLDM_PDR_NUMERIC_SENSOR_PDR_VARIED_RANGE_FIELD_MIN_LENGTH 9
74#define PLDM_PDR_NUMERIC_SENSOR_PDR_MIN_LENGTH \
75 (PLDM_PDR_NUMERIC_SENSOR_PDR_FIXED_LENGTH + \
76 PLDM_PDR_NUMERIC_SENSOR_PDR_VARIED_SENSOR_DATA_SIZE_MIN_LENGTH + \
77 PLDM_PDR_NUMERIC_SENSOR_PDR_VARIED_RANGE_FIELD_MIN_LENGTH)
78
Andrew Jeffery9c766792022-08-10 23:12:49 +093079#define PLDM_INVALID_EFFECTER_ID 0xFFFF
80#define PLDM_TID_RESERVED 0xFF
81
Andrew Jeffery7992eb82023-04-06 16:13:53 +093082/* DSP0248 Table1 PLDM monitoring and control data types */
83#define PLDM_STR_UTF_8_MAX_LEN 256
84#define PLDM_STR_UTF_16_MAX_LEN 256
85
Andrew Jeffery9c766792022-08-10 23:12:49 +093086enum pldm_effecter_data_size {
87 PLDM_EFFECTER_DATA_SIZE_UINT8,
88 PLDM_EFFECTER_DATA_SIZE_SINT8,
89 PLDM_EFFECTER_DATA_SIZE_UINT16,
90 PLDM_EFFECTER_DATA_SIZE_SINT16,
91 PLDM_EFFECTER_DATA_SIZE_UINT32,
92 PLDM_EFFECTER_DATA_SIZE_SINT32
93};
94
95enum pldm_range_field_format {
96 PLDM_RANGE_FIELD_FORMAT_UINT8,
97 PLDM_RANGE_FIELD_FORMAT_SINT8,
98 PLDM_RANGE_FIELD_FORMAT_UINT16,
99 PLDM_RANGE_FIELD_FORMAT_SINT16,
100 PLDM_RANGE_FIELD_FORMAT_UINT32,
101 PLDM_RANGE_FIELD_FORMAT_SINT32,
102 PLDM_RANGE_FIELD_FORMAT_REAL32
103};
Andrew Jeffery7992eb82023-04-06 16:13:53 +0930104#define PLDM_RANGE_FIELD_FORMAT_MAX PLDM_RANGE_FIELD_FORMAT_REAL32
Andrew Jeffery9c766792022-08-10 23:12:49 +0930105
106enum set_request { PLDM_NO_CHANGE = 0x00, PLDM_REQUEST_SET = 0x01 };
107
108enum effecter_state { PLDM_INVALID_VALUE = 0xFF };
109
110enum pldm_sensor_present_state {
111 PLDM_SENSOR_UNKNOWN = 0x0,
112 PLDM_SENSOR_NORMAL = 0x01,
113 PLDM_SENSOR_WARNING = 0x02,
114 PLDM_SENSOR_CRITICAL = 0x03,
115 PLDM_SENSOR_FATAL = 0x04,
116 PLDM_SENSOR_LOWERWARNING = 0x05,
117 PLDM_SENSOR_LOWERCRITICAL = 0x06,
118 PLDM_SENSOR_LOWERFATAL = 0x07,
119 PLDM_SENSOR_UPPERWARNING = 0x08,
120 PLDM_SENSOR_UPPERCRITICAL = 0x09,
121 PLDM_SENSOR_UPPERFATAL = 0x0a
122};
123
124enum pldm_sensor_event_message_enable {
125 PLDM_NO_EVENT_GENERATION,
126 PLDM_EVENTS_DISABLED,
127 PLDM_EVENTS_ENABLED,
128 PLDM_OP_EVENTS_ONLY_ENABLED,
129 PLDM_STATE_EVENTS_ONLY_ENABLED
130};
131
132enum pldm_effecter_oper_state {
133 EFFECTER_OPER_STATE_ENABLED_UPDATEPENDING,
134 EFFECTER_OPER_STATE_ENABLED_NOUPDATEPENDING,
135 EFFECTER_OPER_STATE_DISABLED,
136 EFFECTER_OPER_STATE_UNAVAILABLE,
137 EFFECTER_OPER_STATE_STATUSUNKNOWN,
138 EFFECTER_OPER_STATE_FAILED,
139 EFFECTER_OPER_STATE_INITIALIZING,
140 EFFECTER_OPER_STATE_SHUTTINGDOWN,
141 EFFECTER_OPER_STATE_INTEST
142};
143
144enum pldm_platform_commands {
145 PLDM_SET_EVENT_RECEIVER = 0x04,
Dung Caod6ae8982022-11-02 10:00:10 +0700146 PLDM_PLATFORM_EVENT_MESSAGE = 0x0A,
Thu Nguyen159a98b2022-11-02 10:00:10 +0700147 PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE = 0x0B,
Dung Cao1bf8c872022-11-29 05:32:58 +0700148 PLDM_EVENT_MESSAGE_SUPPORTED = 0x0C,
149 PLDM_EVENT_MESSAGE_BUFFER_SIZE = 0x0D,
Andrew Jeffery9c766792022-08-10 23:12:49 +0930150 PLDM_GET_SENSOR_READING = 0x11,
151 PLDM_GET_STATE_SENSOR_READINGS = 0x21,
152 PLDM_SET_NUMERIC_EFFECTER_VALUE = 0x31,
153 PLDM_GET_NUMERIC_EFFECTER_VALUE = 0x32,
154 PLDM_SET_STATE_EFFECTER_STATES = 0x39,
155 PLDM_GET_PDR_REPOSITORY_INFO = 0x50,
156 PLDM_GET_PDR = 0x51,
Andrew Jeffery9c766792022-08-10 23:12:49 +0930157};
158
159/** @brief PLDM PDR types
160 */
161enum pldm_pdr_types {
162 PLDM_TERMINUS_LOCATOR_PDR = 1,
163 PLDM_NUMERIC_SENSOR_PDR = 2,
164 PLDM_NUMERIC_SENSOR_INITIALIZATION_PDR = 3,
165 PLDM_STATE_SENSOR_PDR = 4,
166 PLDM_STATE_SENSOR_INITIALIZATION_PDR = 5,
167 PLDM_SENSOR_AUXILIARY_NAMES_PDR = 6,
168 PLDM_OEM_UNIT_PDR = 7,
169 PLDM_OEM_STATE_SET_PDR = 8,
170 PLDM_NUMERIC_EFFECTER_PDR = 9,
171 PLDM_NUMERIC_EFFECTER_INITIALIZATION_PDR = 10,
172 PLDM_STATE_EFFECTER_PDR = 11,
173 PLDM_STATE_EFFECTER_INITIALIZATION_PDR = 12,
174 PLDM_EFFECTER_AUXILIARY_NAMES_PDR = 13,
175 PLDM_EFFECTER_OEM_SEMANTIC_PDR = 14,
176 PLDM_PDR_ENTITY_ASSOCIATION = 15,
177 PLDM_ENTITY_AUXILIARY_NAMES_PDR = 16,
178 PLDM_OEM_ENTITY_ID_PDR = 17,
179 PLDM_INTERRUPT_ASSOCIATION_PDR = 18,
180 PLDM_EVENT_LOG_PDR = 19,
181 PLDM_PDR_FRU_RECORD_SET = 20,
Thu Nguyen02476112022-11-02 09:52:54 +0700182 PLDM_COMPACT_NUMERIC_SENSOR_PDR = 21,
Andrew Jeffery9c766792022-08-10 23:12:49 +0930183 PLDM_OEM_DEVICE_PDR = 126,
184 PLDM_OEM_PDR = 127,
185};
186
187/** @brief PLDM effecter initialization schemes
188 */
189enum pldm_effecter_init {
190 PLDM_NO_INIT,
191 PLDM_USE_INIT_PDR,
192 PLDM_ENABLE_EFFECTER,
193 PLDM_DISABLE_EFECTER
194};
195
196/** @brief PLDM Platform M&C completion codes
197 */
198enum pldm_platform_completion_codes {
199 PLDM_PLATFORM_INVALID_SENSOR_ID = 0x80,
200 PLDM_PLATFORM_REARM_UNAVAILABLE_IN_PRESENT_STATE = 0x81,
201
202 PLDM_PLATFORM_INVALID_EFFECTER_ID = 0x80,
203 PLDM_PLATFORM_INVALID_STATE_VALUE = 0x81,
204
205 PLDM_PLATFORM_INVALID_DATA_TRANSFER_HANDLE = 0x80,
206 PLDM_PLATFORM_INVALID_TRANSFER_OPERATION_FLAG = 0x81,
207 PLDM_PLATFORM_INVALID_RECORD_HANDLE = 0x82,
208 PLDM_PLATFORM_INVALID_RECORD_CHANGE_NUMBER = 0x83,
209 PLDM_PLATFORM_TRANSFER_TIMEOUT = 0x84,
210
211 PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE = 0x82,
212
213 PLDM_PLATFORM_INVALID_PROTOCOL_TYPE = 0x80,
214 PLDM_PLATFORM_ENABLE_METHOD_NOT_SUPPORTED = 0x81,
215 PLDM_PLATFORM_HEARTBEAT_FREQUENCY_TOO_HIGH = 0x82,
216};
217
218/** @brief PLDM Event types
219 */
220enum pldm_event_types {
221 PLDM_SENSOR_EVENT = 0x00,
222 PLDM_EFFECTER_EVENT = 0x01,
223 PLDM_REDFISH_TASK_EXECUTED_EVENT = 0x02,
224 PLDM_REDFISH_MESSAGE_EVENT = 0x03,
225 PLDM_PDR_REPOSITORY_CHG_EVENT = 0x04,
226 PLDM_MESSAGE_POLL_EVENT = 0x05,
227 PLDM_HEARTBEAT_TIMER_ELAPSED_EVENT = 0x06
228};
229
230/** @brief PLDM sensorEventClass states
231 */
232enum sensor_event_class_states {
233 PLDM_SENSOR_OP_STATE,
234 PLDM_STATE_SENSOR_STATE,
235 PLDM_NUMERIC_SENSOR_STATE
236};
237
238/** @brief PLDM sensor supported states
239 */
240enum pldm_sensor_operational_state {
241 PLDM_SENSOR_ENABLED,
242 PLDM_SENSOR_DISABLED,
243 PLDM_SENSOR_UNAVAILABLE,
244 PLDM_SENSOR_STATUSUNKOWN,
245 PLDM_SENSOR_FAILED,
246 PLDM_SENSOR_INITIALIZING,
247 PLDM_SENSOR_SHUTTINGDOWN,
248 PLDM_SENSOR_INTEST
249};
250
251/** @brief PLDM pldmPDRRepositoryChgEvent class eventData format
252 */
253enum pldm_pdr_repository_chg_event_data_format {
254 REFRESH_ENTIRE_REPOSITORY,
255 FORMAT_IS_PDR_TYPES,
256 FORMAT_IS_PDR_HANDLES
257};
258
259/** @brief PLDM pldmPDRRepositoryChgEvent class changeRecord format
260 * eventDataOperation
261 */
262enum pldm_pdr_repository_chg_event_change_record_event_data_operation {
263 PLDM_REFRESH_ALL_RECORDS,
264 PLDM_RECORDS_DELETED,
265 PLDM_RECORDS_ADDED,
266 PLDM_RECORDS_MODIFIED
267};
268
269/** @brief PLDM NumericSensorStatePresentReading data type
270 */
271enum pldm_sensor_readings_data_type {
272 PLDM_SENSOR_DATA_SIZE_UINT8,
273 PLDM_SENSOR_DATA_SIZE_SINT8,
274 PLDM_SENSOR_DATA_SIZE_UINT16,
275 PLDM_SENSOR_DATA_SIZE_SINT16,
276 PLDM_SENSOR_DATA_SIZE_UINT32,
277 PLDM_SENSOR_DATA_SIZE_SINT32
278};
Andrew Jeffery7992eb82023-04-06 16:13:53 +0930279#define PLDM_SENSOR_DATA_SIZE_MAX PLDM_SENSOR_DATA_SIZE_SINT32
Andrew Jeffery9c766792022-08-10 23:12:49 +0930280
281/** @brief PLDM PlatformEventMessage response status
282 */
283enum pldm_platform_event_status {
284 PLDM_EVENT_NO_LOGGING = 0x00,
285 PLDM_EVENT_LOGGING_DISABLED = 0x01,
286 PLDM_EVENT_LOG_FULL = 0x02,
287 PLDM_EVENT_ACCEPTED_FOR_LOGGING = 0x03,
288 PLDM_EVENT_LOGGED = 0x04,
289 PLDM_EVENT_LOGGING_REJECTED = 0x05
290};
291
292/** @brief PLDM Terminus Locator PDR validity
293 */
294enum pldm_terminus_locator_pdr_validity {
295 PLDM_TL_PDR_NOT_VALID,
296 PLDM_TL_PDR_VALID
297};
298
299/** @brief PLDM Terminus Locator type
300 */
301enum pldm_terminus_locator_type {
302 PLDM_TERMINUS_LOCATOR_TYPE_UID,
303 PLDM_TERMINUS_LOCATOR_TYPE_MCTP_EID,
304 PLDM_TERMINUS_LOCATOR_TYPE_SMBUS_RELATIVE,
305 PLDM_TERMINUS_LOCATOR_TYPE_SYS_SW
306};
307
308/** @brief PLDM event message global enable for
309 * SetEventReceiver command
310 */
311enum pldm_event_message_global_enable {
312 PLDM_EVENT_MESSAGE_GLOBAL_DISABLE,
313 PLDM_EVENT_MESSAGE_GLOBAL_ENABLE_ASYNC,
314 PLDM_EVENT_MESSAGE_GLOBAL_ENABLE_POLLING,
315 PLDM_EVENT_MESSAGE_GLOBAL_ENABLE_ASYNC_KEEP_ALIVE
316};
317
Thu Nguyen02476112022-11-02 09:52:54 +0700318/** @brief PLDM DSP0248 1.2.1 table 74 sensorUnits enumeration
319 */
320enum pldm_sensor_units {
321 PLDM_SENSOR_UNIT_NONE = 0x00,
322 PLDM_SENSOR_UNIT_UNSPECIFIED,
323 PLDM_SENSOR_UNIT_DEGRESS_C,
324 PLDM_SENSOR_UNIT_DEGRESS_F,
325 PLDM_SENSOR_UNIT_KELVINS,
326 PLDM_SENSOR_UNIT_VOLTS,
327 PLDM_SENSOR_UNIT_AMPS,
328 PLDM_SENSOR_UNIT_WATTS,
329 PLDM_SENSOR_UNIT_JOULES,
330 PLDM_SENSOR_UNIT_COULOMBS,
331 PLDM_SENSOR_UNIT_VA,
332 PLDM_SENSOR_UNIT_NITS,
333 PLDM_SENSOR_UNIT_LUMENS,
334 PLDM_SENSOR_UNIT_LUX,
335 PLDM_SENSOR_UNIT_CANDELAS,
336 PLDM_SENSOR_UNIT_KPA,
337 PLDM_SENSOR_UNIT_PSI,
338 PLDM_SENSOR_UNIT_NEWTONS,
339 PLDM_SENSOR_UNIT_CFM,
340 PLDM_SENSOR_UNIT_RPM,
341 PLDM_SENSOR_UNIT_HERTZ,
342 PLDM_SENSOR_UNIT_SECONDS,
343 PLDM_SENSOR_UNIT_MINUTES,
344 PLDM_SENSOR_UNIT_HOURS,
345 PLDM_SENSOR_UNIT_DAYS,
346 PLDM_SENSOR_UNIT_WEEKS,
347 PLDM_SENSOR_UNIT_MILS,
348 PLDM_SENSOR_UNIT_INCHES,
349 PLDM_SENSOR_UNIT_FEET,
350 PLDM_SENSOR_UNIT_CUBIC_INCHES,
351 PLDM_SENSOR_UNIT_CUBIC_FEET,
352 PLDM_SENSOR_UNIT_METERS,
353 PLDM_SENSOR_UNIT_CUBIC_CENTERMETERS,
354 PLDM_SENSOR_UNIT_CUBIC_METERS,
355 PLDM_SENSOR_UNIT_LITERS,
356 PLDM_SENSOR_UNIT_FLUID_OUNCES,
357 PLDM_SENSOR_UNIT_RADIANS,
358 PLDM_SENSOR_UNIT_STERADIANS,
359 PLDM_SENSOR_UNIT_REVOLUTIONS,
360 PLDM_SENSOR_UNIT_CYCLES,
361 PLDM_SENSOR_UNIT_GRAVITIES,
362 PLDM_SENSOR_UNIT_OUNCES,
363 PLDM_SENSOR_UNIT_POUNDS,
364 PLDM_SENSOR_UNIT_FOOT_POUNDS,
365 PLDM_SENSOR_UNIT_OUNCE_INCHES,
366 PLDM_SENSOR_UNIT_GUESS,
367 PLDM_SENSOR_UNIT_GILBERTS,
368 PLDM_SENSOR_UNIT_HENRIES,
369 PLDM_SENSOR_UNIT_FARADS,
370 PLDM_SENSOR_UNIT_OHMS,
371 PLDM_SENSOR_UNIT_SIEMENS,
372 PLDM_SENSOR_UNIT_MOLES,
373 PLDM_SENSOR_UNIT_BECQUERELS,
374 PLDM_SENSOR_UNIT_PPM,
375 PLDM_SENSOR_UNIT_DECIBELS,
376 PLDM_SENSOR_UNIT_DBA,
377 PLDM_SENSOR_UNIT_DBC,
378 PLDM_SENSOR_UNIT_GRAYS,
379 PLDM_SENSOR_UNIT_SIEVERTS,
380 PLDM_SENSOR_UNIT_COLOR_TEMPERATURE_DEGRESS_K,
381 PLDM_SENSOR_UNIT_BITS,
382 PLDM_SENSOR_UNIT_BYTES,
383 PLDM_SENSOR_UNIT_WORDS,
384 PLDM_SENSOR_UNIT_DOUBLE_WORDS,
385 PLDM_SENSOR_UNIT_QUAD_WORDS,
386 PLDM_SENSOR_UNIT_PERCENTAGE,
387 PLDM_SENSOR_UNIT_PASCALS,
388 PLDM_SENSOR_UNIT_COUNTS,
389 PLDM_SENSOR_UNIT_GRAMS,
390 PLDM_SENSOR_UNIT_NEWTON_METERS,
391 PLDM_SENSOR_UNIT_HITS,
392 PLDM_SENSOR_UNIT_MISSES,
393 PLDM_SENSOR_UNIT_RETRIES,
394 PLDM_SENSOR_UNIT_OVERRUNS_OVERFLOWS,
395 PLDM_SENSOR_UNIT_UNDERRUNS,
396 PLDM_SENSOR_UNIT_COLLISIONS,
397 PLDM_SENSOR_UNIT_PACKETS,
398 PLDM_SENSOR_UNIT_MESSAGES,
399 PLDM_SENSOR_UNIT_CHARATERS,
400 PLDM_SENSOR_UNIT_ERRORS,
401 PLDM_SENSOR_UNIT_CORRECTED_ERRORS,
402 PLDM_SENSOR_UNIT_UNCORRECTABLE_ERRORS,
403 PLDM_SENSOR_UNIT_SQUARE_MILS,
404 PLDM_SENSOR_UNIT_SQUARE_INCHES,
405 PLDM_SENSOR_UNIT_SQUARE_FEET,
406 PLDM_SENSOR_UNIT_SQUARE_CENTIMETERS,
407 PLDM_SENSOR_UNIT_SQUARE_METERS,
408 PLDM_SENSOR_UNIT_OEMUNIT = 255
409};
410
411enum pldm_occurrence_rate {
412 PLDM_RATE_UNIT_NONE = 0x0,
413 PLDM_RATE_UNIT_PER_MICRO_SECOND,
414 PLDM_RATE_UNIT_PER_MILLI_SECOND,
415 PLDM_RATE_UNIT_PER_SECOND,
416 PLDM_RATE_UNIT_PER_MINUTE,
Thu Nguyen0970e332023-01-12 13:28:58 +0700417 PLDM_RATE_UNIT_PER_HOUR,
418 PLDM_RATE_UNIT_PER_DAY,
419 PLDM_RATE_UNIT_PER_WEEK,
420 PLDM_RATE_UNIT_PER_MONTH,
421 PLDM_RATE_UNIT_PER_YEAR
Thu Nguyen02476112022-11-02 09:52:54 +0700422};
423
Andrew Jeffery9c766792022-08-10 23:12:49 +0930424/** @brief PLDM respository state */
425enum pldm_repository_state {
426 PLDM_AVAILABLE,
427 PLDM_UPDATE_IN_PROGRESS,
428 PLDM_FAILED
429};
430
431/** @brief PLDM respository data transfer handler timeout */
432enum pldm_repository_data_transfer_handler_timeout {
433 PLDM_NO_TIMEOUT,
434 PLDM_DEFALUT_MINIMUM_TIMEOUT
435};
436
Dung Cao1bf8c872022-11-29 05:32:58 +0700437/** @brief PLDM event message type */
438enum pldm_event_message_type {
439 PLDM_MESSAGE_TYPE_NOT_CONFIGURED = 0x00,
440 PLDM_MESSAGE_TYPE_ASYNCHRONOUS = 0x01,
441 PLDM_MESSAGE_TYPE_SYNCHRONOUS = 0x02,
442 PLDM_MESSAGE_TYPE_ASYNCHRONOUS_WITH_HEARTBEAT = 0x03
443};
444
Andrew Jeffery9c766792022-08-10 23:12:49 +0930445/** @struct pldm_pdr_hdr
446 *
447 * Structure representing PLDM common PDR header
448 */
449struct pldm_pdr_hdr {
450 uint32_t record_handle;
451 uint8_t version;
452 uint8_t type;
453 uint16_t record_change_num;
454 uint16_t length;
455} __attribute__((packed));
456
457/** @struct pldm_terminus_locator_pdr
458 *
459 * Structure representing PLDM terminus locator PDR
460 */
461struct pldm_terminus_locator_pdr {
462 struct pldm_pdr_hdr hdr;
463 uint16_t terminus_handle;
464 uint8_t validity;
465 uint8_t tid;
466 uint16_t container_id;
467 uint8_t terminus_locator_type;
468 uint8_t terminus_locator_value_size;
469 uint8_t terminus_locator_value[1];
470} __attribute__((packed));
471
Andrew Jeffery7992eb82023-04-06 16:13:53 +0930472/** @struct pldm_sensor_auxiliary_names_pdr
473 *
474 * Structure representing PLDM Sensor Auxiliary Names PDR
475 */
476struct pldm_sensor_auxiliary_names_pdr {
477 struct pldm_pdr_hdr hdr;
478 uint16_t terminus_handle;
479 uint16_t sensor_id;
480 uint8_t sensor_count;
481 uint8_t names[1];
482} __attribute__((packed));
483
Andrew Jeffery9c766792022-08-10 23:12:49 +0930484/** @struct pldm_terminus_locator_type_mctp_eid
485 *
486 * Structure representing terminus locator value for
487 * terminus locator type MCTP_EID
488 */
489struct pldm_terminus_locator_type_mctp_eid {
490 uint8_t eid;
491} __attribute__((packed));
492
493/** @struct pldm_pdr_entity_association
494 *
495 * Structure representing PLDM Entity Association PDR
496 */
497struct pldm_pdr_entity_association {
498 uint16_t container_id;
499 uint8_t association_type;
500 pldm_entity container;
501 uint8_t num_children;
502 pldm_entity children[1];
503} __attribute__((packed));
504
505/** @struct pldm_pdr_fru_record_set
506 *
507 * Structure representing PLDM FRU record set PDR
508 */
509struct pldm_pdr_fru_record_set {
510 uint16_t terminus_handle;
511 uint16_t fru_rsi;
512 uint16_t entity_type;
513 uint16_t entity_instance_num;
514 uint16_t container_id;
515} __attribute__((packed));
516
517/** @struct pldm_state_sensor_pdr
518 *
519 * Structure representing PLDM state sensor PDR
520 */
521struct pldm_state_sensor_pdr {
522 struct pldm_pdr_hdr hdr;
523 uint16_t terminus_handle;
524 uint16_t sensor_id;
525 uint16_t entity_type;
526 uint16_t entity_instance;
527 uint16_t container_id;
528 uint8_t sensor_init;
529 bool8_t sensor_auxiliary_names_pdr;
530 uint8_t composite_sensor_count;
531 uint8_t possible_states[1];
532} __attribute__((packed));
533
534/** @struct state_sensor_possible_states
535 *
536 * Structure representing state enums for state sensor
537 */
538struct state_sensor_possible_states {
539 uint16_t state_set_id;
540 uint8_t possible_states_size;
541 bitfield8_t states[1];
542} __attribute__((packed));
543
544/** @struct pldm_state_effecter_pdr
545 *
546 * Structure representing PLDM state effecter PDR
547 */
548struct pldm_state_effecter_pdr {
549 struct pldm_pdr_hdr hdr;
550 uint16_t terminus_handle;
551 uint16_t effecter_id;
552 uint16_t entity_type;
553 uint16_t entity_instance;
554 uint16_t container_id;
555 uint16_t effecter_semantic_id;
556 uint8_t effecter_init;
557 bool8_t has_description_pdr;
558 uint8_t composite_effecter_count;
559 uint8_t possible_states[1];
560} __attribute__((packed));
561
Thu Nguyend2972ef2023-01-12 13:33:47 +0700562/** @struct pldm_compact_numeric_sensor_pdr
Thu Nguyen02476112022-11-02 09:52:54 +0700563 *
Thu Nguyend2972ef2023-01-12 13:33:47 +0700564 * Structure representing PLDM compact numeric sensor PDR
Thu Nguyen02476112022-11-02 09:52:54 +0700565 */
Thu Nguyend2972ef2023-01-12 13:33:47 +0700566struct pldm_compact_numeric_sensor_pdr {
Thu Nguyen02476112022-11-02 09:52:54 +0700567 struct pldm_pdr_hdr hdr;
568 uint16_t terminus_handle;
569 uint16_t sensor_id;
570 uint16_t entity_type;
571 uint16_t entity_instance;
572 uint16_t container_id;
573 uint8_t sensor_name_length;
574 uint8_t base_unit;
575 int8_t unit_modifier;
576 uint8_t occurrence_rate;
577 bitfield8_t range_field_support;
578 int32_t warning_high;
579 int32_t warning_low;
580 int32_t critical_high;
581 int32_t critical_low;
582 int32_t fatal_high;
583 int32_t fatal_low;
584 uint8_t sensor_name[1];
585} __attribute__((packed));
586
Andrew Jeffery9c766792022-08-10 23:12:49 +0930587/** @brief Encode PLDM state sensor PDR
588 *
589 * @param[in/out] sensor Structure to encode. All members of
590 * sensor, except those mentioned in the @note below, should be initialized by
591 * the caller.
592 * @param[in] allocation_size Size of sensor allocation in bytes
593 * @param[in] possible_states Possible sensor states
594 * @param[in] possible_states_size Size of possible sensor states in bytes
595 * @param[out] actual_size Size of sensor PDR. Set to 0 on error.
596 * @return int pldm_completion_codes
597 * PLDM_SUCCESS/PLDM_ERROR/PLDM_ERROR_INVALID_LENGTH
598 *
599 * @note The sensor parameter will be encoded in place.
600 * @note Caller is responsible for allocation of the sensor parameter. Caller
601 * must allocate enough space for the base structure and the
602 * sensor->possible_states array, otherwise the function will fail.
603 * @note sensor->hdr.length, .type, and .version will be set appropriately.
604 */
605int encode_state_sensor_pdr(
606 struct pldm_state_sensor_pdr *sensor, size_t allocation_size,
607 const struct state_sensor_possible_states *possible_states,
608 size_t possible_states_size, size_t *actual_size);
609
610/** @union union_effecter_data_size
611 *
612 * The bit width and format of reading and threshold values that the effecter
613 * returns.
614 * Refer to: DSP0248_1.2.0: 28.11 Table 87
615 */
616typedef union {
617 uint8_t value_u8;
618 int8_t value_s8;
619 uint16_t value_u16;
620 int16_t value_s16;
621 uint32_t value_u32;
622 int32_t value_s32;
623} union_effecter_data_size;
624
625/** @union union_range_field_format
626 *
627 * Indicates the format used for the nominalValue, normalMax, and normalMin
628 * fields.
629 * Refer to: DSP0248_1.2.0: 28.11 Table 87
630 */
631typedef union {
632 uint8_t value_u8;
633 int8_t value_s8;
634 uint16_t value_u16;
635 int16_t value_s16;
636 uint32_t value_u32;
637 int32_t value_s32;
638 real32_t value_f32;
639} union_range_field_format;
640
641/** @struct pldm_numeric_effecter_value_pdr
642 *
643 * Structure representing PLDM numeric effecter value PDR
644 */
645struct pldm_numeric_effecter_value_pdr {
646 struct pldm_pdr_hdr hdr;
647 uint16_t terminus_handle;
648 uint16_t effecter_id;
649 uint16_t entity_type;
650 uint16_t entity_instance;
651 uint16_t container_id;
652 uint16_t effecter_semantic_id;
653 uint8_t effecter_init;
654 bool8_t effecter_auxiliary_names;
655 uint8_t base_unit;
656 int8_t unit_modifier;
657 uint8_t rate_unit;
658 uint8_t base_oem_unit_handle;
659 uint8_t aux_unit;
660 int8_t aux_unit_modifier;
661 uint8_t aux_rate_unit;
662 uint8_t aux_oem_unit_handle;
663 bool8_t is_linear;
664 uint8_t effecter_data_size;
665 real32_t resolution;
666 real32_t offset;
667 uint16_t accuracy;
668 uint8_t plus_tolerance;
669 uint8_t minus_tolerance;
670 real32_t state_transition_interval;
671 real32_t transition_interval;
672 union_effecter_data_size max_settable;
673 union_effecter_data_size min_settable;
674 uint8_t range_field_format;
675 bitfield8_t range_field_support;
676 union_range_field_format nominal_value;
677 union_range_field_format normal_max;
678 union_range_field_format normal_min;
679 union_range_field_format rated_max;
680 union_range_field_format rated_min;
681} __attribute__((packed));
682
Andrew Jeffery7992eb82023-04-06 16:13:53 +0930683/** @union union_sensor_data_size
684 *
685 * The bit width and format of reading and threshold values that the sensor
686 * returns.
687 * Refer to: DSP0248_1.2.0: 28.4 Table 78
688 */
689typedef union {
690 uint8_t value_u8;
691 int8_t value_s8;
692 uint16_t value_u16;
693 int16_t value_s16;
694 uint32_t value_u32;
695 int32_t value_s32;
696} union_sensor_data_size;
697
698/** @struct pldm_value_pdr_hdr
699 *
700 * Structure representing PLDM PDR header for unpacked value
701 * Refer to: DSP0248_1.2.0: 28.1 Table 75
702 */
703struct pldm_value_pdr_hdr {
704 uint32_t record_handle;
705 uint8_t version;
706 uint8_t type;
707 uint16_t record_change_num;
708 uint16_t length;
709};
710
711/** @struct pldm_numeric_sensor_value_pdr
712 *
713 * Structure representing PLDM Numeric Sensor PDR for unpacked value
714 * Refer to: DSP0248_1.2.0: 28.4 Table 78
715 */
716struct pldm_numeric_sensor_value_pdr {
717 struct pldm_value_pdr_hdr hdr;
718 uint16_t terminus_handle;
719 uint16_t sensor_id;
720 uint16_t entity_type;
721 uint16_t entity_instance_num;
722 uint16_t container_id;
723 uint8_t sensor_init;
724 bool8_t sensor_auxiliary_names_pdr;
725 uint8_t base_unit;
726 int8_t unit_modifier;
727 uint8_t rate_unit;
728 uint8_t base_oem_unit_handle;
729 uint8_t aux_unit;
730 int8_t aux_unit_modifier;
731 uint8_t aux_rate_unit;
732 uint8_t rel;
733 uint8_t aux_oem_unit_handle;
734 bool8_t is_linear;
735 uint8_t sensor_data_size;
736 real32_t resolution;
737 real32_t offset;
738 uint16_t accuracy;
739 uint8_t plus_tolerance;
740 uint8_t minus_tolerance;
741 union_sensor_data_size hysteresis;
742 bitfield8_t supported_thresholds;
743 bitfield8_t threshold_and_hysteresis_volatility;
744 real32_t state_transition_interval;
745 real32_t update_interval;
746 union_sensor_data_size max_readable;
747 union_sensor_data_size min_readable;
748 uint8_t range_field_format;
749 bitfield8_t range_field_support;
750 union_range_field_format nominal_value;
751 union_range_field_format normal_max;
752 union_range_field_format normal_min;
753 union_range_field_format warning_high;
754 union_range_field_format warning_low;
755 union_range_field_format critical_high;
756 union_range_field_format critical_low;
757 union_range_field_format fatal_high;
758 union_range_field_format fatal_low;
759};
760
Andrew Jeffery9c766792022-08-10 23:12:49 +0930761/** @struct state_effecter_possible_states
762 *
763 * Structure representing state enums for state effecter
764 */
765struct state_effecter_possible_states {
766 uint16_t state_set_id;
767 uint8_t possible_states_size;
768 bitfield8_t states[1];
769} __attribute__((packed));
770
Thu Nguyen0585de92022-11-02 09:57:25 +0700771/** @struct pldm_effecter_aux_name_pdr
772 *
773 * Structure representing PLDM aux name numeric effecter value PDR
774 */
775struct pldm_effecter_aux_name_pdr {
776 struct pldm_pdr_hdr hdr;
777 uint16_t terminus_handle;
778 uint16_t effecter_id;
779 uint8_t effecter_count;
780 uint8_t effecter_names[1];
781} __attribute__((packed));
782
Andrew Jeffery9c766792022-08-10 23:12:49 +0930783/** @brief Encode PLDM state effecter PDR
784 *
785 * @param[in/out] effecter Structure to encode. All members of
786 * effecter, except those mentioned in
787 * the @note below, should be initialized
788 * by the caller.
789 * @param[in] allocation_size Size of effecter allocation in bytes
790 * @param[in] possible_states Possible effecter states
791 * @param[in] possible_states_size Size of possible effecter states in
792 * bytes
793 * @param[out] actual_size Size of effecter PDR. Set to 0 on
794 * error.
795 * @return int pldm_completion_codes
796 * PLDM_SUCCESS/PLDM_ERROR/PLDM_ERROR_INVALID_LENGTH
797 *
798 * @note The effecter parameter will be encoded in place.
799 * @note Caller is responsible for allocation of the effecter parameter. Caller
800 * must allocate enough space for the base structure and the
801 * effecter->possible_states array, otherwise the function will fail.
802 * @note effecter->hdr.length, .type, and .version will be set appropriately.
803 */
804int encode_state_effecter_pdr(
805 struct pldm_state_effecter_pdr *effecter, size_t allocation_size,
806 const struct state_effecter_possible_states *possible_states,
807 size_t possible_states_size, size_t *actual_size);
808
809/** @struct set_effecter_state_field
810 *
811 * Structure representing a stateField in SetStateEffecterStates command */
812
813typedef struct state_field_for_state_effecter_set {
814 uint8_t set_request; //!< Whether to change the state
815 uint8_t effecter_state; //!< Expected state of the effecter
816} __attribute__((packed)) set_effecter_state_field;
817
818/** @struct get_sensor_readings_field
819 *
820 * Structure representing a stateField in GetStateSensorReadings command */
821
822typedef struct state_field_for_get_state_sensor_readings {
823 uint8_t sensor_op_state; //!< The state of the sensor itself
824 uint8_t present_state; //!< Return a state value
825 uint8_t previous_state; //!< The state that the presentState was entered
826 //! from. This must be different from the
827 //! present state
828 uint8_t event_state; //!< Return a state value from a PLDM State Set
829 //! that is associated with the sensor
830} __attribute__((packed)) get_sensor_state_field;
831
832/** @struct PLDM_SetStateEffecterStates_Request
833 *
834 * Structure representing PLDM set state effecter states request.
835 */
836struct pldm_set_state_effecter_states_req {
837 uint16_t effecter_id;
838 uint8_t comp_effecter_count;
839 set_effecter_state_field field[8];
840} __attribute__((packed));
841
842/** @struct pldm_get_pdr_repository_info_resp
843 *
844 * Structure representing GetPDRRepositoryInfo response packet
845 */
846struct pldm_pdr_repository_info_resp {
847 uint8_t completion_code;
848 uint8_t repository_state;
849 uint8_t update_time[PLDM_TIMESTAMP104_SIZE];
850 uint8_t oem_update_time[PLDM_TIMESTAMP104_SIZE];
851 uint32_t record_count;
852 uint32_t repository_size;
853 uint32_t largest_record_size;
854 uint8_t data_transfer_handle_timeout;
855} __attribute__((packed));
856
857/** @struct pldm_get_pdr_resp
858 *
859 * structure representing GetPDR response packet
860 * transfer CRC is not part of the structure and will be
861 * added at the end of last packet in multipart transfer
862 */
863struct pldm_get_pdr_resp {
864 uint8_t completion_code;
865 uint32_t next_record_handle;
866 uint32_t next_data_transfer_handle;
867 uint8_t transfer_flag;
868 uint16_t response_count;
869 uint8_t record_data[1];
870} __attribute__((packed));
871
872/** @struct pldm_get_pdr_req
873 *
874 * structure representing GetPDR request packet
875 */
876struct pldm_get_pdr_req {
877 uint32_t record_handle;
878 uint32_t data_transfer_handle;
879 uint8_t transfer_op_flag;
880 uint16_t request_count;
881 uint16_t record_change_number;
882} __attribute__((packed));
883
884/** @struct pldm_set_event_receiver_req
885 *
886 * Structure representing SetEventReceiver command.
887 * This structure applies only for MCTP as a transport type.
888 */
889struct pldm_set_event_receiver_req {
890 uint8_t event_message_global_enable;
891 uint8_t transport_protocol_type;
892 uint8_t event_receiver_address_info;
893 uint16_t heartbeat_timer;
894} __attribute__((packed));
895
Dung Caod6ae8982022-11-02 10:00:10 +0700896/** @struct pldm_event_message_buffer_size_req
897 *
898 * Structure representing EventMessageBufferSizes command request data
899 */
900struct pldm_event_message_buffer_size_req {
901 uint16_t event_receiver_max_buffer_size;
902} __attribute__((packed));
903
904/** @struct pldm_event_message_buffer_size_resp
905 *
906 * Structure representing EventMessageBufferSizes command response data
907 */
908struct pldm_event_message_buffer_size_resp {
909 uint8_t completion_code;
910 uint16_t terminus_max_buffer_size;
911} __attribute__((packed));
912
Dung Cao1bf8c872022-11-29 05:32:58 +0700913/** @struct pldm_platform_event_message_supported_req
914 *
915 * structure representing PlatformEventMessageSupported command request data
916 */
917struct pldm_event_message_supported_req {
918 uint8_t format_version;
919} __attribute__((packed));
920
921/** @struct pldm_event_message_supported_response
922 *
923 * structure representing EventMessageSupported command response data
924 */
925struct pldm_event_message_supported_resp {
926 uint8_t completion_code;
927 uint8_t synchrony_configuration;
928 bitfield8_t synchrony_configuration_supported;
929 uint8_t number_event_class_returned;
930 uint8_t event_class[1];
931} __attribute__((packed));
932
Andrew Jeffery9c766792022-08-10 23:12:49 +0930933/** @struct pldm_set_numeric_effecter_value_req
934 *
935 * structure representing SetNumericEffecterValue request packet
936 */
937struct pldm_set_numeric_effecter_value_req {
938 uint16_t effecter_id;
939 uint8_t effecter_data_size;
940 uint8_t effecter_value[1];
941} __attribute__((packed));
942
943/** @struct pldm_get_state_sensor_readings_req
944 *
945 * Structure representing PLDM get state sensor readings request.
946 */
947struct pldm_get_state_sensor_readings_req {
948 uint16_t sensor_id;
949 bitfield8_t sensor_rearm;
950 uint8_t reserved;
951} __attribute__((packed));
952
953/** @struct pldm_get_state_sensor_readings_resp
954 *
955 * Structure representing PLDM get state sensor readings response.
956 */
957struct pldm_get_state_sensor_readings_resp {
958 uint8_t completion_code;
959 uint8_t comp_sensor_count;
960 get_sensor_state_field field[1];
961} __attribute__((packed));
962
963/** @struct pldm_sensor_event
964 *
965 * structure representing sensorEventClass
966 */
967struct pldm_sensor_event_data {
968 uint16_t sensor_id;
969 uint8_t sensor_event_class_type;
970 uint8_t event_class[1];
971} __attribute__((packed));
972
973/** @struct pldm_state_sensor_state
974 *
975 * structure representing sensorEventClass for stateSensorState
976 */
977struct pldm_sensor_event_state_sensor_state {
978 uint8_t sensor_offset;
979 uint8_t event_state;
980 uint8_t previous_event_state;
981} __attribute__((packed));
982
983/** @struct pldm_sensor_event_numeric_sensor_state
984 *
985 * structure representing sensorEventClass for stateSensorState
986 */
987struct pldm_sensor_event_numeric_sensor_state {
988 uint8_t event_state;
989 uint8_t previous_event_state;
990 uint8_t sensor_data_size;
991 uint8_t present_reading[1];
992} __attribute__((packed));
993
994/** @struct pldm_sensor_event_sensor_op_state
995 *
996 * structure representing sensorEventClass for SensorOpState
997 */
998struct pldm_sensor_event_sensor_op_state {
999 uint8_t present_op_state;
1000 uint8_t previous_op_state;
1001} __attribute__((packed));
1002
1003/** @struct pldm_platform_event_message_req
1004 *
1005 * structure representing PlatformEventMessage command request data
1006 */
1007struct pldm_platform_event_message_req {
1008 uint8_t format_version;
1009 uint8_t tid;
1010 uint8_t event_class;
1011 uint8_t event_data[1];
1012} __attribute__((packed));
1013
Thu Nguyen159a98b2022-11-02 10:00:10 +07001014/** @struct pldm_poll_for_platform_event_message_req
1015 *
1016 * structure representing PollForPlatformEventMessage command request data
1017 */
1018struct pldm_poll_for_platform_event_message_req {
1019 uint8_t format_version;
1020 uint8_t transfer_operation_flag;
1021 uint32_t data_transfer_handle;
1022 uint16_t event_id_to_acknowledge;
1023};
1024
1025/** @struct pldm_poll_for_platform_event_message_min_resp
1026 *
1027 * structure representing PollForPlatformEventMessage command response data
1028 */
1029struct pldm_poll_for_platform_event_message_min_resp {
1030 uint8_t completion_code;
1031 uint8_t tid;
1032 uint16_t event_id;
1033};
1034
Andrew Jeffery9c766792022-08-10 23:12:49 +09301035/** @struct pldm_platform_event_message_response
1036 *
1037 * structure representing PlatformEventMessage command response data
1038 */
1039struct pldm_platform_event_message_resp {
1040 uint8_t completion_code;
1041 uint8_t platform_event_status;
1042} __attribute__((packed));
1043
1044/** @struct pldm_pdr_repository_chg_event_data
1045 *
1046 * structure representing pldmPDRRepositoryChgEvent class eventData
1047 */
1048struct pldm_pdr_repository_chg_event_data {
1049 uint8_t event_data_format;
1050 uint8_t number_of_change_records;
1051 uint8_t change_records[1];
1052} __attribute__((packed));
1053
1054/** @struct pldm_pdr_repository_chg_event_change_record_data
1055 *
1056 * structure representing pldmPDRRepositoryChgEvent class eventData's change
Thu Nguyen159a98b2022-11-02 10:00:10 +07001057 * record data
Andrew Jeffery9c766792022-08-10 23:12:49 +09301058 */
1059struct pldm_pdr_repository_change_record_data {
1060 uint8_t event_data_operation;
1061 uint8_t number_of_change_entries;
1062 uint32_t change_entry[1];
1063} __attribute__((packed));
1064
1065/** @struct pldm_get_numeric_effecter_value_req
1066 *
1067 * structure representing GetNumericEffecterValue request packet
1068 */
1069struct pldm_get_numeric_effecter_value_req {
1070 uint16_t effecter_id;
1071} __attribute__((packed));
1072
1073/** @struct pldm_get_numeric_effecter_value_resp
1074 *
1075 * structure representing GetNumericEffecterValue response packet
1076 */
1077struct pldm_get_numeric_effecter_value_resp {
1078 uint8_t completion_code;
1079 uint8_t effecter_data_size;
1080 uint8_t effecter_oper_state;
1081 uint8_t pending_and_present_values[1];
1082} __attribute__((packed));
1083
1084/** @struct pldm_get_sensor_reading_req
1085 *
1086 * Structure representing PLDM get sensor reading request
1087 */
1088struct pldm_get_sensor_reading_req {
1089 uint16_t sensor_id;
1090 bool8_t rearm_event_state;
1091} __attribute__((packed));
1092
1093/** @struct pldm_get_sensor_reading_resp
1094 *
1095 * Structure representing PLDM get sensor reading response
1096 */
1097struct pldm_get_sensor_reading_resp {
1098 uint8_t completion_code;
1099 uint8_t sensor_data_size;
1100 uint8_t sensor_operational_state;
1101 uint8_t sensor_event_message_enable;
1102 uint8_t present_state;
1103 uint8_t previous_state;
1104 uint8_t event_state;
1105 uint8_t present_reading[1];
1106} __attribute__((packed));
1107
1108/* Responder */
1109
1110/* SetNumericEffecterValue */
1111
1112/** @brief Decode SetNumericEffecterValue request data
1113 *
1114 * @param[in] msg - Request message
1115 * @param[in] payload_length - Length of request message payload
1116 * @param[out] effecter_id - used to identify and access the effecter
1117 * @param[out] effecter_data_size - The bit width and format of the setting
1118 * value for the effecter.
1119 * value:{uint8,sint8,uint16,sint16,uint32,sint32}
1120 * @param[out] effecter_value - The setting value of numeric effecter being
1121 * requested.
1122 * @return pldm_completion_codes
1123 */
1124int decode_set_numeric_effecter_value_req(const struct pldm_msg *msg,
1125 size_t payload_length,
1126 uint16_t *effecter_id,
1127 uint8_t *effecter_data_size,
Andrew Jeffery3884c442023-04-12 11:13:24 +09301128 uint8_t effecter_value[4]);
Andrew Jeffery9c766792022-08-10 23:12:49 +09301129
1130/** @brief Create a PLDM response message for SetNumericEffecterValue
1131 *
1132 * @param[in] instance_id - Message's instance id
1133 * @param[in] completion_code - PLDM completion code
1134 * @param[out] msg - Message will be written to this
1135 * @param[in] payload_length - Length of request message payload
1136 * @return pldm_completion_codes
1137 * @note Caller is responsible for memory alloc and dealloc of param
1138 * 'msg.body.payload'
1139 */
1140int encode_set_numeric_effecter_value_resp(uint8_t instance_id,
1141 uint8_t completion_code,
1142 struct pldm_msg *msg,
1143 size_t payload_length);
1144
1145/* SetStateEffecterStates */
1146
1147/** @brief Create a PLDM response message for SetStateEffecterStates
1148 *
1149 * @param[in] instance_id - Message's instance id
1150 * @param[in] completion_code - PLDM completion code
1151 * @param[out] msg - Message will be written to this
1152 * @return pldm_completion_codes
1153 * @note Caller is responsible for memory alloc and dealloc of param
1154 * 'msg.body.payload'
1155 */
1156
1157int encode_set_state_effecter_states_resp(uint8_t instance_id,
1158 uint8_t completion_code,
1159 struct pldm_msg *msg);
1160
1161/** @brief Decode SetStateEffecterStates request data
1162 *
1163 * @param[in] msg - Request message
1164 * @param[in] payload_length - Length of request message payload
1165 * @param[out] effecter_id - used to identify and access the effecter
1166 * @param[out] comp_effecter_count - number of individual sets of effecter
1167 * information. Upto eight sets of state effecter info can be accessed
1168 * for a given effecter.
1169 * @param[out] field - each unit is an instance of the stateFileld structure
1170 * that is used to set the requested state for a particular effecter
1171 * within the state effecter. This field holds the starting address of
1172 * the stateField values. The user is responsible to allocate the
1173 * memory prior to calling this command. Since the state field count is
1174 * not known in advance, the user should allocate the maximum size
1175 * always, which is 8 in number.
1176 * @return pldm_completion_codes
1177 */
1178
1179int decode_set_state_effecter_states_req(const struct pldm_msg *msg,
1180 size_t payload_length,
1181 uint16_t *effecter_id,
1182 uint8_t *comp_effecter_count,
1183 set_effecter_state_field *field);
1184
1185/* GetPDR */
1186
1187/** @brief Create a PLDM response message for GetPDR
1188 *
1189 * @param[in] instance_id - Message's instance id
1190 * @param[in] completion_code - PLDM completion code
1191 * @param[in] next_record_hndl - The recordHandle for the PDR that is next in
1192 * the PDR Repository
1193 * @param[in] next_data_transfer_hndl - A handle that identifies the next
1194 * portion of the PDR data to be transferred, if any
1195 * @param[in] transfer_flag - Indicates the portion of PDR data being
1196 * transferred
1197 * @param[in] resp_cnt - The number of recordData bytes returned in this
1198 * response
1199 * @param[in] record_data - PDR data bytes of length resp_cnt
1200 * @param[in] transfer_crc - A CRC-8 for the overall PDR. This is present only
1201 * in the last part of a PDR being transferred
1202 * @param[out] msg - Message will be written to this
1203 * @return pldm_completion_codes
1204 * @note Caller is responsible for memory alloc and dealloc of param
1205 * 'msg.payload'
1206 */
1207int encode_get_pdr_resp(uint8_t instance_id, uint8_t completion_code,
1208 uint32_t next_record_hndl,
1209 uint32_t next_data_transfer_hndl, uint8_t transfer_flag,
1210 uint16_t resp_cnt, const uint8_t *record_data,
1211 uint8_t transfer_crc, struct pldm_msg *msg);
1212
1213/** @brief Decode GetPDR request data
1214 *
1215 * @param[in] msg - Request message
1216 * @param[in] payload_length - Length of request message payload
1217 * @param[out] record_hndl - The recordHandle value for the PDR to be retrieved
1218 * @param[out] data_transfer_hndl - Handle used to identify a particular
1219 * multipart PDR data transfer operation
1220 * @param[out] transfer_op_flag - Flag to indicate the first or subsequent
1221 * portion of transfer
1222 * @param[out] request_cnt - The maximum number of record bytes requested
1223 * @param[out] record_chg_num - Used to determine whether the PDR has changed
1224 * while PDR transfer is going on
1225 * @return pldm_completion_codes
1226 */
1227
1228int decode_get_pdr_req(const struct pldm_msg *msg, size_t payload_length,
1229 uint32_t *record_hndl, uint32_t *data_transfer_hndl,
1230 uint8_t *transfer_op_flag, uint16_t *request_cnt,
1231 uint16_t *record_chg_num);
1232
1233/* GetStateSensorReadings */
1234
1235/** @brief Decode GetStateSensorReadings request data
1236 *
1237 * @param[in] msg - Request message
1238 * @param[in] payload_length - Length of request message payload
1239 * @param[out] sensor_id - used to identify and access the simple or composite
1240 * sensor
1241 * @param[out] sensor_rearm - Each bit location in this field corresponds to a
1242 * particular sensor within the state sensor, where bit [0] corresponds
1243 * to the first state sensor (sensor offset 0) and bit [7] corresponds
1244 * to the eighth sensor (sensor offset 7), sequentially.
1245 * @param[out] reserved - value: 0x00
1246 * @return pldm_completion_codes
1247 */
1248
1249int decode_get_state_sensor_readings_req(const struct pldm_msg *msg,
1250 size_t payload_length,
1251 uint16_t *sensor_id,
1252 bitfield8_t *sensor_rearm,
1253 uint8_t *reserved);
1254
1255/** @brief Encode GetStateSensorReadings response data
1256 *
1257 * @param[in] instance_id - Message's instance id
1258 * @param[in] completion_code - PLDM completion code
1259 * @param[out] comp_sensor_count - The number of individual sets of sensor
1260 * information that this command accesses
1261 * @param[out] field - Each stateField is an instance of a stateField structure
1262 * that is used to return the present operational state setting and the
1263 * present state and event state for a particular set of sensor
1264 * information contained within the state sensor
1265 * @param[out] msg - Message will be written to this
1266 * @return pldm_completion_codes
1267 */
1268
1269int encode_get_state_sensor_readings_resp(uint8_t instance_id,
1270 uint8_t completion_code,
1271 uint8_t comp_sensor_count,
1272 get_sensor_state_field *field,
1273 struct pldm_msg *msg);
1274
1275/* GetNumericEffecterValue */
1276
1277/** @brief Decode GetNumericEffecterValue request data
1278 *
1279 * @param[in] msg - Request message
1280 * @param[in] payload_length - Length of request message payload
1281 * @param[out] effecter_id - used to identify and access the effecter
1282 * @return pldm_completion_codes
1283 */
1284int decode_get_numeric_effecter_value_req(const struct pldm_msg *msg,
1285 size_t payload_length,
1286 uint16_t *effecter_id);
1287
1288/** @brief Create a PLDM response message for GetNumericEffecterValue
1289 *
1290 * @param[in] instance_id - Message's instance id
1291 * @param[in] completion_code - PLDM completion code
1292 * @param[in] effecter_data_size - The bit width and format of the setting
1293 * value for the effecter.
1294 * value:{uint8,sint8,uint16,sint16,uint32,sint32}
1295 * @param[in] effecter_oper_state - The state of the effecter itself
1296 * @param[in] pending_value - The pending numeric value setting of the
1297 * effecter. The effecterDataSize field indicates the number of
1298 * bits used for this field
1299 * @param[in] present_value - The present numeric value setting of the
1300 * effecter. The effecterDataSize indicates the number of bits
1301 * used for this field
1302 * @param[out] msg - Message will be written to this
1303 * @param[in] payload_length - Length of request message payload
1304 * @return pldm_completion_codes
1305 * @note Caller is responsible for memory alloc and dealloc of param
1306 * 'msg.payload'
1307 */
1308int encode_get_numeric_effecter_value_resp(
1309 uint8_t instance_id, uint8_t completion_code, uint8_t effecter_data_size,
Andrew Jefferydebe6b32023-04-05 20:30:46 +09301310 uint8_t effecter_oper_state, const uint8_t *pending_value,
1311 const uint8_t *present_value, struct pldm_msg *msg, size_t payload_length);
Andrew Jeffery9c766792022-08-10 23:12:49 +09301312
1313/* GetSensorReading */
1314
1315/** @brief Decode GetSensorReading request data
1316 *
1317 * @param[in] msg - Request message
1318 * @param[in] payload_length - Length of request message payload
1319 * @param[out] sensor_id - A handle that is used to identify and access
1320 * the sensor
1321 * @param[out] rearm_event_state - true = manually re-arm EventState after
1322 * responding to this request, false = no manual re-arm
1323 * @return pldm_completion_codes
1324 */
1325
1326int decode_get_sensor_reading_req(const struct pldm_msg *msg,
1327 size_t payload_length, uint16_t *sensor_id,
1328 bool8_t *rearm_event_state);
1329
1330/** @brief Encode GetSensorReading response data
1331 *
1332 * @param[in] instance_id - Message's instance id
1333 * @param[in] completion_code - PLDM completion code
1334 * @param[out] sensor_data_size - The bit width and format of reading and
1335 * threshold values
1336 * @param[out] sensor_operational_state - The state of the sensor itself
1337 * @param[out] sensor_event_message_enable - value: { noEventGeneration,
1338 * eventsDisabled, eventsEnabled, opEventsOnlyEnabled,
1339 * stateEventsOnlyEnabled }
1340 * @param[out] present_state - The most recently assessed state value monitored
1341 * by the sensor
1342 * @param[out] previous_state - The state that the presentState was entered
1343 * from
1344 * @param[out] event_state - Indicates which threshold crossing assertion
1345 * events have been detected
1346 * @param[out] present_reading - The present value indicated by the sensor
1347 * @param[out] msg - Message will be written to this
1348 * @param[in] payload_length - Length of request message payload
1349 * @return pldm_completion_codes
1350 */
1351
Andrew Jefferydebe6b32023-04-05 20:30:46 +09301352int encode_get_sensor_reading_resp(uint8_t instance_id, uint8_t completion_code,
1353 uint8_t sensor_data_size,
1354 uint8_t sensor_operational_state,
1355 uint8_t sensor_event_message_enable,
1356 uint8_t present_state,
1357 uint8_t previous_state, uint8_t event_state,
1358 const uint8_t *present_reading,
1359 struct pldm_msg *msg, size_t payload_length);
Andrew Jeffery9c766792022-08-10 23:12:49 +09301360
1361/* Requester */
1362
1363/*GetPDRRepositoryInfo*/
1364
1365/** @brief Encode GetPDRRepositoryInfo response data
1366 *
1367 * @param[in] instance_id - Message's instance id
1368 * @param[in] completion_code - PLDM completion code
1369 * @param[in] repository_state - PLDM repository state
1370 * @param[in] update_time - When the standard PDR repository data was
1371 * originally created
1372 * @param[in] oem_update_time - when OEM PDRs in the PDR Repository were
1373 * originally created
1374 * @param[in] record_count - Total number of PDRs in this repository
1375 * @param[in] repository_size - Size of the PDR Repository in bytes
1376 * @param[in] largest_record_size - Size of the largest record in the PDR
1377 * Repository in bytes
1378 * @param[in] data_transfer_handle_timeout - Data transmission timeout
1379 * @param[out] msg - Message will be written to this
1380 * @return pldm_completion_codes
1381 */
1382int encode_get_pdr_repository_info_resp(
1383 uint8_t instance_id, uint8_t completion_code, uint8_t repository_state,
1384 const uint8_t *update_time, const uint8_t *oem_update_time,
1385 uint32_t record_count, uint32_t repository_size,
1386 uint32_t largest_record_size, uint8_t data_transfer_handle_timeout,
1387 struct pldm_msg *msg);
1388
Gilbert Chenb7c73e52022-11-10 11:29:52 +08001389/** @brief Decode GetPDRRepositoryInfo response data
1390 *
1391 * @param[in] msg - Response message
1392 * @param[in] payload_length - Length of response message payload
1393 * @param[out] completion_code - PLDM completion code
1394 * @param[out] repository_state - PLDM repository state
1395 * @param[out] update_time - When the standard PDR repository data was
1396 * originally created
1397 * @param[out] oem_update_time - when OEM PDRs in the PDR Repository were
1398 * originally created
1399 * @param[out] record_count - Total number of PDRs in this repository
1400 * @param[out] repository_size - Size of the PDR Repository in bytes
1401 * @param[out] largest_record_size - Size of the largest record in the PDR
1402 * Repository in bytes
1403 * @param[out] data_transfer_handle_timeout - Data transmission timeout
1404 * @return pldm_completion_codes
1405 */
1406int decode_get_pdr_repository_info_resp(
1407 const struct pldm_msg *msg, size_t payload_length, uint8_t *completion_code,
1408 uint8_t *repository_state, uint8_t *update_time, uint8_t *oem_update_time,
1409 uint32_t *record_count, uint32_t *repository_size,
1410 uint32_t *largest_record_size, uint8_t *data_transfer_handle_timeout);
1411
Andrew Jeffery9c766792022-08-10 23:12:49 +09301412/* GetPDR */
1413
1414/** @brief Create a PLDM request message for GetPDR
1415 *
1416 * @param[in] instance_id - Message's instance id
1417 * @param[in] record_hndl - The recordHandle value for the PDR to be retrieved
1418 * @param[in] data_transfer_hndl - Handle used to identify a particular
1419 * multipart PDR data transfer operation
1420 * @param[in] transfer_op_flag - Flag to indicate the first or subsequent
1421 * portion of transfer
1422 * @param[in] request_cnt - The maximum number of record bytes requested
1423 * @param[in] record_chg_num - Used to determine whether the PDR has changed
1424 * while PDR transfer is going on
1425 * @param[out] msg - Message will be written to this
1426 * @param[in] payload_length - Length of request message payload
1427 * @return pldm_completion_codes
1428 * @note Caller is responsible for memory alloc and dealloc of param
1429 * 'msg.payload'
1430 */
1431int encode_get_pdr_req(uint8_t instance_id, uint32_t record_hndl,
1432 uint32_t data_transfer_hndl, uint8_t transfer_op_flag,
1433 uint16_t request_cnt, uint16_t record_chg_num,
1434 struct pldm_msg *msg, size_t payload_length);
1435
1436/** @brief Decode GetPDR response data
1437 *
1438 * Note:
1439 * * If the return value is not PLDM_SUCCESS, it represents a
1440 * transport layer error.
1441 * * If the completion_code value is not PLDM_SUCCESS, it represents a
1442 * protocol layer error and all the out-parameters are invalid.
1443 *
1444 * @param[in] msg - Request message
1445 * @param[in] payload_length - Length of request message payload
1446 * @param[out] completion_code - PLDM completion code
1447 * @param[out] next_record_hndl - The recordHandle for the PDR that is next in
1448 * the PDR Repository
1449 * @param[out] next_data_transfer_hndl - A handle that identifies the next
1450 * portion of the PDR data to be transferred, if any
1451 * @param[out] transfer_flag - Indicates the portion of PDR data being
1452 * transferred
1453 * @param[out] resp_cnt - The number of recordData bytes returned in this
1454 * response
1455 * @param[out] record_data - PDR data bytes of length resp_cnt, or NULL to
1456 * skip the copy and place the actual length in resp_cnt.
1457 * @param[in] record_data_length - Length of record_data
1458 * @param[out] transfer_crc - A CRC-8 for the overall PDR. This is present only
1459 * in the last part of a PDR being transferred
1460 * @return pldm_completion_codes
1461 */
1462int decode_get_pdr_resp(const struct pldm_msg *msg, size_t payload_length,
1463 uint8_t *completion_code, uint32_t *next_record_hndl,
1464 uint32_t *next_data_transfer_hndl,
1465 uint8_t *transfer_flag, uint16_t *resp_cnt,
1466 uint8_t *record_data, size_t record_data_length,
1467 uint8_t *transfer_crc);
1468
1469/* SetStateEffecterStates */
1470
1471/** @brief Create a PLDM request message for SetStateEffecterStates
1472 *
1473 * @param[in] instance_id - Message's instance id
1474 * @param[in] effecter_id - used to identify and access the effecter
1475 * @param[in] comp_effecter_count - number of individual sets of effecter
1476 * information. Upto eight sets of state effecter info can be accessed
1477 * for a given effecter.
1478 * @param[in] field - each unit is an instance of the stateField structure
1479 * that is used to set the requested state for a particular effecter
1480 * within the state effecter. This field holds the starting address of
1481 * the stateField values. The user is responsible to allocate the
1482 * memory prior to calling this command. The user has to allocate the
1483 * field parameter as sizeof(set_effecter_state_field) *
1484 * comp_effecter_count
1485 * @param[out] msg - Message will be written to this
1486 * @return pldm_completion_codes
1487 * @note Caller is responsible for memory alloc and dealloc of param
1488 * 'msg.payload'
1489 */
1490
1491int encode_set_state_effecter_states_req(uint8_t instance_id,
1492 uint16_t effecter_id,
1493 uint8_t comp_effecter_count,
1494 set_effecter_state_field *field,
1495 struct pldm_msg *msg);
1496
1497/** @brief Decode SetStateEffecterStates response data
1498 *
1499 * Note:
1500 * * If the return value is not PLDM_SUCCESS, it represents a
1501 * transport layer error.
1502 * * If the completion_code value is not PLDM_SUCCESS, it represents a
1503 * protocol layer error and all the out-parameters are invalid.
1504 *
1505 * @param[in] msg - Request message
1506 * @param[in] payload_length - Length of response message payload
1507 * @param[out] completion_code - PLDM completion code
1508 * @return pldm_completion_codes
1509 */
1510int decode_set_state_effecter_states_resp(const struct pldm_msg *msg,
1511 size_t payload_length,
1512 uint8_t *completion_code);
1513
1514/* SetNumericEffecterValue */
1515
1516/** @brief Create a PLDM request message for SetNumericEffecterValue
1517 *
1518 * @param[in] instance_id - Message's instance id
1519 * @param[in] effecter_id - used to identify and access the effecter
1520 * @param[in] effecter_data_size - The bit width and format of the setting
1521 * value for the effecter.
1522 * value:{uint8,sint8,uint16,sint16,uint32,sint32}
1523 * @param[in] effecter_value - The setting value of numeric effecter being
1524 * requested.
1525 * @param[in] payload_length - Length of request message payload
1526 * @param[out] msg - Message will be written to this
1527 * @return pldm_completion_codes
1528 * @note Caller is responsible for memory alloc and dealloc of param
1529 * 'msg.payload'
1530 */
1531int encode_set_numeric_effecter_value_req(
1532 uint8_t instance_id, uint16_t effecter_id, uint8_t effecter_data_size,
Andrew Jefferydebe6b32023-04-05 20:30:46 +09301533 const uint8_t *effecter_value, struct pldm_msg *msg, size_t payload_length);
Andrew Jeffery9c766792022-08-10 23:12:49 +09301534
1535/** @brief Decode SetNumericEffecterValue response data
1536 * @param[in] msg - Request message
1537 * @param[in] payload_length - Length of response message payload
1538 * @param[out] completion_code - PLDM completion code
1539 * @return pldm_completion_codes
1540 */
1541int decode_set_numeric_effecter_value_resp(const struct pldm_msg *msg,
1542 size_t payload_length,
1543 uint8_t *completion_code);
1544
1545/** @brief Create a PLDM request message for GetStateSensorReadings
1546 *
1547 * @param[in] instance_id - Message's instance id
1548 * @param[in] sensor_id - used to identify and access the simple or composite
1549 * sensor
1550 * @param[in] sensorRearm - Each bit location in this field corresponds to a
1551 * particular sensor within the state sensor, where bit [0] corresponds
1552 * to the first state sensor (sensor offset 0) and bit [7] corresponds
1553 * to the eighth sensor (sensor offset 7), sequentially
1554 * @param[in] reserved - value: 0x00
1555 * @param[out] msg - Message will be written to this
1556 * @return pldm_completion_codes
1557 * @note Caller is responsible for memory alloc and dealloc of param
1558 * 'msg.payload'
1559 */
1560int encode_get_state_sensor_readings_req(uint8_t instance_id,
1561 uint16_t sensor_id,
1562 bitfield8_t sensor_rearm,
1563 uint8_t reserved,
1564 struct pldm_msg *msg);
1565
1566/** @brief Decode GetStateSensorReadings response data
1567 *
1568 * @param[in] msg - Request message
1569 * @param[in] payload_length - Length of response message payload
1570 * @param[out] completion_code - PLDM completion code
1571 * @param[in,out] comp_sensor_count - The number of individual sets of sensor
1572 * information that this command accesses
1573 * @param[out] field - Each stateField is an instance of a stateField structure
1574 * that is used to return the present operational state setting and the
1575 * present state and event state for a particular set of sensor
1576 * information contained within the state sensor
1577 * @return pldm_completion_codes
1578 */
1579
1580int decode_get_state_sensor_readings_resp(const struct pldm_msg *msg,
1581 size_t payload_length,
1582 uint8_t *completion_code,
1583 uint8_t *comp_sensor_count,
1584 get_sensor_state_field *field);
1585
1586/* PlatformEventMessage */
1587
1588/** @brief Decode PlatformEventMessage request data
1589 * @param[in] msg - Request message
1590 * @param[in] payload_length - Length of response message payload
1591 * @param[out] format_version - Version of the event format
1592 * @param[out] tid - Terminus ID for the terminus that originated the event
1593 * message
1594 * @param[out] event_class - The class of event being sent
1595 * @param[out] event_data_offset - Offset where the event data should be read
1596 * from pldm msg
1597 * @return pldm_completion_codes
1598 */
1599int decode_platform_event_message_req(const struct pldm_msg *msg,
1600 size_t payload_length,
1601 uint8_t *format_version, uint8_t *tid,
1602 uint8_t *event_class,
1603 size_t *event_data_offset);
1604
Thu Nguyen8eb20f22022-11-16 22:34:55 +07001605/** @brief Decode PollForEventMessage request data
1606 * @param[in] msg - Request message
1607 * @param[in] payload_length - Length of response message payload
1608 * @param[out] format_version - Version of the event format
1609 * @param[out] transfer_operation_flag - The transfer operation flag
1610 * @param[out] data_transfer_handle - The data transfer handle
1611 * @param[out] event_id_to_acknowledge - The class of event being sent
1612 * from pldm msg
1613 * @return pldm_completion_codes
1614 */
1615int decode_poll_for_platform_event_message_req(
1616 const struct pldm_msg *msg, size_t payload_length, uint8_t *format_version,
1617 uint8_t *transfer_operation_flag, uint32_t *data_transfer_handle,
1618 uint16_t *event_id_to_acknowledge);
1619
Andrew Jeffery9c766792022-08-10 23:12:49 +09301620/** @brief Encode PlatformEventMessage response data
1621 * @param[in] instance_id - Message's instance id
1622 * @param[in] completion_code - PLDM completion code
1623 * @param[in] platform_event_status - Response status of the event message
1624 * command
1625 * @param[out] msg - Message will be written to this
1626 * @return pldm_completion_codes
1627 * @note Caller is responsible for memory alloc and dealloc of param
1628 * 'msg.payload'
1629 */
1630int encode_platform_event_message_resp(uint8_t instance_id,
1631 uint8_t completion_code,
1632 uint8_t platform_event_status,
1633 struct pldm_msg *msg);
1634
Thu Nguyen8eb20f22022-11-16 22:34:55 +07001635/** @brief Encode PollForPlatformEventMessage response data
1636 * @param[in] instance_id - Message's instance id
1637 * @param[in] completion_code - PLDM completion code
1638 * @param[in] tid - Terminus ID
1639 * @param[in] event_id - The event id
1640 * @param[in] next_data_transfer_handle - The next data transfer handle
1641 * @param[in] transfer_flag - The transfer flag
1642 * @param[in] event_class - The event class
1643 * @param[in] event_data_size - The event data size
1644 * @param[in] event_data - The event data
1645 * @param[in] checksum - The checksum
1646 * @param[out] msg - Message will be written to this
1647 * @param[in] payload_length - Length of Response message payload
1648 * @return pldm_completion_codes
1649 * @note Caller is responsible for memory alloc and dealloc of param
1650 * 'msg.payload'
1651 */
1652int encode_poll_for_platform_event_message_resp(
1653 uint8_t instance_id, uint8_t completion_code, uint8_t tid,
1654 uint16_t event_id, uint32_t next_data_transfer_handle,
1655 uint8_t transfer_flag, uint8_t event_class, uint32_t event_data_size,
1656 uint8_t *event_data, uint32_t checksum, struct pldm_msg *msg,
1657 size_t payload_length);
1658
Andrew Jeffery9c766792022-08-10 23:12:49 +09301659/** @brief Encode PlatformEventMessage request data
1660 * @param[in] instance_id - Message's instance id
1661 * @param[in] format_version - Version of the event format
1662 * @param[in] tid - Terminus ID for the terminus that originated the event
1663 * message
1664 * @param[in] event_class - The class of event being sent
1665 * @param[in] event_data - the event data should be read from pldm msg
1666 * @param[in] event_data_length - Length of the event data
1667 * @param[out] msg - Request message
1668 * @return pldm_completion_codes
1669 * @note Caller is responsible for memory alloc and dealloc of param
1670 * 'msg.payload'
1671 */
1672int encode_platform_event_message_req(
1673 uint8_t instance_id, uint8_t format_version, uint8_t tid,
1674 uint8_t event_class, const uint8_t *event_data, size_t event_data_length,
1675 struct pldm_msg *msg, size_t payload_length);
1676
Thu Nguyen159a98b2022-11-02 10:00:10 +07001677/** @brief Encode PollForPlatformEventMessage request data
1678 * @param[in] instance_id - Message's instance id
1679 * @param[in] format_version - Version of the event format
1680 * @param[in] transfer_operation_flag - Tranfer operation
1681 * @param[in] data_transfer_handle - The data transfer handle
1682 * @param[in] event_id_to_acknowledge - the event data to acknowleadge
1683 * @param[out] msg - Request message
1684 * @return pldm_completion_codes
1685 * @note Caller is responsible for memory alloc and dealloc of param
1686 * 'msg.payload'
1687 */
1688int encode_poll_for_platform_event_message_req(uint8_t instance_id,
1689 uint8_t format_version,
1690 uint8_t transfer_operation_flag,
1691 uint32_t data_transfer_handle,
1692 uint16_t event_id_to_acknowledge,
1693 struct pldm_msg *msg,
1694 size_t payload_length);
1695
1696/** @brief Decode PollForPlatformEventMessage response data
1697 * @param[in] msg - Request message
1698 * @param[in] payload_length - Length of Response message payload
1699 * @param[out] completion_code - the completion code
1700 * @param[out] tid - the tid
1701 * @param[out] event_id - The event id
1702 * @param[out] next_data_transfer_handle - The next data transfer handle
1703 * @param[out] transfer_flag - The transfer flag
1704 * @param[out] event_class - The event class
1705 * @param[out] event_data_size - The event data size
1706 * @param[out] event_data - The event data. The event_data pointer points into
1707 * msg.payload and therefore has the same lifetime as msg.payload.
1708 * @param[out] event_data_integrity_checksum - The checksum
1709 * command
1710 * @return pldm_completion_codes
1711 * @note Caller is responsible for memory alloc and dealloc of param
1712 * 'msg.payload'
1713 */
1714int decode_poll_for_platform_event_message_resp(
1715 const struct pldm_msg *msg, size_t payload_length, uint8_t *completion_code,
1716 uint8_t *tid, uint16_t *event_id, uint32_t *next_data_transfer_handle,
1717 uint8_t *transfer_flag, uint8_t *event_class, uint32_t *event_data_size,
1718 void **event_data, uint32_t *event_data_integrity_checksum);
1719
Andrew Jeffery9c766792022-08-10 23:12:49 +09301720/** @brief Decode PlatformEventMessage response data
1721 * @param[in] msg - Request message
1722 * @param[in] payload_length - Length of Response message payload
1723 * @param[out] completion_code - PLDM completion code
1724 * @param[out] platform_event_status - Response status of the event message
1725 * command
1726 * @return pldm_completion_codes
1727 */
1728int decode_platform_event_message_resp(const struct pldm_msg *msg,
1729 size_t payload_length,
1730 uint8_t *completion_code,
1731 uint8_t *platform_event_status);
1732
Dung Caod6ae8982022-11-02 10:00:10 +07001733/** @brief Decode EventMessageBufferSize response data
1734 * @param[in] msg - Request message
1735 * @param[in] payload_length - Length of Response message payload
1736 * @param[out] completion_code - PLDM completion code
1737 * @return pldm_completion_codes
1738 */
1739int decode_event_message_buffer_size_resp(const struct pldm_msg *msg,
1740 size_t payload_length,
1741 uint8_t *completion_code,
1742 uint16_t *terminus_max_buffer_size);
1743
1744/** @brief Encode EventMessageBufferSize request data
1745 * @param[in] instance_id - Message's instance id
1746 * @param[in] event_receiver_max_buffer_size - Max buffer size
1747 * @param[out] msg - Request message
1748 * @return pldm_completion_codes
1749 * @note Caller is responsible for memory alloc and dealloc of param
1750 * 'msg.payload'
1751 */
1752int encode_event_message_buffer_size_req(
1753 uint8_t instance_id, uint16_t event_receiver_max_buffer_size,
1754 struct pldm_msg *msg);
1755
Dung Cao1bf8c872022-11-29 05:32:58 +07001756/** @brief Encode EventMessageSupported request data
1757 *
1758 * @param[in] instance_id - Message's instance id
1759 * @param[in] format_version - Version of the event format
1760 * @param[out] msg - Request message
1761 *
1762 * @return pldm_completion_codes
1763 * @note Caller is responsible for memory alloc and dealloc of param
1764 * 'msg.payload'
1765 */
1766int encode_event_message_supported_req(uint8_t instance_id,
1767 uint8_t format_version,
1768 struct pldm_msg *msg);
1769
1770/** @brief Decode EventMessageSupported response data
1771 *
1772 * @param[in] msg - Request message
1773 * @param[in] payload_length - Length of Response message payload
1774 * @param[out] completion_code - PLDM completion code
1775 * @param[out] synchrony_config - the synchrony configuration
1776 * @param[out] synchrony_config_support - the synchrony configuration support
1777 * @param[out] number_event_class_returned - PLDM completion code
1778 * @param[out] event_class - the event classes
1779 * @param[in] event_class_count - the event class count
1780 *
1781 * @return pldm_completion_codes
1782 */
1783int decode_event_message_supported_resp(
1784 const struct pldm_msg *msg, size_t payload_length, uint8_t *completion_code,
1785 uint8_t *synchrony_config, bitfield8_t *synchrony_config_support,
1786 uint8_t *number_event_class_returned, uint8_t *event_class,
1787 uint8_t event_class_count);
1788
Andrew Jeffery9c766792022-08-10 23:12:49 +09301789/** @brief Decode sensorEventData response data
1790 *
1791 * @param[in] event_data - event data from the response message
1792 * @param[in] event_data_length - length of the event data
1793 * @param[out] sensor_id - sensorID value of the sensor
1794 * @param[out] sensor_event_class_type - Type of sensor event class
1795 * @param[out] event_class_data_offset - Offset where the event class data
1796 * should be read from event data
1797 * @return pldm_completion_codes
1798 * @note Caller is responsible for memory alloc and dealloc of param
1799 * 'event_data'
1800 */
1801int decode_sensor_event_data(const uint8_t *event_data,
1802 size_t event_data_length, uint16_t *sensor_id,
1803 uint8_t *sensor_event_class_type,
1804 size_t *event_class_data_offset);
1805
1806/** @brief Decode sensorOpState response data
1807 *
1808 * @param[in] sensor_data - sensor_data for sensorEventClass = sensorOpState
1809 * @param[in] sensor_data_length - Length of sensor_data
1810 * @param[out] present_op_state - The sensorOperationalState value from the
1811 * state change that triggered the event message
1812 * @param[out] previous_op_state - The sensorOperationalState value for the
1813 * state from which the present state was entered
1814 * @return pldm_completion_codes
1815 * @note Caller is responsible for memory alloc and dealloc of param
1816 * 'sensor_data'
1817 */
1818int decode_sensor_op_data(const uint8_t *sensor_data, size_t sensor_data_length,
1819 uint8_t *present_op_state,
1820 uint8_t *previous_op_state);
1821
1822/** @brief Decode stateSensorState response data
1823 *
1824 * @param[in] sensor_data - sensor_data for sensorEventClass = stateSensorState
1825 * @param[in] sensor_data_length - Length of sensor_data
1826 * @param[out] sensor_offset - Identifies which state sensor within a composite
1827 * state sensor the event is being returned for
1828 * @param[out] event_state - The event state value from the state change that
1829 * triggered the event message
1830 * @param[out] previous_event_state - The event state value for the state from
1831 * which the present event state was entered
1832 * @return pldm_completion_codes
1833 * @note Caller is responsible for memory alloc and dealloc of param
1834 * 'sensor_data'
1835 */
1836int decode_state_sensor_data(const uint8_t *sensor_data,
1837 size_t sensor_data_length, uint8_t *sensor_offset,
1838 uint8_t *event_state,
1839 uint8_t *previous_event_state);
1840
1841/** @brief Decode numericSensorState response data
1842 *
1843 * @param[in] sensor_data - sensor_data for sensorEventClass =
1844 * numericSensorState
1845 * @param[in] sensor_data_length - Length of sensor_data
1846 * @param[out] event_state - The eventState value from the state change that
1847 * triggered the event message
1848 * @param[out] previous_event_state - The eventState value for the state from
1849 * which the present state was entered
1850 * @param[out] sensor_data_size - The bit width and format of reading and
1851 * threshold values that the sensor returns
1852 * @param[out] present_reading - The present value indicated by the sensor
1853 * @return pldm_completion_codes
1854 * @note Caller is responsible for memory alloc and dealloc of param
1855 * 'sensor_data'
1856 */
1857int decode_numeric_sensor_data(const uint8_t *sensor_data,
1858 size_t sensor_data_length, uint8_t *event_state,
1859 uint8_t *previous_event_state,
1860 uint8_t *sensor_data_size,
1861 uint32_t *present_reading);
1862
Andrew Jeffery7992eb82023-04-06 16:13:53 +09301863/** @brief Decode Numeric Sensor Pdr data
1864 *
1865 * @param[in] pdr_data - pdr data for numeric sensor
1866 * @param[in] pdr_data_length - Length of pdr data
1867 * @param[out] pdr_value - unpacked numeric sensor PDR struct
1868 */
1869int decode_numeric_sensor_pdr_data(
1870 const void *pdr_data, size_t pdr_data_length,
1871 struct pldm_numeric_sensor_value_pdr *pdr_value);
1872
Andrew Jeffery9c766792022-08-10 23:12:49 +09301873/* GetNumericEffecterValue */
1874
1875/** @brief Create a PLDM request message for GetNumericEffecterValue
1876 *
1877 * @param[in] instance_id - Message's instance id
1878 * @param[in] effecter_id - used to identify and access the effecter
1879 * @param[out] msg - Message will be written to this
1880 * @return pldm_completion_codes
1881 * @note Caller is responsible for memory alloc and dealloc of param
1882 * 'msg.payload'
1883 */
1884int encode_get_numeric_effecter_value_req(uint8_t instance_id,
1885 uint16_t effecter_id,
1886 struct pldm_msg *msg);
1887
1888/** @brief Create a PLDM response message for GetNumericEffecterValue
1889 *
1890 * @param[in] msg - Request message
1891 * @param[in] payload_length - Length of request message payload
1892 * @param[out] completion_code - PLDM completion code
1893 * @param[out] effecter_data_size - The bit width and format of the setting
1894 * value for the effecter.
1895 * value:{uint8,sint8,uint16,sint16,uint32,sint32}
1896 * @param[out] effecter_oper_state - The state of the effecter itself
1897 * @param[out] pending_value - The pending numeric value setting of the
1898 * effecter. The effecterDataSize field indicates the number of
1899 * bits used for this field
1900 * @param[out] present_value - The present numeric value setting of the
1901 * effecter. The effecterDataSize indicates the number of bits
1902 * used for this field
1903 * @return pldm_completion_codes
1904 */
1905int decode_get_numeric_effecter_value_resp(
1906 const struct pldm_msg *msg, size_t payload_length, uint8_t *completion_code,
1907 uint8_t *effecter_data_size, uint8_t *effecter_oper_state,
1908 uint8_t *pending_value, uint8_t *present_value);
1909
1910/** @brief Decode pldmPDRRepositoryChgEvent response data
1911 *
1912 * @param[in] event_data - eventData for pldmPDRRepositoryChgEvent
1913 * @param[in] event_data_size - Length of event_data
1914 * @param[out] event_data_format - This field indicates if the changedRecords
1915 * are of PDR Types or PDR Record Handles
1916 * @param[out] number_of_change_records - The number of changeRecords following
1917 * this field
1918 * @param[out] change_record_data_offset - Identifies where changeRecord data
1919 * is located within event_data
1920 * @return pldm_completion_codes
1921 * @note Caller is responsible for memory alloc and dealloc of param
1922 * 'event_data'
1923 */
1924int decode_pldm_pdr_repository_chg_event_data(
1925 const uint8_t *event_data, size_t event_data_size,
1926 uint8_t *event_data_format, uint8_t *number_of_change_records,
1927 size_t *change_record_data_offset);
1928
1929/** @brief Encode PLDM PDR Repository Change eventData
1930 * @param[in] event_data_format - Format of this event data (e.g.
1931 * FORMAT_IS_PDR_HANDLES)
1932 * @param[in] number_of_change_records - Number of changeRecords in this
1933 * eventData
1934 * @param[in] event_data_operations - Array of eventDataOperations
1935 * (e.g. RECORDS_ADDED) for each changeRecord in this eventData. This array
1936 * should contain number_of_change_records elements.
1937 * @param[in] numbers_of_change_entries - Array of numbers of changeEntrys
1938 * for each changeRecord in this eventData. This array should contain
1939 * number_of_change_records elements.
1940 * @param[in] change_entries - 2-dimensional array of arrays of changeEntrys,
1941 * one array per changeRecord in this eventData. The toplevel array should
1942 * contain number_of_change_records elements. Each subarray [i] should
1943 * contain numbers_of_change_entries[i] elements.
1944 * @param[in] event_data - The eventData will be encoded into this. This entire
1945 * structure must be max_change_records_size long. It must be large enough
1946 * to accomodate the data to be encoded. The caller is responsible for
1947 * allocating and deallocating it, including the variable-size
1948 * 'event_data.change_records' field. If this parameter is NULL,
1949 * PLDM_SUCCESS will be returned and actual_change_records_size will be set
1950 * to reflect the required size of the structure.
1951 * @param[out] actual_change_records_size - The actual number of meaningful
1952 * encoded bytes in event_data. The caller can over-allocate memory and use
1953 * this output to determine the real size of the structure.
1954 * @param[in] max_change_records_size - The size of event_data in bytes. If the
1955 * encoded message would be larger than this value, an error is returned.
1956 * @return pldm_completion_codes
1957 * @note Caller is responsible for memory alloc and dealloc of param
1958 * 'event_data.change_records'
1959 */
1960int encode_pldm_pdr_repository_chg_event_data(
1961 uint8_t event_data_format, uint8_t number_of_change_records,
1962 const uint8_t *event_data_operations,
1963 const uint8_t *numbers_of_change_entries,
1964 const uint32_t *const *change_entries,
1965 struct pldm_pdr_repository_chg_event_data *event_data,
1966 size_t *actual_change_records_size, size_t max_change_records_size);
1967
1968/** @brief Encode event data for a PLDM Sensor Event
1969 *
1970 * @param[out] event_data The object to store the encoded event in
1971 * @param[in] event_data_size Size of the allocation for event_data
1972 * @param[in] sensor_id Sensor ID
1973 * @param[in] sensor_event_class Sensor event class
1974 * @param[in] sensor_offset Offset
1975 * @param[in] event_state Event state
1976 * @param[in] previous_event_state Previous event state
1977 * @param[out] actual_event_data_size The real size in bytes of the event_data
1978 * @return int pldm_completion_codes PLDM_SUCCESS/PLDM_ERROR_INVALID_LENGTH
1979 * @note If event_data is NULL, then *actual_event_data_size will be set to
1980 * reflect the size of the event data, and PLDM_SUCCESS will be returned.
1981 * @note The caller is responsible for allocating and deallocating the
1982 * event_data
1983 */
1984int encode_sensor_event_data(struct pldm_sensor_event_data *event_data,
1985 size_t event_data_size, uint16_t sensor_id,
1986 enum sensor_event_class_states sensor_event_class,
1987 uint8_t sensor_offset, uint8_t event_state,
1988 uint8_t previous_event_state,
1989 size_t *actual_event_data_size);
1990
1991/** @brief Decode PldmPDRRepositoryChangeRecord response data
1992 *
1993 * @param[in] change_record_data - changeRecordData for
1994 * pldmPDRRepositoryChgEvent
1995 * @param[in] change_record_data_size - Length of change_record_data
1996 * @param[out] event_data_operation - This field indicates the changeEntries
1997 * operation types
1998 * @param[out] number_of_change_entries - The number of changeEntries following
1999 * this field
2000 * @param[out] change_entry_data_offset - Identifies where changeEntries data
2001 * is located within change_record_data
2002 * @return pldm_completion_codes
2003 * @note Caller is responsible for memory alloc and dealloc of param
2004 * 'change_record_data'
2005 */
2006int decode_pldm_pdr_repository_change_record_data(
2007 const uint8_t *change_record_data, size_t change_record_data_size,
2008 uint8_t *event_data_operation, uint8_t *number_of_change_entries,
2009 size_t *change_entry_data_offset);
2010
2011/* GetSensorReading */
2012
2013/** @brief Encode GetSensorReading request data
2014 *
2015 * @param[in] instance_id - Message's instance id
2016 * @param[in] sensor_id - A handle that is used to identify and access the
2017 * sensor
2018 * @param[in] rearm_event_state - true = manually re-arm EventState after
2019 * responding to this request, false = no manual re-arm
2020 * @param[out] msg - Message will be written to this
2021 * @return pldm_completion_codes
2022 * @note Caller is responsible for memory alloc and dealloc of param
2023 * 'msg.payload'
2024 */
2025int encode_get_sensor_reading_req(uint8_t instance_id, uint16_t sensor_id,
2026 bool8_t rearm_event_state,
2027 struct pldm_msg *msg);
2028
2029/** @brief Decode GetSensorReading response data
2030 *
2031 * @param[in] msg - Request message
2032 * @param[in] payload_length - Length of response message payload
2033 * @param[out] completion_code - PLDM completion code
2034 * @param[out] sensor_data_size - The bit width and format of reading and
2035 * threshold values
2036 * @param[out] sensor_operational_state - The state of the sensor itself
2037 * @param[out] sensor_event_message_enable - value: { noEventGeneration,
2038 * eventsDisabled, eventsEnabled, opEventsOnlyEnabled,
2039 * stateEventsOnlyEnabled }
2040 * @param[out] present_state - The most recently assessed state value monitored
2041 * by the sensor
2042 * @param[out] previous_state - The state that the presentState was entered
2043 * from
2044 * @param[out] event_state - Indicates which threshold crossing assertion
2045 * events have been detected
2046 * @param[out] present_reading - The present value indicated by the sensor
2047 * @return pldm_completion_codes
2048 */
2049
2050int decode_get_sensor_reading_resp(
2051 const struct pldm_msg *msg, size_t payload_length, uint8_t *completion_code,
2052 uint8_t *sensor_data_size, uint8_t *sensor_operational_state,
2053 uint8_t *sensor_event_message_enable, uint8_t *present_state,
2054 uint8_t *previous_state, uint8_t *event_state, uint8_t *present_reading);
2055
2056/** @brief Encode the SetEventReceiver request message
2057 *
2058 * @param[in] instance_id - Message's instance id
2059 * @param[in] event_message_global_enable - This value is used to enable or
2060 * disable event message generation from the terminus value: {
2061 * disable, enableAsync, enablePolling, enableAsyncKeepAlive }
2062 * @param[in] transport_protocol_type - This value is provided in the request
2063 * to help the responder verify that the content of the
2064 * eventReceiverAddressInfo field used in this request is correct for
2065 * the messaging protocol supported by the terminus.
2066 * @param[in] event_receiver_address_info - this value is a medium and
2067 * protocol-specific address that the responder should use when
2068 * transmitting event messages using the indicated protocol
2069 * @param[in] heartbeat_timer - Amount of time in seconds after each elapsing
2070 * of which the terminus shall emit a heartbeat event to the receiver
2071 * @param[out] msg - Argument to capture the Message
2072 * @return pldm_completion_codes
2073 */
2074int encode_set_event_receiver_req(uint8_t instance_id,
2075 uint8_t event_message_global_enable,
2076 uint8_t transport_protocol_type,
2077 uint8_t event_receiver_address_info,
2078 uint16_t heartbeat_timer,
2079 struct pldm_msg *msg);
2080
2081/** @brief Decode the SetEventReceiver response message
2082 *
2083 * @param[in] msg - Request message
2084 * @param[in] payload_length - Length of response message payload
2085 * @param[out] completion_code - PLDM completion code
2086 * @return pldm_completion_codes
2087 */
2088int decode_set_event_receiver_resp(const struct pldm_msg *msg,
2089 size_t payload_length,
2090 uint8_t *completion_code);
2091
2092/** @brief Decode the SetEventReceiver request message
2093 *
2094 * @param[in] msg - Request message
2095 * @param[in] payload_length - Length of request message payload
2096 * @param[out] event_message_global_enable - This value is used to enable or
2097 * disable event message generation from the terminus value: {
2098 * disable, enableAsync, enablePolling, enableAsyncKeepAlive }
2099 * @param[out] transport_protocol_type - This value is provided in the request
2100 * to help the responder verify that the content of the
2101 * eventReceiverAddressInfo field used in this request is correct for
2102 * the messaging protocol supported by the terminus.
2103 * @param[out] event_receiver_address_info - This value is a medium and
2104 * protocol-specific address that the responder should use when
2105 * transmitting event messages using the indicated protocol
2106 * @param[out] heartbeat_timer - Amount of time in seconds after each elapsing
2107 * of which the terminus shall emit a heartbeat event to the receiver
2108 * @return pldm_completion_codes
2109 */
2110int decode_set_event_receiver_req(const struct pldm_msg *msg,
2111 size_t payload_length,
2112 uint8_t *event_message_global_enable,
2113 uint8_t *transport_protocol_type,
2114 uint8_t *event_receiver_address_info,
2115 uint16_t *heartbeat_timer);
2116
2117/** @brief Encode the SetEventReceiver response message
2118 *
2119 * @param[in] instance_id - Message's instance id
2120 * @param[in] completion_code - PLDM completion code
2121 * @param[out] msg - Argument to capture the Message
2122 * @return pldm_completion_codes
2123 */
2124int encode_set_event_receiver_resp(uint8_t instance_id, uint8_t completion_code,
2125 struct pldm_msg *msg);
2126
2127#ifdef __cplusplus
2128}
2129#endif
2130
2131#endif /* PLATFORM_H */