selcommands.cpp (15a7ae810e7f63a2db6766b033c0e44ab4f9d312) | selcommands.cpp (63c99be4ac026a326d6953d608376edb0e60007a) |
---|---|
1/* 2 * Copyright (c) 2018 Intel Corporation. 3 * Copyright (c) 2018-present Facebook. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 | 1/* 2 * Copyright (c) 2018 Intel Corporation. 3 * Copyright (c) 2018-present Facebook. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 |
18#include <ipmid/api.hpp> 19 | |
20#include <boost/algorithm/string/join.hpp> | 18#include <boost/algorithm/string/join.hpp> |
19#include <ipmid/api.hpp> |
|
21#include <nlohmann/json.hpp> | 20#include <nlohmann/json.hpp> |
22#include <iostream> 23#include <sstream> 24#include <fstream> | |
25#include <phosphor-logging/log.hpp> 26#include <sdbusplus/message/types.hpp> 27#include <sdbusplus/timer.hpp> 28#include <storagecommands.hpp> 29 | 21#include <phosphor-logging/log.hpp> 22#include <sdbusplus/message/types.hpp> 23#include <sdbusplus/timer.hpp> 24#include <storagecommands.hpp> 25 |
26#include <fstream> 27#include <iostream> 28#include <sstream> 29 |
|
30//---------------------------------------------------------------------- 31// Platform specific functions for storing app data 32//---------------------------------------------------------------------- 33 34static std::string byteToStr(uint8_t byte) 35{ 36 std::stringstream ss; 37 38 ss << std::hex << std::uppercase << std::setfill('0'); 39 ss << std::setw(2) << (int)byte; 40 41 return ss.str(); 42} 43 | 30//---------------------------------------------------------------------- 31// Platform specific functions for storing app data 32//---------------------------------------------------------------------- 33 34static std::string byteToStr(uint8_t byte) 35{ 36 std::stringstream ss; 37 38 ss << std::hex << std::uppercase << std::setfill('0'); 39 ss << std::setw(2) << (int)byte; 40 41 return ss.str(); 42} 43 |
44static void toHexStr(std::vector<uint8_t> &bytes, std::string &hexStr) | 44static void toHexStr(std::vector<uint8_t>& bytes, std::string& hexStr) |
45{ 46 std::stringstream stream; 47 stream << std::hex << std::uppercase << std::setfill('0'); 48 for (const uint8_t byte : bytes) 49 { 50 stream << std::setw(2) << static_cast<int>(byte); 51 } 52 hexStr = stream.str(); 53} 54 | 45{ 46 std::stringstream stream; 47 stream << std::hex << std::uppercase << std::setfill('0'); 48 for (const uint8_t byte : bytes) 49 { 50 stream << std::setw(2) << static_cast<int>(byte); 51 } 52 hexStr = stream.str(); 53} 54 |
55static int fromHexStr(const std::string hexStr, std::vector<uint8_t> &data) | 55static int fromHexStr(const std::string hexStr, std::vector<uint8_t>& data) |
56{ 57 for (unsigned int i = 0; i < hexStr.size(); i += 2) 58 { 59 try 60 { 61 data.push_back(static_cast<uint8_t>( 62 std::stoul(hexStr.substr(i, 2), nullptr, 16))); 63 } | 56{ 57 for (unsigned int i = 0; i < hexStr.size(); i += 2) 58 { 59 try 60 { 61 data.push_back(static_cast<uint8_t>( 62 std::stoul(hexStr.substr(i, 2), nullptr, 16))); 63 } |
64 catch (std::invalid_argument &e) | 64 catch (std::invalid_argument& e) |
65 { 66 phosphor::logging::log<phosphor::logging::level::ERR>(e.what()); 67 return -1; 68 } | 65 { 66 phosphor::logging::log<phosphor::logging::level::ERR>(e.what()); 67 return -1; 68 } |
69 catch (std::out_of_range &e) | 69 catch (std::out_of_range& e) |
70 { 71 phosphor::logging::log<phosphor::logging::level::ERR>(e.what()); 72 return -1; 73 } 74 } 75 return 0; 76} 77 --- 58 unchanged lines hidden (view full) --- 136 return 0; 137 } 138 139 uint32_t getCount() 140 { 141 return selDataObj[KEY_SEL_COUNT]; 142 } 143 | 70 { 71 phosphor::logging::log<phosphor::logging::level::ERR>(e.what()); 72 return -1; 73 } 74 } 75 return 0; 76} 77 --- 58 unchanged lines hidden (view full) --- 136 return 0; 137 } 138 139 uint32_t getCount() 140 { 141 return selDataObj[KEY_SEL_COUNT]; 142 } 143 |
144 void getInfo(GetSELInfoData &info) | 144 void getInfo(GetSELInfoData& info) |
145 { 146 info.selVersion = selDataObj[KEY_SEL_VER]; 147 info.entries = selDataObj[KEY_SEL_COUNT]; 148 info.freeSpace = selDataObj[KEY_FREE_SPACE]; 149 info.addTimeStamp = selDataObj[KEY_ADD_TIME]; 150 info.eraseTimeStamp = selDataObj[KEY_ERASE_TIME]; 151 info.operationSupport = selDataObj[KEY_OPER_SUPP]; 152 } 153 | 145 { 146 info.selVersion = selDataObj[KEY_SEL_VER]; 147 info.entries = selDataObj[KEY_SEL_COUNT]; 148 info.freeSpace = selDataObj[KEY_FREE_SPACE]; 149 info.addTimeStamp = selDataObj[KEY_ADD_TIME]; 150 info.eraseTimeStamp = selDataObj[KEY_ERASE_TIME]; 151 info.operationSupport = selDataObj[KEY_OPER_SUPP]; 152 } 153 |
154 int getEntry(uint32_t index, std::string &rawStr) | 154 int getEntry(uint32_t index, std::string& rawStr) |
155 { 156 std::stringstream ss; 157 ss << std::hex; 158 ss << std::setw(2) << std::setfill('0') << index; 159 160 /* Check or the requested SEL Entry, if record is available */ 161 if (selDataObj.find(ss.str()) == selDataObj.end()) 162 { --- 38 unchanged lines hidden (view full) --- 201 202/*Used by decoding ME event*/ 203std::vector<std::string> nmDomName = { 204 "Entire Platform", "CPU Subsystem", 205 "Memory Subsystem", "HW Protection", 206 "High Power I/O subsystem", "Unknown"}; 207 208/* Default log message for unknown type */ | 155 { 156 std::stringstream ss; 157 ss << std::hex; 158 ss << std::setw(2) << std::setfill('0') << index; 159 160 /* Check or the requested SEL Entry, if record is available */ 161 if (selDataObj.find(ss.str()) == selDataObj.end()) 162 { --- 38 unchanged lines hidden (view full) --- 201 202/*Used by decoding ME event*/ 203std::vector<std::string> nmDomName = { 204 "Entire Platform", "CPU Subsystem", 205 "Memory Subsystem", "HW Protection", 206 "High Power I/O subsystem", "Unknown"}; 207 208/* Default log message for unknown type */ |
209static void logDefault(uint8_t *data, std::string &errLog) | 209static void logDefault(uint8_t* data, std::string& errLog) |
210{ 211 errLog = "Unknown"; 212} 213 | 210{ 211 errLog = "Unknown"; 212} 213 |
214static void logSysEvent(uint8_t *data, std::string &errLog) | 214static void logSysEvent(uint8_t* data, std::string& errLog) |
215{ 216 if (data[0] == 0xE5) 217 { 218 errLog = "Cause of Time change - "; 219 switch (data[2]) 220 { 221 case 0x00: 222 errLog += "NTP"; --- 17 unchanged lines hidden (view full) --- 240 errLog += " - Second Time"; 241 } 242 else 243 { 244 errLog = "Unknown"; 245 } 246} 247 | 215{ 216 if (data[0] == 0xE5) 217 { 218 errLog = "Cause of Time change - "; 219 switch (data[2]) 220 { 221 case 0x00: 222 errLog += "NTP"; --- 17 unchanged lines hidden (view full) --- 240 errLog += " - Second Time"; 241 } 242 else 243 { 244 errLog = "Unknown"; 245 } 246} 247 |
248static void logThermalEvent(uint8_t *data, std::string &errLog) | 248static void logThermalEvent(uint8_t* data, std::string& errLog) |
249{ 250 if (data[0] == 0x1) 251 { 252 errLog = "Limit Exceeded"; 253 } 254 else 255 { 256 errLog = "Unknown"; 257 } 258} 259 | 249{ 250 if (data[0] == 0x1) 251 { 252 errLog = "Limit Exceeded"; 253 } 254 else 255 { 256 errLog = "Unknown"; 257 } 258} 259 |
260static void logCritIrq(uint8_t *data, std::string &errLog) | 260static void logCritIrq(uint8_t* data, std::string& errLog) |
261{ 262 263 if (data[0] == 0x0) 264 { 265 errLog = "NMI / Diagnostic Interrupt"; 266 } 267 else if (data[0] == 0x03) 268 { 269 errLog = "Software NMI"; 270 } 271 else 272 { 273 errLog = "Unknown"; 274 } 275 276 /* TODO: Call add_cri_sel for CRITICAL_IRQ */ 277} 278 | 261{ 262 263 if (data[0] == 0x0) 264 { 265 errLog = "NMI / Diagnostic Interrupt"; 266 } 267 else if (data[0] == 0x03) 268 { 269 errLog = "Software NMI"; 270 } 271 else 272 { 273 errLog = "Unknown"; 274 } 275 276 /* TODO: Call add_cri_sel for CRITICAL_IRQ */ 277} 278 |
279static void logPostErr(uint8_t *data, std::string &errLog) | 279static void logPostErr(uint8_t* data, std::string& errLog) |
280{ 281 282 if ((data[0] & 0x0F) == 0x0) 283 { 284 errLog = "System Firmware Error"; 285 } 286 else 287 { --- 22 unchanged lines hidden (view full) --- 310 errLog += ", System Firmware Corruption Detected"; 311 break; 312 case 0xA10B: 313 errLog += ", TPM Self-Test FAIL Detected"; 314 } 315 } 316} 317 | 280{ 281 282 if ((data[0] & 0x0F) == 0x0) 283 { 284 errLog = "System Firmware Error"; 285 } 286 else 287 { --- 22 unchanged lines hidden (view full) --- 310 errLog += ", System Firmware Corruption Detected"; 311 break; 312 case 0xA10B: 313 errLog += ", TPM Self-Test FAIL Detected"; 314 } 315 } 316} 317 |
318static void logMchChkErr(uint8_t *data, std::string &errLog) | 318static void logMchChkErr(uint8_t* data, std::string& errLog) |
319{ 320 /* TODO: Call add_cri_sel for CRITICAL_IRQ */ 321 if ((data[0] & 0x0F) == 0x0B) 322 { 323 errLog = "Uncorrectable"; 324 } 325 else if ((data[0] & 0x0F) == 0x0C) 326 { --- 4 unchanged lines hidden (view full) --- 331 errLog = "Unknown"; 332 } 333 334 errLog += ", Machine Check bank Number " + std::to_string(data[1]) + 335 ", CPU " + std::to_string(data[2] >> 5) + ", Core " + 336 std::to_string(data[2] & 0x1F); 337} 338 | 319{ 320 /* TODO: Call add_cri_sel for CRITICAL_IRQ */ 321 if ((data[0] & 0x0F) == 0x0B) 322 { 323 errLog = "Uncorrectable"; 324 } 325 else if ((data[0] & 0x0F) == 0x0C) 326 { --- 4 unchanged lines hidden (view full) --- 331 errLog = "Unknown"; 332 } 333 334 errLog += ", Machine Check bank Number " + std::to_string(data[1]) + 335 ", CPU " + std::to_string(data[2] >> 5) + ", Core " + 336 std::to_string(data[2] & 0x1F); 337} 338 |
339static void logPcieErr(uint8_t *data, std::string &errLog) | 339static void logPcieErr(uint8_t* data, std::string& errLog) |
340{ 341 std::stringstream tmp1, tmp2; 342 tmp1 << std::hex << std::uppercase << std::setfill('0'); 343 tmp2 << std::hex << std::uppercase << std::setfill('0'); 344 tmp1 << " (Bus " << std::setw(2) << (int)(data[2]) << " / Dev " 345 << std::setw(2) << (int)(data[1] >> 3) << " / Fun " << std::setw(2) 346 << (int)(data[1] & 0x7) << ")"; 347 --- 9 unchanged lines hidden (view full) --- 357 errLog = "Correctable" + tmp1.str(); 358 break; 359 case 0x8: 360 errLog = "Uncorrectable" + tmp1.str(); 361 break; 362 case 0xA: 363 errLog = "Bus Fatal" + tmp1.str(); 364 break; | 340{ 341 std::stringstream tmp1, tmp2; 342 tmp1 << std::hex << std::uppercase << std::setfill('0'); 343 tmp2 << std::hex << std::uppercase << std::setfill('0'); 344 tmp1 << " (Bus " << std::setw(2) << (int)(data[2]) << " / Dev " 345 << std::setw(2) << (int)(data[1] >> 3) << " / Fun " << std::setw(2) 346 << (int)(data[1] & 0x7) << ")"; 347 --- 9 unchanged lines hidden (view full) --- 357 errLog = "Correctable" + tmp1.str(); 358 break; 359 case 0x8: 360 errLog = "Uncorrectable" + tmp1.str(); 361 break; 362 case 0xA: 363 errLog = "Bus Fatal" + tmp1.str(); 364 break; |
365 case 0xD: 366 { | 365 case 0xD: { |
367 uint32_t venId = (uint32_t)data[1] << 8 | (uint32_t)data[2]; 368 tmp2 << "Vendor ID: 0x" << std::setw(4) << venId; 369 errLog = tmp2.str(); 370 } 371 break; | 366 uint32_t venId = (uint32_t)data[1] << 8 | (uint32_t)data[2]; 367 tmp2 << "Vendor ID: 0x" << std::setw(4) << venId; 368 errLog = tmp2.str(); 369 } 370 break; |
372 case 0xE: 373 { | 371 case 0xE: { |
374 uint32_t devId = (uint32_t)data[1] << 8 | (uint32_t)data[2]; 375 tmp2 << "Device ID: 0x" << std::setw(4) << devId; 376 errLog = tmp2.str(); 377 } 378 break; 379 case 0xF: 380 tmp2 << "Error ID from downstream: 0x" << std::setw(2) 381 << (int)(data[1]) << std::setw(2) << (int)(data[2]); 382 errLog = tmp2.str(); 383 break; 384 default: 385 errLog = "Unknown"; 386 } 387} 388 | 372 uint32_t devId = (uint32_t)data[1] << 8 | (uint32_t)data[2]; 373 tmp2 << "Device ID: 0x" << std::setw(4) << devId; 374 errLog = tmp2.str(); 375 } 376 break; 377 case 0xF: 378 tmp2 << "Error ID from downstream: 0x" << std::setw(2) 379 << (int)(data[1]) << std::setw(2) << (int)(data[2]); 380 errLog = tmp2.str(); 381 break; 382 default: 383 errLog = "Unknown"; 384 } 385} 386 |
389static void logIioErr(uint8_t *data, std::string &errLog) | 387static void logIioErr(uint8_t* data, std::string& errLog) |
390{ 391 std::vector<std::string> tmpStr = { 392 "IRP0", "IRP1", " IIO-Core", "VT-d", "Intel Quick Data", 393 "Misc", " DMA", "ITC", "OTC", "CI"}; 394 395 if ((data[0] & 0xF) == 0) 396 { 397 errLog += "CPU " + std::to_string(data[2] >> 5) + ", Error ID 0x" + --- 9 unchanged lines hidden (view full) --- 407 } 408 } 409 else 410 { 411 errLog = "Unknown"; 412 } 413} 414 | 388{ 389 std::vector<std::string> tmpStr = { 390 "IRP0", "IRP1", " IIO-Core", "VT-d", "Intel Quick Data", 391 "Misc", " DMA", "ITC", "OTC", "CI"}; 392 393 if ((data[0] & 0xF) == 0) 394 { 395 errLog += "CPU " + std::to_string(data[2] >> 5) + ", Error ID 0x" + --- 9 unchanged lines hidden (view full) --- 405 } 406 } 407 else 408 { 409 errLog = "Unknown"; 410 } 411} 412 |
415static void logMemErr(uint8_t *dataPtr, std::string &errLog) | 413static void logMemErr(uint8_t* dataPtr, std::string& errLog) |
416{ 417 uint8_t snrType = dataPtr[0]; 418 uint8_t snrNum = dataPtr[1]; | 414{ 415 uint8_t snrType = dataPtr[0]; 416 uint8_t snrNum = dataPtr[1]; |
419 uint8_t *data = &(dataPtr[3]); | 417 uint8_t* data = &(dataPtr[3]); |
420 421 /* TODO: add pal_add_cri_sel */ 422 423 if (snrNum == memoryEccError) 424 { 425 /* SEL from MEMORY_ECC_ERR Sensor */ 426 switch (data[0] & 0x0F) 427 { --- 48 unchanged lines hidden (view full) --- 476 477 /* TODO: Verify these bits */ 478 std::string cpuStr = "CPU# " + std::to_string((data[2] & 0xE0) >> 5); 479 std::string chStr = "CHN# " + std::to_string((data[2] & 0x18) >> 3); 480 std::string dimmStr = "DIMM# " + std::to_string(data[2] & 0x7); 481 482 switch ((data[1] & 0xC) >> 2) 483 { | 418 419 /* TODO: add pal_add_cri_sel */ 420 421 if (snrNum == memoryEccError) 422 { 423 /* SEL from MEMORY_ECC_ERR Sensor */ 424 switch (data[0] & 0x0F) 425 { --- 48 unchanged lines hidden (view full) --- 474 475 /* TODO: Verify these bits */ 476 std::string cpuStr = "CPU# " + std::to_string((data[2] & 0xE0) >> 5); 477 std::string chStr = "CHN# " + std::to_string((data[2] & 0x18) >> 3); 478 std::string dimmStr = "DIMM# " + std::to_string(data[2] & 0x7); 479 480 switch ((data[1] & 0xC) >> 2) 481 { |
484 case 0x0: 485 { | 482 case 0x0: { |
486 487 /* All Info Valid */ 488 uint8_t chnNum = (data[2] & 0x1C) >> 2; 489 uint8_t dimmNum = data[2] & 0x3; 490 491 /* TODO: If critical SEL logging is available, do it */ 492 if (snrType == 0x0C) 493 { --- 29 unchanged lines hidden (view full) --- 523 case 0x3: 524 525 /* CPU info not valid */ 526 errLog += " (" + chStr + ", " + dimmStr + ")"; 527 break; 528 } 529} 530 | 483 484 /* All Info Valid */ 485 uint8_t chnNum = (data[2] & 0x1C) >> 2; 486 uint8_t dimmNum = data[2] & 0x3; 487 488 /* TODO: If critical SEL logging is available, do it */ 489 if (snrType == 0x0C) 490 { --- 29 unchanged lines hidden (view full) --- 520 case 0x3: 521 522 /* CPU info not valid */ 523 errLog += " (" + chStr + ", " + dimmStr + ")"; 524 break; 525 } 526} 527 |
531static void logPwrErr(uint8_t *data, std::string &errLog) | 528static void logPwrErr(uint8_t* data, std::string& errLog) |
532{ 533 534 if (data[0] == 0x1) 535 { 536 errLog = "SYS_PWROK failure"; 537 /* Also try logging to Critial log file, if available */ 538 /* "SYS_PWROK failure,FRU:1" */ 539 } --- 4 unchanged lines hidden (view full) --- 544 /* "PCH_PWROK failure,FRU:1" */ 545 } 546 else 547 { 548 errLog = "Unknown"; 549 } 550} 551 | 529{ 530 531 if (data[0] == 0x1) 532 { 533 errLog = "SYS_PWROK failure"; 534 /* Also try logging to Critial log file, if available */ 535 /* "SYS_PWROK failure,FRU:1" */ 536 } --- 4 unchanged lines hidden (view full) --- 541 /* "PCH_PWROK failure,FRU:1" */ 542 } 543 else 544 { 545 errLog = "Unknown"; 546 } 547} 548 |
552static void logCatErr(uint8_t *data, std::string &errLog) | 549static void logCatErr(uint8_t* data, std::string& errLog) |
553{ 554 555 if (data[0] == 0x0) 556 { 557 errLog = "IERR/CATERR"; 558 /* Also try logging to Critial log file, if available */ 559 /* "IERR,FRU:1 */ 560 } --- 4 unchanged lines hidden (view full) --- 565 /* "MCERR,FRU:1 */ 566 } 567 else 568 { 569 errLog = "Unknown"; 570 } 571} 572 | 550{ 551 552 if (data[0] == 0x0) 553 { 554 errLog = "IERR/CATERR"; 555 /* Also try logging to Critial log file, if available */ 556 /* "IERR,FRU:1 */ 557 } --- 4 unchanged lines hidden (view full) --- 562 /* "MCERR,FRU:1 */ 563 } 564 else 565 { 566 errLog = "Unknown"; 567 } 568} 569 |
573static void logDimmHot(uint8_t *data, std::string &errLog) | 570static void logDimmHot(uint8_t* data, std::string& errLog) |
574{ 575 if ((data[0] << 16 | data[1] << 8 | data[2]) == 0x01FFFF) 576 { 577 errLog = "SOC MEMHOT"; 578 } 579 else 580 { 581 errLog = "Unknown"; 582 /* Also try logging to Critial log file, if available */ 583 /* ""CPU_DIMM_HOT %s,FRU:1" */ 584 } 585} 586 | 571{ 572 if ((data[0] << 16 | data[1] << 8 | data[2]) == 0x01FFFF) 573 { 574 errLog = "SOC MEMHOT"; 575 } 576 else 577 { 578 errLog = "Unknown"; 579 /* Also try logging to Critial log file, if available */ 580 /* ""CPU_DIMM_HOT %s,FRU:1" */ 581 } 582} 583 |
587static void logSwNMI(uint8_t *data, std::string &errLog) | 584static void logSwNMI(uint8_t* data, std::string& errLog) |
588{ 589 if ((data[0] << 16 | data[1] << 8 | data[2]) == 0x03FFFF) 590 { 591 errLog = "Software NMI"; 592 } 593 else 594 { 595 errLog = "Unknown SW NMI"; 596 } 597} 598 | 585{ 586 if ((data[0] << 16 | data[1] << 8 | data[2]) == 0x03FFFF) 587 { 588 errLog = "Software NMI"; 589 } 590 else 591 { 592 errLog = "Unknown SW NMI"; 593 } 594} 595 |
599static void logCPUThermalSts(uint8_t *data, std::string &errLog) | 596static void logCPUThermalSts(uint8_t* data, std::string& errLog) |
600{ 601 switch (data[0]) 602 { 603 case 0x0: 604 errLog = "CPU Critical Temperature"; 605 break; 606 case 0x1: 607 errLog = "PROCHOT#"; 608 break; 609 case 0x2: 610 errLog = "TCC Activation"; 611 break; 612 default: 613 errLog = "Unknown"; 614 } 615} 616 | 597{ 598 switch (data[0]) 599 { 600 case 0x0: 601 errLog = "CPU Critical Temperature"; 602 break; 603 case 0x1: 604 errLog = "PROCHOT#"; 605 break; 606 case 0x2: 607 errLog = "TCC Activation"; 608 break; 609 default: 610 errLog = "Unknown"; 611 } 612} 613 |
617static void logMEPwrState(uint8_t *data, std::string &errLog) | 614static void logMEPwrState(uint8_t* data, std::string& errLog) |
618{ 619 switch (data[0]) 620 { 621 case 0: 622 errLog = "RUNNING"; 623 break; 624 case 2: 625 errLog = "POWER_OFF"; 626 break; 627 default: 628 errLog = "Unknown[" + std::to_string(data[0]) + "]"; 629 break; 630 } 631} 632 | 615{ 616 switch (data[0]) 617 { 618 case 0: 619 errLog = "RUNNING"; 620 break; 621 case 2: 622 errLog = "POWER_OFF"; 623 break; 624 default: 625 errLog = "Unknown[" + std::to_string(data[0]) + "]"; 626 break; 627 } 628} 629 |
633static void logSPSFwHealth(uint8_t *data, std::string &errLog) | 630static void logSPSFwHealth(uint8_t* data, std::string& errLog) |
634{ 635 if ((data[0] & 0x0F) == 0x00) 636 { 637 const std::vector<std::string> tmpStr = { 638 "Recovery GPIO forced", 639 "Image execution failed", 640 "Flash erase error", 641 "Flash state information", --- 28 unchanged lines hidden (view full) --- 670 errLog = "SMBus link failure"; 671 } 672 else 673 { 674 errLog = "Unknown"; 675 } 676} 677 | 631{ 632 if ((data[0] & 0x0F) == 0x00) 633 { 634 const std::vector<std::string> tmpStr = { 635 "Recovery GPIO forced", 636 "Image execution failed", 637 "Flash erase error", 638 "Flash state information", --- 28 unchanged lines hidden (view full) --- 667 errLog = "SMBus link failure"; 668 } 669 else 670 { 671 errLog = "Unknown"; 672 } 673} 674 |
678static void logNmExcA(uint8_t *data, std::string &errLog) | 675static void logNmExcA(uint8_t* data, std::string& errLog) |
679{ 680 /*NM4.0 #550710, Revision 1.95, and turn to p.155*/ 681 if (data[0] == 0xA8) 682 { 683 errLog = "Policy Correction Time Exceeded"; 684 } 685 else 686 { 687 errLog = "Unknown"; 688 } 689} 690 | 676{ 677 /*NM4.0 #550710, Revision 1.95, and turn to p.155*/ 678 if (data[0] == 0xA8) 679 { 680 errLog = "Policy Correction Time Exceeded"; 681 } 682 else 683 { 684 errLog = "Unknown"; 685 } 686} 687 |
691static void logPCHThermal(uint8_t *data, std::string &errLog) | 688static void logPCHThermal(uint8_t* data, std::string& errLog) |
692{ 693 const std::vector<std::string> thresEvtName = {"Lower Non-critical", 694 "Unknown", 695 "Lower Critical", 696 "Unknown", 697 "Lower Non-recoverable", 698 "Unknown", 699 "Unknown", --- 11 unchanged lines hidden (view full) --- 711 { 712 errLog = "Unknown"; 713 } 714 715 errLog += ", curr_val: " + std::to_string(data[1]) + 716 " C, thresh_val: " + std::to_string(data[2]) + " C"; 717} 718 | 689{ 690 const std::vector<std::string> thresEvtName = {"Lower Non-critical", 691 "Unknown", 692 "Lower Critical", 693 "Unknown", 694 "Lower Non-recoverable", 695 "Unknown", 696 "Unknown", --- 11 unchanged lines hidden (view full) --- 708 { 709 errLog = "Unknown"; 710 } 711 712 errLog += ", curr_val: " + std::to_string(data[1]) + 713 " C, thresh_val: " + std::to_string(data[2]) + " C"; 714} 715 |
719static void logNmHealth(uint8_t *data, std::string &errLog) | 716static void logNmHealth(uint8_t* data, std::string& errLog) |
720{ 721 std::vector<std::string> nmErrType = { 722 "Unknown", 723 "Unknown", 724 "Unknown", 725 "Unknown", 726 "Unknown", 727 "Unknown", --- 21 unchanged lines hidden (view full) --- 749 errLog = "Unknown"; 750 } 751 752 errLog += ", Domain:" + nmDomName[domIdx] + 753 ", ErrType:" + nmErrType[errIdx] + ", Err:0x" + 754 byteToStr(data[2]); 755} 756 | 717{ 718 std::vector<std::string> nmErrType = { 719 "Unknown", 720 "Unknown", 721 "Unknown", 722 "Unknown", 723 "Unknown", 724 "Unknown", --- 21 unchanged lines hidden (view full) --- 746 errLog = "Unknown"; 747 } 748 749 errLog += ", Domain:" + nmDomName[domIdx] + 750 ", ErrType:" + nmErrType[errIdx] + ", Err:0x" + 751 byteToStr(data[2]); 752} 753 |
757static void logNmCap(uint8_t *data, std::string &errLog) | 754static void logNmCap(uint8_t* data, std::string& errLog) |
758{ 759 760 const std::vector<std::string> nmCapStsStr = {"Not Available", "Available"}; 761 if (data[0] & 0x7) // BIT1=policy, BIT2=monitoring, BIT3=pwr 762 // limit and the others are reserved 763 { 764 errLog = "PolicyInterface:" + nmCapStsStr[BIT(data[0], 0)] + 765 ",Monitoring:" + nmCapStsStr[BIT(data[0], 1)] + 766 ",PowerLimit:" + nmCapStsStr[BIT(data[0], 2)]; 767 } 768 else 769 { 770 errLog = "Unknown"; 771 } 772} 773 | 755{ 756 757 const std::vector<std::string> nmCapStsStr = {"Not Available", "Available"}; 758 if (data[0] & 0x7) // BIT1=policy, BIT2=monitoring, BIT3=pwr 759 // limit and the others are reserved 760 { 761 errLog = "PolicyInterface:" + nmCapStsStr[BIT(data[0], 0)] + 762 ",Monitoring:" + nmCapStsStr[BIT(data[0], 1)] + 763 ",PowerLimit:" + nmCapStsStr[BIT(data[0], 2)]; 764 } 765 else 766 { 767 errLog = "Unknown"; 768 } 769} 770 |
774static void logNmThreshold(uint8_t *data, std::string &errLog) | 771static void logNmThreshold(uint8_t* data, std::string& errLog) |
775{ 776 uint8_t thresNum = (data[0] & 0x3); 777 uint8_t domIdx = (data[1] & 0xf); 778 uint8_t polId = data[2]; 779 uint8_t polEvtIdx = BIT(data[0], 3); 780 const std::vector<std::string> polEvtStr = { 781 "Threshold Exceeded", "Policy Correction Time Exceeded"}; 782 783 errLog = "Threshold Number:" + std::to_string(thresNum) + "-" + 784 polEvtStr[polEvtIdx] + ", Domain:" + nmDomName[domIdx] + 785 ", PolicyID:0x" + byteToStr(polId); 786} 787 | 772{ 773 uint8_t thresNum = (data[0] & 0x3); 774 uint8_t domIdx = (data[1] & 0xf); 775 uint8_t polId = data[2]; 776 uint8_t polEvtIdx = BIT(data[0], 3); 777 const std::vector<std::string> polEvtStr = { 778 "Threshold Exceeded", "Policy Correction Time Exceeded"}; 779 780 errLog = "Threshold Number:" + std::to_string(thresNum) + "-" + 781 polEvtStr[polEvtIdx] + ", Domain:" + nmDomName[domIdx] + 782 ", PolicyID:0x" + byteToStr(polId); 783} 784 |
788static void logPwrThreshold(uint8_t *data, std::string &errLog) | 785static void logPwrThreshold(uint8_t* data, std::string& errLog) |
789{ 790 if (data[0] == 0x00) 791 { 792 errLog = "Limit Not Exceeded"; 793 } 794 else if (data[0] == 0x01) 795 { 796 errLog = "Limit Exceeded"; 797 } 798 else 799 { 800 errLog = "Unknown"; 801 } 802} 803 | 786{ 787 if (data[0] == 0x00) 788 { 789 errLog = "Limit Not Exceeded"; 790 } 791 else if (data[0] == 0x01) 792 { 793 errLog = "Limit Exceeded"; 794 } 795 else 796 { 797 errLog = "Unknown"; 798 } 799} 800 |
804static void logMSMI(uint8_t *data, std::string &errLog) | 801static void logMSMI(uint8_t* data, std::string& errLog) |
805{ 806 807 if (data[0] == 0x0) 808 { 809 errLog = "IERR/MSMI"; 810 } 811 else if (data[0] == 0x0B) 812 { 813 errLog = "MCERR/MSMI"; 814 } 815 else 816 { 817 errLog = "Unknown"; 818 } 819} 820 | 802{ 803 804 if (data[0] == 0x0) 805 { 806 errLog = "IERR/MSMI"; 807 } 808 else if (data[0] == 0x0B) 809 { 810 errLog = "MCERR/MSMI"; 811 } 812 else 813 { 814 errLog = "Unknown"; 815 } 816} 817 |
821static void logHprWarn(uint8_t *data, std::string &errLog) | 818static void logHprWarn(uint8_t* data, std::string& errLog) |
822{ 823 if (data[2] == 0x01) 824 { 825 if (data[1] == 0xFF) 826 { 827 errLog = "Infinite Time"; 828 } 829 else --- 4 unchanged lines hidden (view full) --- 834 else 835 { 836 errLog = "Unknown"; 837 } 838} 839 840static const boost::container::flat_map< 841 uint8_t, | 819{ 820 if (data[2] == 0x01) 821 { 822 if (data[1] == 0xFF) 823 { 824 errLog = "Infinite Time"; 825 } 826 else --- 4 unchanged lines hidden (view full) --- 831 else 832 { 833 errLog = "Unknown"; 834 } 835} 836 837static const boost::container::flat_map< 838 uint8_t, |
842 std::pair<std::string, std::function<void(uint8_t *, std::string &)>>> | 839 std::pair<std::string, std::function<void(uint8_t*, std::string&)>>> |
843 sensorNameTable = {{0xE9, {"SYSTEM_EVENT", logSysEvent}}, 844 {0x7D, {"THERM_THRESH_EVT", logThermalEvent}}, 845 {0xAA, {"BUTTON", logDefault}}, 846 {0xAB, {"POWER_STATE", logDefault}}, 847 {0xEA, {"CRITICAL_IRQ", logCritIrq}}, 848 {0x2B, {"POST_ERROR", logPostErr}}, 849 {0x40, {"MACHINE_CHK_ERR", logMchChkErr}}, 850 {0x41, {"PCIE_ERR", logPcieErr}}, --- 14 unchanged lines hidden (view full) --- 865 {0x08, {"PCH_THERM_THRESHOLD", logPCHThermal}}, 866 {0x19, {"NM_HEALTH", logNmHealth}}, 867 {0x1A, {"NM_CAPABILITIES", logNmCap}}, 868 {0x1B, {"NM_THRESHOLD", logNmThreshold}}, 869 {0x3B, {"PWR_THRESH_EVT", logPwrThreshold}}, 870 {0xE7, {"MSMI", logMSMI}}, 871 {0xC5, {"HPR_WARNING", logHprWarn}}}; 872 | 840 sensorNameTable = {{0xE9, {"SYSTEM_EVENT", logSysEvent}}, 841 {0x7D, {"THERM_THRESH_EVT", logThermalEvent}}, 842 {0xAA, {"BUTTON", logDefault}}, 843 {0xAB, {"POWER_STATE", logDefault}}, 844 {0xEA, {"CRITICAL_IRQ", logCritIrq}}, 845 {0x2B, {"POST_ERROR", logPostErr}}, 846 {0x40, {"MACHINE_CHK_ERR", logMchChkErr}}, 847 {0x41, {"PCIE_ERR", logPcieErr}}, --- 14 unchanged lines hidden (view full) --- 862 {0x08, {"PCH_THERM_THRESHOLD", logPCHThermal}}, 863 {0x19, {"NM_HEALTH", logNmHealth}}, 864 {0x1A, {"NM_CAPABILITIES", logNmCap}}, 865 {0x1B, {"NM_THRESHOLD", logNmThreshold}}, 866 {0x3B, {"PWR_THRESH_EVT", logPwrThreshold}}, 867 {0xE7, {"MSMI", logMSMI}}, 868 {0xC5, {"HPR_WARNING", logHprWarn}}}; 869 |
873static void parseSelHelper(StdSELEntry *data, std::string &errStr) | 870static void parseSelHelper(StdSELEntry* data, std::string& errStr) |
874{ 875 876 /* Check if sensor type is OS_BOOT (0x1f) */ 877 if (data->sensorType == 0x1F) 878 { 879 /* OS_BOOT used by OS */ 880 switch (data->eventData1 & 0xF) 881 { --- 41 unchanged lines hidden (view full) --- 923 errStr += " Assertion"; 924 } 925 else 926 { 927 errStr += " Deassertion"; 928 } 929} 930 | 871{ 872 873 /* Check if sensor type is OS_BOOT (0x1f) */ 874 if (data->sensorType == 0x1F) 875 { 876 /* OS_BOOT used by OS */ 877 switch (data->eventData1 & 0xF) 878 { --- 41 unchanged lines hidden (view full) --- 920 errStr += " Assertion"; 921 } 922 else 923 { 924 errStr += " Deassertion"; 925 } 926} 927 |
931static void parseStdSel(StdSELEntry *data, std::string &errStr) | 928static void parseStdSel(StdSELEntry* data, std::string& errStr) |
932{ 933 std::stringstream tmpStream; 934 tmpStream << std::hex << std::uppercase; 935 936 /* TODO: add pal_add_cri_sel */ 937 switch (data->sensorNum) 938 { 939 case memoryEccError: --- 62 unchanged lines hidden (view full) --- 1002 else 1003 { 1004 errStr += " Deassertion"; 1005 } 1006 1007 return; 1008} 1009 | 929{ 930 std::stringstream tmpStream; 931 tmpStream << std::hex << std::uppercase; 932 933 /* TODO: add pal_add_cri_sel */ 934 switch (data->sensorNum) 935 { 936 case memoryEccError: --- 62 unchanged lines hidden (view full) --- 999 else 1000 { 1001 errStr += " Deassertion"; 1002 } 1003 1004 return; 1005} 1006 |
1010static void parseOemSel(TsOemSELEntry *data, std::string &errStr) | 1007static void parseOemSel(TsOemSELEntry* data, std::string& errStr) |
1011{ 1012 std::stringstream tmpStream; 1013 tmpStream << std::hex << std::uppercase << std::setfill('0'); 1014 1015 switch (data->recordType) 1016 { 1017 case 0xC0: 1018 tmpStream << "VID:0x" << std::setw(2) << (int)data->oemData[1] --- 24 unchanged lines hidden (view full) --- 1043 << (int)data->oemData[5]; 1044 } 1045 1046 errStr = tmpStream.str(); 1047 1048 return; 1049} 1050 | 1008{ 1009 std::stringstream tmpStream; 1010 tmpStream << std::hex << std::uppercase << std::setfill('0'); 1011 1012 switch (data->recordType) 1013 { 1014 case 0xC0: 1015 tmpStream << "VID:0x" << std::setw(2) << (int)data->oemData[1] --- 24 unchanged lines hidden (view full) --- 1040 << (int)data->oemData[5]; 1041 } 1042 1043 errStr = tmpStream.str(); 1044 1045 return; 1046} 1047 |
1051static void parseOemUnifiedSel(NtsOemSELEntry *data, std::string &errStr) | 1048static void parseOemUnifiedSel(NtsOemSELEntry* data, std::string& errStr) |
1052{ | 1049{ |
1053 uint8_t *ptr = data->oemData; | 1050 uint8_t* ptr = data->oemData; |
1054 int genInfo = ptr[0]; 1055 int errType = genInfo & 0x0f; 1056 std::vector<std::string> dimmEvent = { 1057 "Memory training failure", "Memory correctable error", 1058 "Memory uncorrectable error", "Reserved"}; 1059 1060 std::stringstream tmpStream; 1061 tmpStream << std::hex << std::uppercase << std::setfill('0'); --- 36 unchanged lines hidden (view full) --- 1098 << "), Raw: " << oemDataStr; 1099 } 1100 1101 errStr = tmpStream.str(); 1102 1103 return; 1104} 1105 | 1051 int genInfo = ptr[0]; 1052 int errType = genInfo & 0x0f; 1053 std::vector<std::string> dimmEvent = { 1054 "Memory training failure", "Memory correctable error", 1055 "Memory uncorrectable error", "Reserved"}; 1056 1057 std::stringstream tmpStream; 1058 tmpStream << std::hex << std::uppercase << std::setfill('0'); --- 36 unchanged lines hidden (view full) --- 1095 << "), Raw: " << oemDataStr; 1096 } 1097 1098 errStr = tmpStream.str(); 1099 1100 return; 1101} 1102 |
1106static void parseSelData(std::vector<uint8_t> &reqData, std::string &msgLog) | 1103static void parseSelData(std::vector<uint8_t>& reqData, std::string& msgLog) |
1107{ 1108 1109 /* Get record type */ 1110 int recType = reqData[2]; 1111 std::string errType, errLog; 1112 | 1104{ 1105 1106 /* Get record type */ 1107 int recType = reqData[2]; 1108 std::string errType, errLog; 1109 |
1113 uint8_t *ptr = NULL; | 1110 uint8_t* ptr = NULL; |
1114 1115 std::stringstream recTypeStream; 1116 recTypeStream << std::hex << std::uppercase << std::setfill('0') 1117 << std::setw(2) << recType; 1118 1119 msgLog = "SEL Entry: FRU: 1, Record: "; 1120 1121 if (recType == stdErrType) 1122 { | 1111 1112 std::stringstream recTypeStream; 1113 recTypeStream << std::hex << std::uppercase << std::setfill('0') 1114 << std::setw(2) << recType; 1115 1116 msgLog = "SEL Entry: FRU: 1, Record: "; 1117 1118 if (recType == stdErrType) 1119 { |
1123 StdSELEntry *data = reinterpret_cast<StdSELEntry *>(&reqData[0]); | 1120 StdSELEntry* data = reinterpret_cast<StdSELEntry*>(&reqData[0]); |
1124 std::string sensorName; 1125 1126 errType = stdErr; 1127 if (data->sensorType == 0x1F) 1128 { 1129 sensorName = "OS"; 1130 } 1131 else --- 4 unchanged lines hidden (view full) --- 1136 sensorName = "Unknown"; 1137 } 1138 else 1139 { 1140 sensorName = findSensorName->second.first; 1141 } 1142 } 1143 | 1121 std::string sensorName; 1122 1123 errType = stdErr; 1124 if (data->sensorType == 0x1F) 1125 { 1126 sensorName = "OS"; 1127 } 1128 else --- 4 unchanged lines hidden (view full) --- 1133 sensorName = "Unknown"; 1134 } 1135 else 1136 { 1137 sensorName = findSensorName->second.first; 1138 } 1139 } 1140 |
1144 std::tm *ts = localtime((time_t *)(&(data->timeStamp))); | 1141 std::tm* ts = localtime((time_t*)(&(data->timeStamp))); |
1145 std::string timeStr = std::asctime(ts); 1146 1147 parseStdSel(data, errLog); 1148 ptr = &(data->eventData1); 1149 std::vector<uint8_t> evtData(ptr, ptr + 3); 1150 std::string eventData; 1151 toHexStr(evtData, eventData); 1152 --- 4 unchanged lines hidden (view full) --- 1157 msgLog += errType + " (0x" + recTypeStream.str() + 1158 "), Time: " + timeStr + ", Sensor: " + sensorName + " (0x" + 1159 senNumStream.str() + "), Event Data: (" + eventData + ") " + 1160 errLog; 1161 } 1162 else if ((recType >= oemTSErrTypeMin) && (recType <= oemTSErrTypeMax)) 1163 { 1164 /* timestamped OEM SEL records */ | 1142 std::string timeStr = std::asctime(ts); 1143 1144 parseStdSel(data, errLog); 1145 ptr = &(data->eventData1); 1146 std::vector<uint8_t> evtData(ptr, ptr + 3); 1147 std::string eventData; 1148 toHexStr(evtData, eventData); 1149 --- 4 unchanged lines hidden (view full) --- 1154 msgLog += errType + " (0x" + recTypeStream.str() + 1155 "), Time: " + timeStr + ", Sensor: " + sensorName + " (0x" + 1156 senNumStream.str() + "), Event Data: (" + eventData + ") " + 1157 errLog; 1158 } 1159 else if ((recType >= oemTSErrTypeMin) && (recType <= oemTSErrTypeMax)) 1160 { 1161 /* timestamped OEM SEL records */ |
1165 TsOemSELEntry *data = reinterpret_cast<TsOemSELEntry *>(&reqData[0]); | 1162 TsOemSELEntry* data = reinterpret_cast<TsOemSELEntry*>(&reqData[0]); |
1166 ptr = data->mfrId; 1167 std::vector<uint8_t> mfrIdData(ptr, ptr + 3); 1168 std::string mfrIdStr; 1169 toHexStr(mfrIdData, mfrIdStr); 1170 1171 ptr = data->oemData; 1172 std::vector<uint8_t> oemData(ptr, ptr + 6); 1173 std::string oemDataStr; 1174 toHexStr(oemData, oemDataStr); 1175 | 1163 ptr = data->mfrId; 1164 std::vector<uint8_t> mfrIdData(ptr, ptr + 3); 1165 std::string mfrIdStr; 1166 toHexStr(mfrIdData, mfrIdStr); 1167 1168 ptr = data->oemData; 1169 std::vector<uint8_t> oemData(ptr, ptr + 6); 1170 std::string oemDataStr; 1171 toHexStr(oemData, oemDataStr); 1172 |
1176 std::tm *ts = localtime((time_t *)(&(data->timeStamp))); | 1173 std::tm* ts = localtime((time_t*)(&(data->timeStamp))); |
1177 std::string timeStr = std::asctime(ts); 1178 1179 errType = oemTSErr; 1180 parseOemSel(data, errLog); 1181 1182 msgLog += errType + " (0x" + recTypeStream.str() + 1183 "), Time: " + timeStr + ", MFG ID: " + mfrIdStr + 1184 ", OEM Data: (" + oemDataStr + ") " + errLog; 1185 } 1186 else if (recType == fbUniErrType) 1187 { | 1174 std::string timeStr = std::asctime(ts); 1175 1176 errType = oemTSErr; 1177 parseOemSel(data, errLog); 1178 1179 msgLog += errType + " (0x" + recTypeStream.str() + 1180 "), Time: " + timeStr + ", MFG ID: " + mfrIdStr + 1181 ", OEM Data: (" + oemDataStr + ") " + errLog; 1182 } 1183 else if (recType == fbUniErrType) 1184 { |
1188 NtsOemSELEntry *data = reinterpret_cast<NtsOemSELEntry *>(&reqData[0]); | 1185 NtsOemSELEntry* data = reinterpret_cast<NtsOemSELEntry*>(&reqData[0]); |
1189 errType = fbUniSELErr; 1190 parseOemUnifiedSel(data, errLog); 1191 msgLog += errType + " (0x" + recTypeStream.str() + "), " + errLog; 1192 } 1193 else if ((recType >= oemNTSErrTypeMin) && (recType <= oemNTSErrTypeMax)) 1194 { 1195 /* Non timestamped OEM SEL records */ | 1186 errType = fbUniSELErr; 1187 parseOemUnifiedSel(data, errLog); 1188 msgLog += errType + " (0x" + recTypeStream.str() + "), " + errLog; 1189 } 1190 else if ((recType >= oemNTSErrTypeMin) && (recType <= oemNTSErrTypeMax)) 1191 { 1192 /* Non timestamped OEM SEL records */ |
1196 NtsOemSELEntry *data = reinterpret_cast<NtsOemSELEntry *>(&reqData[0]); | 1193 NtsOemSELEntry* data = reinterpret_cast<NtsOemSELEntry*>(&reqData[0]); |
1197 errType = oemNTSErr; 1198 1199 ptr = data->oemData; 1200 std::vector<uint8_t> oemData(ptr, ptr + 13); 1201 std::string oemDataStr; 1202 toHexStr(oemData, oemDataStr); 1203 | 1194 errType = oemNTSErr; 1195 1196 ptr = data->oemData; 1197 std::vector<uint8_t> oemData(ptr, ptr + 13); 1198 std::string oemDataStr; 1199 toHexStr(oemData, oemDataStr); 1200 |
1204 parseOemSel((TsOemSELEntry *)data, errLog); | 1201 parseOemSel((TsOemSELEntry*)data, errLog); |
1205 msgLog += errType + " (0x" + recTypeStream.str() + "), OEM Data: (" + 1206 oemDataStr + ") " + errLog; 1207 } 1208 else 1209 { 1210 errType = unknownErr; 1211 toHexStr(reqData, errLog); 1212 msgLog += --- 33 unchanged lines hidden (view full) --- 1246 ipmiStorageGetSELEntry(std::vector<uint8_t> data) 1247{ 1248 1249 if (data.size() != sizeof(fb_oem::ipmi::sel::GetSELEntryRequest)) 1250 { 1251 return ipmi::responseReqDataLenInvalid(); 1252 } 1253 | 1202 msgLog += errType + " (0x" + recTypeStream.str() + "), OEM Data: (" + 1203 oemDataStr + ") " + errLog; 1204 } 1205 else 1206 { 1207 errType = unknownErr; 1208 toHexStr(reqData, errLog); 1209 msgLog += --- 33 unchanged lines hidden (view full) --- 1243 ipmiStorageGetSELEntry(std::vector<uint8_t> data) 1244{ 1245 1246 if (data.size() != sizeof(fb_oem::ipmi::sel::GetSELEntryRequest)) 1247 { 1248 return ipmi::responseReqDataLenInvalid(); 1249 } 1250 |
1254 fb_oem::ipmi::sel::GetSELEntryRequest *reqData = 1255 reinterpret_cast<fb_oem::ipmi::sel::GetSELEntryRequest *>(&data[0]); | 1251 fb_oem::ipmi::sel::GetSELEntryRequest* reqData = 1252 reinterpret_cast<fb_oem::ipmi::sel::GetSELEntryRequest*>(&data[0]); |
1256 1257 if (reqData->reservID != 0) 1258 { 1259 if (!checkSELReservation(reqData->reservID)) 1260 { 1261 return ipmi::responseInvalidReservationId(); 1262 } 1263 } --- 101 unchanged lines hidden (view full) --- 1365 if (responseID < 0) 1366 { 1367 return ipmi::responseUnspecifiedError(); 1368 } 1369 return ipmi::responseSuccess((uint16_t)responseID); 1370} 1371 1372ipmi::RspType<uint8_t> ipmiStorageClearSEL(uint16_t reservationID, | 1253 1254 if (reqData->reservID != 0) 1255 { 1256 if (!checkSELReservation(reqData->reservID)) 1257 { 1258 return ipmi::responseInvalidReservationId(); 1259 } 1260 } --- 101 unchanged lines hidden (view full) --- 1362 if (responseID < 0) 1363 { 1364 return ipmi::responseUnspecifiedError(); 1365 } 1366 return ipmi::responseSuccess((uint16_t)responseID); 1367} 1368 1369ipmi::RspType<uint8_t> ipmiStorageClearSEL(uint16_t reservationID, |
1373 const std::array<uint8_t, 3> &clr, | 1370 const std::array<uint8_t, 3>& clr, |
1374 uint8_t eraseOperation) 1375{ 1376 if (!checkSELReservation(reservationID)) 1377 { 1378 return ipmi::responseInvalidReservationId(); 1379 } 1380 1381 static constexpr std::array<uint8_t, 3> clrExpected = {'C', 'L', 'R'}; --- 111 unchanged lines hidden --- | 1371 uint8_t eraseOperation) 1372{ 1373 if (!checkSELReservation(reservationID)) 1374 { 1375 return ipmi::responseInvalidReservationId(); 1376 } 1377 1378 static constexpr std::array<uint8_t, 3> clrExpected = {'C', 'L', 'R'}; --- 111 unchanged lines hidden --- |