Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 1 | #ifndef BIOS_H |
| 2 | #define BIOS_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
| 8 | #include <asm/byteorder.h> |
| 9 | #include <stddef.h> |
| 10 | #include <stdint.h> |
| 11 | |
| 12 | #include "base.h" |
| 13 | |
| 14 | /* Response lengths are inclusive of completion code */ |
| 15 | #define PLDM_GET_DATE_TIME_RESP_BYTES 8 |
| 16 | |
Sampa Misra | b37be31 | 2019-07-03 02:26:41 -0500 | [diff] [blame] | 17 | #define PLDM_GET_BIOS_TABLE_REQ_BYTES 6 |
| 18 | #define PLDM_GET_BIOS_TABLE_MIN_RESP_BYTES 6 |
John Wang | 4d84479 | 2019-08-15 15:51:40 +0800 | [diff] [blame] | 19 | #define PLDM_SET_BIOS_ATTR_CURR_VAL_MIN_REQ_BYTES 5 |
| 20 | #define PLDM_SET_BIOS_ATTR_CURR_VAL_RESP_BYTES 5 |
Zahed Hossain | d69af0b | 2019-07-30 01:33:31 -0500 | [diff] [blame] | 21 | #define PLDM_GET_BIOS_ATTR_CURR_VAL_BY_HANDLE_REQ_BYTES 7 |
John Wang | 8721ed6 | 2019-12-05 14:44:43 +0800 | [diff] [blame] | 22 | #define PLDM_GET_BIOS_ATTR_CURR_VAL_BY_HANDLE_MIN_RESP_BYTES 6 |
Sampa Misra | b37be31 | 2019-07-03 02:26:41 -0500 | [diff] [blame] | 23 | |
| 24 | enum pldm_bios_completion_codes { |
| 25 | PLDM_BIOS_TABLE_UNAVAILABLE = 0x83, |
| 26 | PLDM_INVALID_BIOS_TABLE_DATA_INTEGRITY_CHECK = 0x84, |
| 27 | PLDM_INVALID_BIOS_TABLE_TYPE = 0x85, |
John Wang | 8721ed6 | 2019-12-05 14:44:43 +0800 | [diff] [blame] | 28 | PLDM_INVALID_BIOS_ATTR_HANDLE = 0x88, |
Sampa Misra | b37be31 | 2019-07-03 02:26:41 -0500 | [diff] [blame] | 29 | }; |
| 30 | enum pldm_bios_commands { |
| 31 | PLDM_GET_BIOS_TABLE = 0x01, |
John Wang | 4d84479 | 2019-08-15 15:51:40 +0800 | [diff] [blame] | 32 | PLDM_SET_BIOS_ATTRIBUTE_CURRENT_VALUE = 0x07, |
Zahed Hossain | d69af0b | 2019-07-30 01:33:31 -0500 | [diff] [blame] | 33 | PLDM_GET_BIOS_ATTRIBUTE_CURRENT_VALUE_BY_HANDLE = 0x08, |
| 34 | PLDM_GET_DATE_TIME = 0x0c, |
Xiaochao Ma | 39ae2a9 | 2019-11-12 20:30:34 +0800 | [diff] [blame] | 35 | PLDM_SET_DATE_TIME = 0x0d, |
Sampa Misra | b37be31 | 2019-07-03 02:26:41 -0500 | [diff] [blame] | 36 | }; |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 37 | |
Deepak Kodihalli | cb7f2d4 | 2019-06-19 13:25:31 +0530 | [diff] [blame] | 38 | enum pldm_bios_table_types { |
| 39 | PLDM_BIOS_STRING_TABLE, |
| 40 | PLDM_BIOS_ATTR_TABLE, |
| 41 | PLDM_BIOS_ATTR_VAL_TABLE, |
| 42 | }; |
| 43 | |
| 44 | struct pldm_bios_string_table_entry { |
| 45 | uint16_t string_handle; |
| 46 | uint16_t string_length; |
| 47 | char name[1]; |
| 48 | } __attribute__((packed)); |
| 49 | |
| 50 | struct pldm_bios_attr_table_entry { |
| 51 | uint16_t attr_handle; |
| 52 | uint8_t attr_type; |
| 53 | uint16_t string_handle; |
| 54 | uint8_t metadata[1]; |
| 55 | } __attribute__((packed)); |
| 56 | |
| 57 | struct pldm_bios_enum_attr { |
| 58 | uint8_t num_possible_values; |
| 59 | uint16_t indices[1]; |
| 60 | } __attribute__((packed)); |
| 61 | |
| 62 | struct pldm_bios_attr_val_table_entry { |
| 63 | uint16_t attr_handle; |
| 64 | uint8_t attr_type; |
| 65 | uint8_t value[1]; |
| 66 | } __attribute__((packed)); |
| 67 | |
Sampa Misra | b37be31 | 2019-07-03 02:26:41 -0500 | [diff] [blame] | 68 | enum pldm_bios_attribute_type { |
| 69 | PLDM_BIOS_ENUMERATION = 0x0, |
| 70 | PLDM_BIOS_STRING = 0x1, |
| 71 | PLDM_BIOS_PASSWORD = 0x2, |
| 72 | PLDM_BIOS_INTEGER = 0x3, |
| 73 | PLDM_BIOS_ENUMERATION_READ_ONLY = 0x80, |
| 74 | PLDM_BIOS_STRING_READ_ONLY = 0x81, |
| 75 | PLDM_BIOS_PASSWORD_READ_ONLY = 0x82, |
| 76 | PLDM_BIOS_INTEGER_READ_ONLY = 0x83, |
| 77 | }; |
| 78 | |
| 79 | /** @struct pldm_get_bios_table_req |
| 80 | * |
| 81 | * structure representing GetBIOSTable request packet |
| 82 | */ |
| 83 | struct pldm_get_bios_table_req { |
| 84 | uint32_t transfer_handle; |
| 85 | uint8_t transfer_op_flag; |
| 86 | uint8_t table_type; |
| 87 | } __attribute__((packed)); |
| 88 | |
| 89 | /** @struct pldm_get_bios_table_resp |
| 90 | * |
| 91 | * structure representing GetBIOSTable response packet |
| 92 | */ |
| 93 | struct pldm_get_bios_table_resp { |
| 94 | uint8_t completion_code; |
| 95 | uint32_t next_transfer_handle; |
| 96 | uint8_t transfer_flag; |
| 97 | uint8_t table_data[1]; |
| 98 | } __attribute__((packed)); |
| 99 | |
Priyanga | 5dcd180 | 2019-06-10 01:50:39 -0500 | [diff] [blame] | 100 | /** @struct pldm_get_date_time_resp |
| 101 | * |
| 102 | * Structure representing PLDM get date time response |
| 103 | */ |
| 104 | struct pldm_get_date_time_resp { |
| 105 | uint8_t completion_code; //!< completion code |
| 106 | uint8_t seconds; //!< Seconds in BCD format |
| 107 | uint8_t minutes; //!< Minutes in BCD format |
| 108 | uint8_t hours; //!< Hours in BCD format |
| 109 | uint8_t day; //!< Day of the month in BCD format |
| 110 | uint8_t month; //!< Month in BCD format |
| 111 | uint16_t year; //!< Year in BCD format |
| 112 | } __attribute__((packed)); |
| 113 | |
Xiaochao Ma | 39ae2a9 | 2019-11-12 20:30:34 +0800 | [diff] [blame] | 114 | /** @struct pldm_set_date_time_req |
| 115 | * |
| 116 | * structure representing SetDateTime request packet |
| 117 | * |
| 118 | */ |
| 119 | struct pldm_set_date_time_req { |
| 120 | uint8_t seconds; //!< Seconds in BCD format |
| 121 | uint8_t minutes; //!< Minutes in BCD format |
| 122 | uint8_t hours; //!< Hours in BCD format |
| 123 | uint8_t day; //!< Day of the month in BCD format |
| 124 | uint8_t month; //!< Month in BCD format |
| 125 | uint16_t year; //!< Year in BCD format |
| 126 | } __attribute__((packed)); |
| 127 | |
| 128 | /** @struct pldm_only_cc_resp |
| 129 | * |
| 130 | * Structure representing PLDM responses only have completion code |
| 131 | */ |
| 132 | struct pldm_only_cc_resp { |
| 133 | uint8_t completion_code; |
| 134 | } __attribute__((packed)); |
| 135 | |
Zahed Hossain | d69af0b | 2019-07-30 01:33:31 -0500 | [diff] [blame] | 136 | /** @struct pldm_get_bios_attribute_current_value_by_handle_req |
| 137 | * |
| 138 | * structure representing GetBIOSAttributeCurrentValueByHandle request packet |
| 139 | */ |
| 140 | struct pldm_get_bios_attribute_current_value_by_handle_req { |
| 141 | uint32_t transfer_handle; |
| 142 | uint8_t transfer_op_flag; |
| 143 | uint16_t attribute_handle; |
| 144 | } __attribute__((packed)); |
| 145 | |
| 146 | /** @struct pldm_get_bios_attribute_current_value_by_handle_resp |
| 147 | * |
| 148 | * structure representing GetBIOSAttributeCurrentValueByHandle response |
| 149 | */ |
| 150 | struct pldm_get_bios_attribute_current_value_by_handle_resp { |
| 151 | uint8_t completion_code; |
| 152 | uint32_t next_transfer_handle; |
| 153 | uint8_t transfer_flag; |
| 154 | uint8_t attribute_data[1]; |
| 155 | } __attribute__((packed)); |
| 156 | |
John Wang | 4d84479 | 2019-08-15 15:51:40 +0800 | [diff] [blame] | 157 | /** @struct pldm_set_bios_attribute_current_value_req |
| 158 | * |
| 159 | * structure representing SetBiosAttributeCurrentValue request packet |
| 160 | * |
| 161 | */ |
| 162 | struct pldm_set_bios_attribute_current_value_req { |
| 163 | uint32_t transfer_handle; |
| 164 | uint8_t transfer_flag; |
| 165 | uint8_t attribute_data[1]; |
| 166 | } __attribute__((packed)); |
| 167 | |
| 168 | /** @struct pldm_set_bios_attribute_current_value_resp |
| 169 | * |
| 170 | * structure representing SetBiosCurrentValue response packet |
| 171 | * |
| 172 | */ |
| 173 | struct pldm_set_bios_attribute_current_value_resp { |
| 174 | uint8_t completion_code; |
| 175 | uint32_t next_transfer_handle; |
| 176 | } __attribute__((packed)); |
| 177 | |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 178 | /* Requester */ |
| 179 | |
| 180 | /* GetDateTime */ |
| 181 | |
| 182 | /** @brief Create a PLDM request message for GetDateTime |
| 183 | * |
| 184 | * @param[in] instance_id - Message's instance id |
| 185 | * @param[out] msg - Message will be written to this |
| 186 | * @return pldm_completion_codes |
| 187 | * @note Caller is responsible for memory alloc and dealloc of param |
| 188 | * 'msg.body.payload' |
| 189 | */ |
| 190 | |
| 191 | int encode_get_date_time_req(uint8_t instance_id, struct pldm_msg *msg); |
| 192 | |
| 193 | /** @brief Decode a GetDateTime response message |
| 194 | * |
Zahed Hossain | 223a73d | 2019-07-04 12:46:18 -0500 | [diff] [blame] | 195 | * @param[in] msg - Response message |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 196 | * @param[in] payload_length - Length of response message payload |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 197 | * @param[out] completion_code - Pointer to response msg's PLDM completion code |
| 198 | * @param[out] seconds - Seconds in BCD format |
| 199 | * @param[out] minutes - minutes in BCD format |
| 200 | * @param[out] hours - hours in BCD format |
| 201 | * @param[out] day - day of month in BCD format |
| 202 | * @param[out] month - number of month in BCD format |
| 203 | * @param[out] year - year in BCD format |
| 204 | * @return pldm_completion_codes |
| 205 | */ |
Zahed Hossain | 223a73d | 2019-07-04 12:46:18 -0500 | [diff] [blame] | 206 | int decode_get_date_time_resp(const struct pldm_msg *msg, size_t payload_length, |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 207 | uint8_t *completion_code, uint8_t *seconds, |
| 208 | uint8_t *minutes, uint8_t *hours, uint8_t *day, |
| 209 | uint8_t *month, uint16_t *year); |
| 210 | |
John Wang | 4d84479 | 2019-08-15 15:51:40 +0800 | [diff] [blame] | 211 | /* SetBiosAttributeCurrentValue */ |
| 212 | |
| 213 | /** @brief Create a PLDM request message for SetBiosAttributeCurrentValue |
| 214 | * |
| 215 | * @param[in] instance_id - Message's instance id |
| 216 | * @param[in] transfer_handle - Handle to identify a BIOS table transfer |
| 217 | * @param[in] transfer_flag - Flag to indicate what part of the transfer |
| 218 | * this request represents |
| 219 | * @param[in] attribute_data - Contains current value of attribute |
| 220 | * @param[in] attribute_length - Length of attribute |
| 221 | * @param[out] msg - Message will be written to this |
| 222 | * @param[in] payload_length - Length of message payload |
| 223 | * @return pldm_completion_codes |
| 224 | * @note Caller is responsible for memory alloc and dealloc of params |
| 225 | * 'msg.payload' |
| 226 | */ |
| 227 | int encode_set_bios_attribute_current_value_req( |
| 228 | uint8_t instance_id, uint32_t transfer_handle, uint8_t transfer_flag, |
| 229 | const uint8_t *attribute_data, size_t attribute_length, |
| 230 | struct pldm_msg *msg, size_t payload_length); |
| 231 | |
| 232 | /** @brief Decode a SetBiosAttributeCurrentValue response message |
| 233 | * |
| 234 | * @param[in] msg - Response message |
| 235 | * @param[in] payload_length - Length of response message payload |
| 236 | * @param[out] completion_code - Pointer to response msg's PLDM completion code |
| 237 | * @param[out] next_transfer_handle - Pointer to a handle that identify the |
| 238 | * next portion of the transfer |
| 239 | * @return pldm_completion_codes |
| 240 | */ |
| 241 | int decode_set_bios_attribute_current_value_resp( |
| 242 | const struct pldm_msg *msg, size_t payload_length, uint8_t *completion_code, |
| 243 | uint32_t *next_transfer_handle); |
| 244 | |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 245 | /* Responder */ |
| 246 | |
| 247 | /* GetDateTime */ |
| 248 | |
| 249 | /** @brief Create a PLDM response message for GetDateTime |
| 250 | * |
| 251 | * @param[in] instance_id - Message's instance id |
| 252 | * @param[in] completion_code - PLDM completion code |
| 253 | * @param[in] seconds - seconds in BCD format |
| 254 | * @param[in] minutes - minutes in BCD format |
| 255 | * @param[in] hours - hours in BCD format |
| 256 | * @param[in] day - day of the month in BCD format |
| 257 | * @param[in] month - number of month in BCD format |
| 258 | * @param[in] year - year in BCD format |
| 259 | * @param[out] msg - Message will be written to this |
| 260 | * @return pldm_completion_codes |
| 261 | * @note Caller is responsible for memory alloc and dealloc of param |
| 262 | * 'msg.body.payload' |
| 263 | */ |
| 264 | |
| 265 | int encode_get_date_time_resp(uint8_t instance_id, uint8_t completion_code, |
| 266 | uint8_t seconds, uint8_t minutes, uint8_t hours, |
| 267 | uint8_t day, uint8_t month, uint16_t year, |
| 268 | struct pldm_msg *msg); |
| 269 | |
Sampa Misra | b37be31 | 2019-07-03 02:26:41 -0500 | [diff] [blame] | 270 | /* GetBIOSTable */ |
| 271 | |
| 272 | /** @brief Create a PLDM response message for GetBIOSTable |
| 273 | * |
| 274 | * @param[in] instance_id - Message's instance id |
| 275 | * @param[in] completion_code - PLDM completion code |
| 276 | * @param[in] next_transfer_handle - handle to identify the next portion of the |
| 277 | * transfer |
| 278 | * @param[in] transfer_flag - To indicate what part of the transfer this |
| 279 | * response represents |
| 280 | * @param[in] table_data - BIOS Table type specific data |
| 281 | * @param[in] payload_length - Length of payload message |
| 282 | * @param[out] msg - Message will be written to this |
| 283 | * @return pldm_completion_codes |
| 284 | */ |
| 285 | int encode_get_bios_table_resp(uint8_t instance_id, uint8_t completion_code, |
| 286 | uint32_t next_transfer_handle, |
| 287 | uint8_t transfer_flag, uint8_t *table_data, |
| 288 | size_t payload_length, struct pldm_msg *msg); |
| 289 | |
Sridevi Ramesh | d3d5fa8 | 2019-10-29 11:45:16 -0500 | [diff] [blame] | 290 | /** @brief Encode GetBIOSTable request packet |
| 291 | * |
| 292 | * @param[in] instance_id - Message's instance id |
| 293 | * @param[in] transfer_handle - Handle to identify a BIOS table transfer |
| 294 | * @param[in] transfer_op_flag - Flag to indicate the start of a multipart |
| 295 | * transfer |
| 296 | * @param[in] table_type - BIOS table type |
| 297 | * @param[out] msg - Message will be written to this |
| 298 | * @return pldm_completion_codes |
| 299 | */ |
| 300 | int encode_get_bios_table_req(uint8_t instance_id, uint32_t transfer_handle, |
| 301 | uint8_t transfer_op_flag, uint8_t table_type, |
| 302 | struct pldm_msg *msg); |
| 303 | |
Sampa Misra | b37be31 | 2019-07-03 02:26:41 -0500 | [diff] [blame] | 304 | /** @brief Decode GetBIOSTable request packet |
| 305 | * |
| 306 | * @param[in] msg - Request message |
| 307 | * @param[in] payload_length - Length of request message payload |
| 308 | * @param[out] transfer_handle - Handle to identify a BIOS table transfer |
| 309 | * @param[out] transfer_op_flag - Flag to indicate the start of a multipart |
| 310 | * transfer |
| 311 | * @param[out] table_type - BIOS table type |
| 312 | * @return pldm_completion_codes |
| 313 | */ |
| 314 | int decode_get_bios_table_req(const struct pldm_msg *msg, size_t payload_length, |
| 315 | uint32_t *transfer_handle, |
| 316 | uint8_t *transfer_op_flag, uint8_t *table_type); |
| 317 | |
Zahed Hossain | d69af0b | 2019-07-30 01:33:31 -0500 | [diff] [blame] | 318 | /* GetBIOSAttributeCurrentValueByHandle */ |
| 319 | |
| 320 | /** @brief Decode GetBIOSAttributeCurrentValueByHandle request packet |
| 321 | * |
| 322 | * @param[in] msg - Request message |
| 323 | * @param[in] payload_length - Length of request message payload |
| 324 | * @param[out] transfer_handle - Handle to identify a BIOS table transfer |
| 325 | * @param[out] transfer_op_flag - Flag to indicate the start of a multipart |
| 326 | * transfer |
| 327 | * @param[out] attribute_handle - Handle to identify the BIOS attribute |
| 328 | * @return pldm_completion_codes |
| 329 | */ |
| 330 | int decode_get_bios_attribute_current_value_by_handle_req( |
| 331 | const struct pldm_msg *msg, size_t payload_length, |
| 332 | uint32_t *transfer_handle, uint8_t *transfer_op_flag, |
| 333 | uint16_t *attribute_handle); |
| 334 | |
| 335 | /** @brief Create a PLDM response message for |
| 336 | * GetBIOSAttributeCurrentValueByHandle |
| 337 | * |
| 338 | * @param[in] instance_id - Message's instance id |
| 339 | * @param[in] completion_code - PLDM completion code |
| 340 | * @param[in] next_transfer_handle - handle to identify the next portion of the |
| 341 | * transfer |
| 342 | * @param[in] transfer_flag - To indicate what part of the transfer this |
| 343 | * response represents |
| 344 | * @param[in] attribute_data - contains current value of attribute |
| 345 | * @param[in] attribute_length - Length of attribute |
| 346 | * @param[out] msg - Message will be written to this |
| 347 | * @return pldm_completion_codes |
| 348 | */ |
| 349 | int encode_get_bios_current_value_by_handle_resp( |
| 350 | uint8_t instance_id, uint8_t completion_code, uint32_t next_transfer_handle, |
| 351 | uint8_t transfer_flag, const uint8_t *attribute_data, |
| 352 | size_t attribute_length, struct pldm_msg *msg); |
| 353 | |
John Wang | 4d84479 | 2019-08-15 15:51:40 +0800 | [diff] [blame] | 354 | /* SetBiosAttributeCurrentValue */ |
| 355 | |
| 356 | /** @brief Decode SetBIOSAttributeCurrentValue request packet |
| 357 | * |
| 358 | * @param[in] msg - Request message |
| 359 | * @param[in] payload_length - Length of request message payload |
| 360 | * @param[out] transfer_handle - Handle to identify a BIOS table transfer |
| 361 | * @param[out] transfer_flag - Flag to indicate what part of the transfer |
| 362 | * this request represents |
| 363 | * @param[out] attribute_data - Contains current value of attribute |
| 364 | * @param[out] attribute_length - Pointer to length of attribute |
| 365 | * @return pldm_completion_codes |
| 366 | */ |
| 367 | int decode_set_bios_attribute_current_value_req(const struct pldm_msg *msg, |
| 368 | size_t payload_length, |
| 369 | uint32_t *transfer_handle, |
| 370 | uint8_t *transfer_flag, |
| 371 | uint8_t *attribute_data, |
| 372 | size_t *attribute_length); |
| 373 | |
| 374 | /** @brief Create a PLDM response message for SetBiosAttributeCurrentValue |
| 375 | * |
| 376 | * @param[in] instance_id - Message's instance id |
| 377 | * @param[in] completion_code - PLDM completion code |
| 378 | * @param[in] next_transfer_handle - handle to identify the next portion of the |
| 379 | * @param[out] msg - Message will be written to this |
| 380 | */ |
| 381 | int encode_set_bios_attribute_current_value_resp(uint8_t instance_id, |
| 382 | uint8_t completion_code, |
| 383 | uint32_t next_transfer_handle, |
| 384 | struct pldm_msg *msg); |
| 385 | |
Xiaochao Ma | 39ae2a9 | 2019-11-12 20:30:34 +0800 | [diff] [blame] | 386 | /** @brief Create a PLDM request message for SetDateTime |
| 387 | * |
| 388 | * @param[in] instance_id - Message's instance id |
Xiaochao Ma | 501a6fd | 2019-12-17 14:44:57 +0800 | [diff] [blame] | 389 | * @param[in] seconds - Seconds in decimal format. Value range 0~59 |
| 390 | * @param[in] minutes - minutes in decimal format. Value range 0~59 |
| 391 | * @param[in] hours - hours in decimal format. Value range 0~23 |
| 392 | * @param[in] day - day of month in decimal format. Value range 1~31 |
| 393 | * @param[in] month - number of month in decimal format. Value range 1~12 |
| 394 | * @param[in] year - year in decimal format. Value range 1970~ |
Xiaochao Ma | 39ae2a9 | 2019-11-12 20:30:34 +0800 | [diff] [blame] | 395 | * @param[out] msg - Message will be written to this |
| 396 | * @param[in] payload_length - Length of request message payload |
| 397 | * @return pldm_completion_codes |
| 398 | * @note Caller is responsible for memory alloc and dealloc of param |
| 399 | * 'msg.body.payload' |
| 400 | */ |
| 401 | int encode_set_date_time_req(uint8_t instance_id, uint8_t seconds, |
| 402 | uint8_t minutes, uint8_t hours, uint8_t day, |
| 403 | uint8_t month, uint16_t year, struct pldm_msg *msg, |
| 404 | size_t payload_length); |
| 405 | |
| 406 | /** @brief Decode a SetDateTime request message |
| 407 | * |
| 408 | * @param[in] msg - Response message |
| 409 | * @param[in] payload_length - Length of request message payload |
| 410 | * @param[out] seconds - seconds in BCD format |
| 411 | * @param[out] minutes - minutes in BCD format |
| 412 | * @param[out] hours - hours in BCD format |
| 413 | * @param[out] day - day of the month in BCD format |
| 414 | * @param[out] month - number of month in BCD format |
| 415 | * @param[out] year - year in BCD format |
| 416 | * @return pldm_completion_codes |
| 417 | */ |
| 418 | int decode_set_date_time_req(const struct pldm_msg *msg, size_t payload_length, |
| 419 | uint8_t *seconds, uint8_t *minutes, uint8_t *hours, |
| 420 | uint8_t *day, uint8_t *month, uint16_t *year); |
| 421 | |
| 422 | /** @brief Create a PLDM response message for SetDateTime |
| 423 | * |
| 424 | * @param[in] instance_id - Message's instance id |
| 425 | * @param[in] completion_code - PLDM completion code |
| 426 | * @param[out] msg - Message will be written to this |
| 427 | * @param[in] payload_length - Length of response message payload |
| 428 | * @return pldm_completion_codes |
| 429 | * @note Caller is responsible for memory alloc and dealloc of param |
| 430 | * 'msg.body.payload' |
| 431 | */ |
| 432 | int encode_set_date_time_resp(uint8_t instance_id, uint8_t completion_code, |
| 433 | struct pldm_msg *msg, size_t payload_length); |
| 434 | |
| 435 | /** @brief Decode a SetDateTime response message |
| 436 | * |
| 437 | * @param[in] msg - Response message |
| 438 | * @param[in] payload_length - Length of response message payload |
| 439 | * @param[out] completion_code - Pointer to response msg's PLDM completion code |
| 440 | * @return pldm_completion_codes |
| 441 | */ |
| 442 | int decode_set_date_time_resp(const struct pldm_msg *msg, size_t payload_length, |
| 443 | uint8_t *completion_code); |
| 444 | |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 445 | #ifdef __cplusplus |
| 446 | } |
| 447 | #endif |
| 448 | |
| 449 | #endif /* BIOS_H */ |