Lines Matching full:psu

236             std::find_if(psus.begin(), psus.end(), [&invpath](auto& psu) {  in getPSUProperties()  argument
237 return psu->getInventoryPath() == invpath; in getPSUProperties()
255 auto psu = std::make_unique<PowerSupply>( in getPSUProperties() local
260 psus.emplace_back(std::move(psu)); in getPSUProperties()
403 // Call to validate the psu configuration if the power is on and both in entityManagerIfaceAdded()
482 // A PSU became present, force the PSU validation to run. in presenceChanged()
496 // Call D-Bus method to inform pseq of PSU error in setPowerSupplyError()
578 for (auto& psu : psus) in syncHistory() local
580 psu->clearSyncHistoryRequired(); in syncHistory()
587 std::any_of(psus.begin(), psus.end(), [](const auto& psu) { in analyze() argument
588 return psu->isSyncHistoryRequired(); in analyze()
595 for (auto& psu : psus) in analyze() local
597 psu->analyze(); in analyze()
602 // Only perform individual PSU analysis if power is on and a brownout has in analyze()
606 for (auto& psu : psus) in analyze() local
610 if (!psu->isFaultLogged() && !psu->isPresent() && in analyze()
615 if (!requiredPSUsPresent && isRequiredPSU(*psu)) in analyze()
620 psu->getInventoryPath(); in analyze()
626 psu->setFaultLogged(); in analyze()
628 else if (!psu->isFaultLogged() && psu->isFaulted()) in analyze()
633 std::format("{:#04x}", psu->getStatusWord()); in analyze()
635 std::format("{:#02x}", psu->getMFRFault()); in analyze()
639 additionalData["FW_VERSION"] = psu->getFWVersion(); in analyze()
641 if (psu->hasCommFault()) in analyze()
644 std::format("{:#02x}", psu->getStatusCML()); in analyze()
648 psu->getDevicePath(); in analyze()
654 psu->setFaultLogged(); in analyze()
656 else if ((psu->hasInputFault() || psu->hasVINUVFault())) in analyze()
660 std::format("{:#02x}", psu->getStatusInput()); in analyze()
668 psu->getInventoryPath(); in analyze()
673 psu->setFaultLogged(); in analyze()
675 else if (psu->hasPSKillFault()) in analyze()
680 psu->setFaultLogged(); in analyze()
682 else if (psu->hasVoutOVFault()) in analyze()
686 std::format("{:#02x}", psu->getStatusVout()); in analyze()
689 psu->getInventoryPath(); in analyze()
695 psu->setFaultLogged(); in analyze()
697 else if (psu->hasIoutOCFault()) in analyze()
701 std::format("{:#02x}", psu->getStatusIout()); in analyze()
707 psu->setFaultLogged(); in analyze()
709 else if (psu->hasVoutUVFault() || psu->hasPS12VcsFault() || in analyze()
710 psu->hasPSCS12VFault()) in analyze()
714 std::format("{:#02x}", psu->getStatusVout()); in analyze()
717 psu->getInventoryPath(); in analyze()
723 psu->setFaultLogged(); in analyze()
728 else if (psu->hasFanFault() && !powerFaultOccurring) in analyze()
732 std::format("{:#02x}", psu->getStatusTemperature()); in analyze()
734 std::format("{:#02x}", psu->getStatusFans12()); in analyze()
737 psu->getInventoryPath(); in analyze()
743 psu->setFaultLogged(); in analyze()
745 else if (psu->hasTempFault()) in analyze()
749 std::format("{:#02x}", psu->getStatusTemperature()); in analyze()
752 psu->getInventoryPath(); in analyze()
758 psu->setFaultLogged(); in analyze()
760 else if (psu->hasMFRFault()) in analyze()
772 psu->getInventoryPath(); in analyze()
778 psu->setFaultLogged(); in analyze()
781 else if (psu->hasPgoodFault() && !powerFaultOccurring) in analyze()
785 psu->getInventoryPath(); in analyze()
791 psu->setFaultLogged(); in analyze()
805 for (const auto& psu : psus) in analyzeBrownout() local
807 if (psu->isPresent()) in analyzeBrownout()
810 if (psu->hasACFault()) in analyzeBrownout()
814 else if (psu->hasPgoodFault()) in analyzeBrownout()
826 // already been logged, at least one PSU has seen an AC fail, and all in analyzeBrownout()
828 // at least one PSU is present. in analyzeBrownout()
857 // If a brownout was previously logged but at least one PSU is not in analyzeBrownout()
918 [](const auto& psu) { return psu->isPresent(); }); in updateMissingPSUs() argument
922 for (const auto& psu : psus) in updateMissingPSUs() local
924 auto psuModel = psu->getModelName(); in updateMissingPSUs()
925 auto psuShortName = psu->getShortName(); in updateMissingPSUs()
926 auto psuInventoryPath = psu->getInventoryPath(); in updateMissingPSUs()
929 auto psuPresent = psu->isPresent(); in updateMissingPSUs()
980 for (const auto& psu : psus) in validateConfig() local
982 if ((psu->hasInputFault() || psu->hasVINUVFault()) && psu->isPresent()) in validateConfig()
1000 for (const auto& psu : psus) in validateConfig() local
1002 if (!psu->isPresent()) in validateConfig()
1007 psu->getInputVoltage(actualVoltage, inputVoltage); in validateConfig()
1047 [](const auto& psu) { return psu->isPresent(); }); in hasRequiredPSUs() argument
1073 for (const auto& psu : psus) in hasRequiredPSUs() local
1075 if (!psu->isPresent()) in hasRequiredPSUs()
1083 psu->getInputVoltage(actualInputVoltage, inputVoltage); in hasRequiredPSUs()
1098 psu->getInventoryPath(); in hasRequiredPSUs()
1120 // Verify we have the supported configuration and PSU information in getRequiredPSUCount()
1123 // Find PSU models. They should all be the same. in getRequiredPSUCount()
1125 std::for_each(psus.begin(), psus.end(), [&models](const auto& psu) { in getRequiredPSUCount() argument
1126 if (!psu->getModelName().empty()) in getRequiredPSUCount()
1128 models.insert(psu->getModelName()); in getRequiredPSUCount()
1147 bool PSUManager::isRequiredPSU(const PowerSupply& psu) in isRequiredPSU() argument
1149 // Get required number of PSUs; if not found, we don't know if PSU required in isRequiredPSU()
1156 // If total PSU count <= the required count, all PSUs are required in isRequiredPSU()
1163 // are required, so we have to do some guesswork. First check if this PSU in isRequiredPSU()
1165 if (psu.isPresent()) in isRequiredPSU()
1170 // This PSU is not present. Count the number of other PSUs that are in isRequiredPSU()
1171 // present. If enough other PSUs are present, assume the specified PSU is in isRequiredPSU()
1175 [](const auto& psu) { return psu->isPresent(); }); in isRequiredPSU() argument
1181 // Check if this PSU was previously present. If so, assume it is required. in isRequiredPSU()
1183 if (!psu.getModelName().empty()) in isRequiredPSU()
1188 // This PSU was never present. Count the number of other PSUs that were in isRequiredPSU()
1190 // specified PSU is not required. in isRequiredPSU()
1191 psuCount += std::count_if(psus.begin(), psus.end(), [](const auto& psu) { in isRequiredPSU() argument
1192 return (!psu->isPresent() && !psu->getModelName().empty()); in isRequiredPSU()
1200 // that were never present. PSU inventory paths typically end with the PSU in isRequiredPSU()
1203 std::for_each(psus.begin(), psus.end(), [&sortedPaths](const auto& psu) { in isRequiredPSU() argument
1204 if (!psu->isPresent() && psu->getModelName().empty()) in isRequiredPSU()
1206 sortedPaths.push_back(psu->getInventoryPath()); in isRequiredPSU()
1211 // Check if specified PSU is close enough to start of list to be required in isRequiredPSU()
1214 if (path == psu.getInventoryPath()) in isRequiredPSU()
1224 // PSU was not close to start of sorted list; assume not required in isRequiredPSU()
1232 // variable with the first PSU name found, then use it as a base to compare in validateModelName()
1237 for (const auto& psu : psus) in validateModelName() local
1239 auto psuModel = psu->getModelName(); in validateModelName()
1247 modelInventoryPath = psu->getInventoryPath(); in validateModelName()
1254 // The base model is supported, callout the mismatched PSU. The in validateModelName()
1255 // mismatched PSU may or may not be supported. in validateModelName()
1259 psu->getInventoryPath(); in validateModelName()
1263 // The base model is not supported, but the mismatched PSU is, in validateModelName()
1264 // callout the base PSU. in validateModelName()
1271 // The base model and the mismatched PSU are not supported or in validateModelName()
1273 // the mismatched PSU. in validateModelName()
1277 psu->getInventoryPath(); in validateModelName()
1338 std::for_each(psus.begin(), psus.end(), [&driverName](auto& psu) { in populateDriverName() argument
1339 if (!psu->getDriverName().empty()) in populateDriverName()
1341 driverName = psu->getDriverName(); in populateDriverName()
1346 [=](auto& psu) { psu->setDriverName(driverName); }); in populateDriverName() argument