| #include "tlbmc/store/octeon10_evk_store.h" |
| |
| #include <cassert> |
| #include <cstddef> |
| #include <cstdint> |
| #include <memory> |
| #include <optional> |
| #include <ostream> |
| #include <string> |
| #include <utility> |
| #include <vector> |
| |
| #include "owner_certificate/owner_verification_cert_configuration.pb.h" |
| #include "absl/base/thread_annotations.h" |
| #include "absl/container/flat_hash_map.h" |
| #include "absl/functional/any_invocable.h" |
| #include "absl/log/log.h" |
| #include "absl/status/status.h" |
| #include "absl/status/statusor.h" |
| #include "absl/strings/str_cat.h" |
| #include "absl/strings/string_view.h" |
| #include "absl/synchronization/mutex.h" |
| #include "absl/time/time.h" |
| #include "boost/circular_buffer.hpp" //NOLINT: boost is commonly used in BMC |
| #include "time/clock.h" |
| #include <nlohmann/json.hpp> |
| #include "libusb-1.0/libusb.h" |
| #include "tlbmc/central_config/config.h" |
| #include "tlbmc/collector/collector.h" |
| #include "tlbmc/collector/fru_collector.h" |
| #include "tlbmc/collector/gpio_collector.h" |
| #include "tlbmc/collector/led_collector.h" |
| #include "tlbmc/collector/monitoring_change_base.h" |
| #include "tlbmc/collector/pcie_collector.h" |
| #include "power_control.pb.h" |
| #include "sensor_instance_properties.pb.h" |
| #include "threshold_config.pb.h" |
| #include "topology_config.pb.h" |
| #include "tlbmc/credentials/credential_manager.h" |
| #include "fru.pb.h" |
| #include "power_fault_log_entry.pb.h" |
| #include "resource.pb.h" |
| #include "sensor.pb.h" |
| #include "software_metrics.pb.h" |
| #include "tlbmc/scheduler/scheduler.h" |
| #include "tlbmc/sensors/sensor.h" |
| #include "tlbmc/store/store.h" |
| #include "tlbmc/thermal/controller/dff_controller.h" |
| #include "tlbmc/thermal/controller/eat_controller.h" |
| #include "tlbmc/thermal/controller/fan_pid_controller.h" |
| #include "tlbmc/thermal/controller/pid_controller.h" |
| #include "tlbmc/thermal/controller/stepwise_controller.h" |
| #include "tlbmc/thermal/zone_manager.h" |
| #include "tlbmc/time/time.h" |
| #include "tlbmc/true_hitless_metrics.pb.h" |
| #include "router_interface.h" |
| #include "google/protobuf/text_format.h" |
| |
| namespace milotic_tlbmc { |
| |
| namespace { |
| using ::google::protobuf::TextFormat; |
| |
| TopologyConfig GetOcteon10EvkTopologyConfig() { |
| constexpr absl::string_view kTopologyConfig = R"pb( |
| root_node_key: "octeon10_evk" |
| |
| topology_config_nodes { |
| key: "octeon10_evk" |
| value: { |
| name: "Octeon10 EVK" |
| config_key: "octeon10_evk" |
| fru_info { fru_key: "OCTEON10_EVK_FRU" } |
| port_configs { |
| key: "USB_PORT_TO_NXP" |
| value: { |
| port_type: PORT_TYPE_DOWNSTREAM |
| port_name: "USB0" |
| port_label: "NXP_Connection" |
| } |
| } |
| location_context { |
| devpath: "/phys" |
| location_type: PART_LOCATION_TYPE_EMBEDDED |
| } |
| children_chassis_ids: "nxp_frdm_mcxn947" |
| } |
| } |
| |
| topology_config_nodes { |
| key: "nxp_frdm_mcxn947" |
| value: { |
| name: "NXP FRDM-MCXN947" |
| config_key: "nxp_frdm_mcxn947" |
| fru_info { fru_key: "NXP_FRDM_FRU" } |
| upstream_port_configs { |
| port_type: PORT_TYPE_UPSTREAM |
| port_name: "USB-C" |
| port_label: "To_Octeon10" |
| } |
| location_context { |
| devpath: "/phys/USB0" # Example devpath |
| location_type: PART_LOCATION_TYPE_EMBEDDED |
| } |
| parent_chassis_ids: "octeon10_evk" |
| } |
| } |
| |
| fru_configs { key: "OCTEON10_EVK_FRU" value: "octeon10_evk" } |
| fru_configs { key: "NXP_FRDM_FRU" value: "nxp_frdm_mcxn947" } |
| )pb"; |
| TextFormat::Parser parser; |
| TopologyConfig topology_config; |
| if (!parser.ParseFromString(kTopologyConfig, &topology_config)) { |
| LOG(FATAL) |
| << "Failed to parse topology config."; // Crash OK: initialization-only |
| } |
| return topology_config; |
| } |
| |
| FruTable GetOcteon10EvkFruTable() { |
| // These values are all fake. |
| constexpr absl::string_view kFruTable = R"pb( |
| key_to_fru { |
| key: "OCTEON10_EVK_FRU" |
| value: { |
| attributes { |
| key: "octeon10_evk_main" |
| resource_type: RESOURCE_TYPE_BOARD |
| status: STATUS_READY |
| } |
| i2c_info { |
| bus: 1 |
| address: 80 # Placeholder 0x50 |
| } |
| data { |
| asset_info { |
| manufacturer: "Marvell" |
| product_name: "Octeon10 N103 EVK" |
| serial_number: "OCT10EVK_SN001" |
| part_number: "OCT10EVK_PN001" |
| } |
| # Example FruI2CInfo |
| fru_info { |
| board_manufacturer: "Marvell" |
| board_product_name: "Octeon10 N103 Board" |
| board_serial_number: "B_SN123" |
| board_part_number: "B_PN456" |
| product_manufacturer: "Marvell" |
| product_product_name: "Octeon10 N103 EVK" |
| } |
| } |
| } |
| } |
| |
| key_to_fru { |
| key: "NXP_FRDM_FRU" |
| value: { |
| attributes { |
| key: "nxp_frdm_mcxn947" |
| resource_type: RESOURCE_TYPE_BOARD |
| status: STATUS_READY |
| } |
| i2c_info { |
| bus: 10 # Assuming connected via a different bus/domain |
| address: 81 # Placeholder 0x51 |
| } |
| data { |
| asset_info { |
| manufacturer: "NXP" |
| product_name: "FRDM-MCXN947" |
| serial_number: "NXPFRDM_SN002" |
| part_number: "NXPFRDM_PN002" |
| version: "Rev A" |
| } |
| # Example FruI2CInfo |
| fru_info { |
| board_manufacturer: "NXP" |
| board_product_name: "FRDM-MCXN947" |
| board_serial_number: "B_SN789" |
| board_part_number: "B_PNABC" |
| } |
| } |
| } |
| } |
| )pb"; |
| TextFormat::Parser parser; |
| FruTable fru_table; |
| if (!parser.ParseFromString(kFruTable, &fru_table)) { |
| LOG(FATAL) |
| << "Failed to parse fru table."; // Crash OK: initialization-only |
| } |
| return fru_table; |
| } |
| |
| // Initial buffer size |
| constexpr size_t kInitialBufferSize = 100; |
| |
| class IoxUsbSensor : public Sensor { |
| public: |
| IoxUsbSensor(SensorAttributesStatic&& static_attrs, |
| const ThresholdConfigs& threshold_configs, |
| std::optional<NotificationCb> notification_cb) |
| : Sensor(std::move(static_attrs), threshold_configs, notification_cb), |
| history_(kInitialBufferSize) { |
| absl::Status init_status = InitLibusb(); |
| if (!init_status.ok()) { |
| LOG_EVERY_N_SEC(ERROR, 30) |
| << "Failed to initialize IoxUsbSensor: " << init_status; |
| // Optionally update sensor state to indicate error |
| } |
| } |
| |
| ~IoxUsbSensor() override { ReleaseLibusb(); } |
| |
| std::shared_ptr<const SensorValue> GetSensorData() const override { |
| absl::MutexLock lock(mutex_); |
| if (history_.empty()) { |
| return nullptr; |
| } |
| return history_.back(); |
| } |
| |
| std::vector<std::shared_ptr<const SensorValue>> GetSensorDataHistory() |
| const override { |
| absl::MutexLock lock(mutex_); |
| return std::vector<std::shared_ptr<const SensorValue>>(history_.begin(), |
| history_.end()); |
| } |
| |
| std::vector<std::shared_ptr<const SensorValue>> GetSensorDataHistorySince( |
| absl::Time start_time) const override { |
| absl::MutexLock lock(mutex_); |
| std::vector<std::shared_ptr<const SensorValue>> result; |
| for (const auto& value : history_) { |
| if (value && DecodeGoogleApiProto(value->timestamp()) >= start_time) { |
| result.push_back(value); |
| } |
| } |
| return result; |
| } |
| |
| // This method executes synchronously. |
| void RefreshOnceAsync( |
| absl::AnyInvocable<void(const std::shared_ptr<const SensorValue>&)> |
| callback) override { |
| absl::StatusOr<double> temp = ReadTemperatureFromDevice(); |
| if (temp.ok()) { |
| LOG_EVERY_N_SEC(INFO, 30) << "Refresh successful: " << *temp; |
| auto sensor_value = std::make_shared<SensorValue>(); |
| sensor_value->set_reading(*temp); |
| *sensor_value->mutable_timestamp() = milotic_tlbmc::Now(); |
| // TODO: Set other necessary fields in SensorValue (units, etc.) |
| StoreSensorData(sensor_value); |
| UpdateReady(true); |
| if (callback) { |
| callback(sensor_value); |
| } |
| } else { |
| LOG(WARNING) << "Refresh failed: " << temp.status(); |
| UpdateReady(false); |
| if (callback) { |
| callback(nullptr); |
| } |
| } |
| } |
| |
| void ResizeBuffer(size_t buffer_size) override { |
| absl::MutexLock lock(mutex_); |
| history_.resize(buffer_size); |
| } |
| |
| void UpdateReady(bool ready) { |
| absl::MutexLock lock(sensor_attributes_dynamic_mutex_); |
| if (ready) { |
| sensor_attributes_dynamic_.mutable_state()->set_status(STATUS_READY); |
| } else { |
| sensor_attributes_dynamic_.mutable_state()->set_status(STATUS_STALE); |
| } |
| } |
| |
| // Disable copy and assign |
| IoxUsbSensor(const IoxUsbSensor&) = delete; |
| IoxUsbSensor& operator=(const IoxUsbSensor&) = delete; |
| |
| protected: |
| void StoreSensorData(const std::shared_ptr<const SensorValue>& sensor_data) |
| override ABSL_LOCKS_EXCLUDED(mutex_) { |
| absl::MutexLock lock(mutex_); |
| history_.push_back(sensor_data); |
| // TODO: Implement notification_cb_ logic if needed |
| } |
| |
| private: |
| absl::Status InitLibusb() { |
| if (libusb_init(nullptr) < 0) { |
| return absl::InternalError("Failed to initialize libusb"); |
| } |
| libusb_initialized_ = true; |
| |
| handle_ = libusb_open_device_with_vid_pid(nullptr, kVendorId, kProductId); |
| if (handle_ == nullptr) { |
| ReleaseLibusb(); |
| return absl::NotFoundError( |
| absl::StrCat("USB Device not found (VID: ", absl::Hex(kVendorId), |
| ", PID: ", absl::Hex(kProductId), ")")); |
| } |
| |
| libusb_set_auto_detach_kernel_driver(handle_, 1); |
| |
| if (libusb_claim_interface(handle_, kInterfaceNum) != 0) { |
| ReleaseLibusb(); |
| return absl::InternalError( |
| absl::StrCat("Could not claim interface ", kInterfaceNum)); |
| } |
| |
| absl::Status endpoint_status = FindEndpoints(); |
| if (!endpoint_status.ok()) { |
| ReleaseLibusb(); |
| return endpoint_status; |
| } |
| |
| LOG(INFO) << "IoxUsbSensor initialized successfully."; |
| return absl::OkStatus(); |
| } |
| |
| void ReleaseLibusb() { |
| if (handle_ != nullptr) { |
| libusb_release_interface(handle_, kInterfaceNum); |
| libusb_close(handle_); |
| handle_ = nullptr; |
| } |
| if (libusb_initialized_) { |
| libusb_exit(nullptr); |
| libusb_initialized_ = false; |
| } |
| LOG(INFO) << "IoxUsbSensor libusb released."; |
| } |
| |
| absl::Status FindEndpoints() { |
| libusb_device* device = libusb_get_device(handle_); |
| struct libusb_config_descriptor* config; |
| if (libusb_get_active_config_descriptor(device, &config) != 0) { |
| return absl::InternalError("Could not get active config descriptor"); |
| } |
| |
| bulk_in_ep_ = 0; |
| bulk_out_ep_ = 0; |
| |
| for (uint8_t i = 0; i < config->bNumInterfaces; ++i) { |
| const struct libusb_interface* interface = &config->interface[i]; |
| for (int j = 0; j < interface->num_altsetting; ++j) { |
| const struct libusb_interface_descriptor* if_desc = |
| &interface->altsetting[j]; |
| if (if_desc->bInterfaceNumber == kInterfaceNum) { |
| for (uint8_t k = 0; k < if_desc->bNumEndpoints; ++k) { |
| const struct libusb_endpoint_descriptor* ep_desc = |
| &if_desc->endpoint[k]; |
| if ((ep_desc->bmAttributes & LIBUSB_TRANSFER_TYPE_MASK) == |
| LIBUSB_TRANSFER_TYPE_BULK) { |
| if ((ep_desc->bEndpointAddress & LIBUSB_ENDPOINT_IN) != 0) { |
| bulk_in_ep_ = ep_desc->bEndpointAddress; |
| } else { |
| bulk_out_ep_ = ep_desc->bEndpointAddress; |
| } |
| } |
| } |
| } |
| } |
| } |
| libusb_free_config_descriptor(config); |
| |
| if (bulk_in_ep_ == 0 || bulk_out_ep_ == 0) { |
| return absl::NotFoundError("Could not find BULK IN/OUT endpoints"); |
| } |
| LOG(INFO) << "Found BULK endpoints: IN=0x" << absl::Hex(bulk_in_ep_) |
| << ", OUT=0x" << absl::Hex(bulk_out_ep_); |
| return absl::OkStatus(); |
| } |
| |
| absl::StatusOr<double> ReadTemperatureFromDevice() { |
| if (handle_ == nullptr) { |
| return absl::FailedPreconditionError("USB device not initialized"); |
| } |
| |
| uint8_t send_data[] = {10}; // Command to read temperature |
| int transferred = 0; |
| |
| int ret = libusb_bulk_transfer(handle_, bulk_out_ep_, send_data, |
| sizeof(send_data), &transferred, kTimeoutMs); |
| if (ret != 0) { |
| return absl::InternalError( |
| absl::StrCat("Bulk OUT transfer failed: ", |
| libusb_strerror(static_cast<libusb_error>(ret)))); |
| } |
| if (transferred != sizeof(send_data)) { |
| return absl::InternalError("Bulk OUT transfer incomplete"); |
| } |
| |
| uint8_t recv_data[2]; |
| ret = libusb_bulk_transfer(handle_, bulk_in_ep_, recv_data, |
| sizeof(recv_data), &transferred, kTimeoutMs); |
| if (ret != 0) { |
| return absl::InternalError( |
| absl::StrCat("Bulk IN transfer failed: ", |
| libusb_strerror(static_cast<libusb_error>(ret)))); |
| } |
| if (transferred != sizeof(recv_data)) { |
| return absl::InternalError( |
| "Bulk IN transfer incomplete, expected 2 bytes"); |
| } |
| |
| uint16_t raw_temp_u16 = ((uint16_t)recv_data[0] << 8) | recv_data[1]; |
| uint16_t temp_12bit = raw_temp_u16 >> 4; |
| double temp_c; |
| |
| if ((temp_12bit & 0x0800) != 0) { // Negative temperature |
| temp_12bit = (~temp_12bit + 1) & 0x0FFF; |
| temp_c = -(temp_12bit * 0.0625); |
| } else { // Positive temperature |
| temp_c = temp_12bit * 0.0625; |
| } |
| return temp_c; |
| } |
| |
| libusb_device_handle* handle_ = nullptr; |
| bool libusb_initialized_ = false; |
| uint8_t bulk_in_ep_ = 0; |
| uint8_t bulk_out_ep_ = 0; |
| static constexpr int kVendorId = 0x2fe5; |
| static constexpr int kProductId = 0x0001; |
| static constexpr int kInterfaceNum = 0; |
| static constexpr int kTimeoutMs = 1000; |
| |
| mutable absl::Mutex mutex_; |
| boost::circular_buffer<std::shared_ptr<const SensorValue>> history_ |
| ABSL_GUARDED_BY(mutex_); |
| }; |
| |
| } // namespace |
| |
| Octeon10EvkStore::Octeon10EvkStore() |
| : topology_config_(GetOcteon10EvkTopologyConfig()), |
| fru_table_(GetOcteon10EvkFruTable()), |
| task_scheduler_(ecclesia::Clock::RealClock()) { |
| SensorAttributesStatic iox_attrs; |
| iox_attrs.mutable_attributes()->set_key("IoxUsbSensor"); |
| iox_attrs.set_unit(UNIT_DEGREE_CELSIUS); |
| iox_attrs.mutable_entity_common_config()->set_board_config_key( |
| "nxp_frdm_mcxn947"); |
| |
| auto iox_sensor = std::make_shared<IoxUsbSensor>( |
| std::move(iox_attrs), ThresholdConfigs(), std::nullopt); |
| |
| sensor_table_["nxp_frdm_mcxn947"]["IoxUsbSensor"] = iox_sensor; |
| |
| task_scheduler_.RunAndScheduleAsync( |
| [iox_sensor](absl::AnyInvocable<void()> on_done) mutable { |
| iox_sensor->RefreshOnceAsync( |
| [on_done = std::move(on_done)]( |
| const std::shared_ptr<const SensorValue>&) mutable { |
| if (on_done) { |
| on_done(); |
| } |
| }); |
| }, |
| absl::Seconds(1)); |
| GetMutableTlbmcConfigForTest().mutable_fru_collector_module()->set_enabled( |
| true); |
| GetMutableTlbmcConfigForTest() |
| .mutable_fru_collector_module() |
| ->set_own_chassis_collection_in_redfish(true); |
| } |
| |
| bool Octeon10EvkStore::IsDeterministicBmcEnabled() const { return false; } |
| |
| bool Octeon10EvkStore::IsDeterministicPeriodicFruScanningEnabled() const { |
| return false; |
| } |
| |
| absl::Status Octeon10EvkStore::ConfigureDeterministicCollection( |
| [[maybe_unused]] const Collector::Config& config) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::ConfigureDeterministicCollection is not implemented"); |
| } |
| |
| std::unique_ptr<MonitoringChangeBase> |
| Octeon10EvkStore::CreateMonitoringChange() { |
| return nullptr; |
| } |
| |
| std::vector<std::string> Octeon10EvkStore::GetAllSensorKeysByConfigKey( |
| const std::string& board_config_key) const { |
| std::vector<std::string> keys; |
| auto it = sensor_table_.find(board_config_key); |
| if (it != sensor_table_.end()) { |
| for (const auto& [sensor_key, _] : it->second) { |
| keys.push_back(sensor_key); |
| } |
| } |
| return keys; |
| } |
| |
| std::vector<std::shared_ptr<const Sensor>> Octeon10EvkStore::GetAllSensors() |
| const { |
| std::vector<std::shared_ptr<const Sensor>> sensors; |
| for (const auto& [_, board_sensors] : sensor_table_) { |
| for (const auto& [_, sensor] : board_sensors) { |
| sensors.push_back(sensor); |
| } |
| } |
| return sensors; |
| } |
| |
| std::vector<std::string> Octeon10EvkStore::GetAllSharedMemorySensorKeys() |
| const { |
| return {}; |
| } |
| |
| std::shared_ptr<const Sensor> Octeon10EvkStore::GetSensorBySensorKey( |
| const std::string& sensor_key) const { |
| for (const auto& [_, board_sensors] : sensor_table_) { |
| auto it = board_sensors.find(sensor_key); |
| if (it != board_sensors.end()) { |
| return it->second; |
| } |
| } |
| return nullptr; |
| } |
| |
| std::shared_ptr<const Sensor> |
| Octeon10EvkStore::GetSensorByConfigKeyAndSensorKey( |
| const std::string& board_config_key, const std::string& sensor_key) const { |
| auto board_it = sensor_table_.find(board_config_key); |
| if (board_it != sensor_table_.end()) { |
| auto sensor_it = board_it->second.find(sensor_key); |
| if (sensor_it != board_it->second.end()) { |
| return sensor_it->second; |
| } |
| } |
| return nullptr; |
| } |
| |
| absl::Status Octeon10EvkStore::WriteToSensor( |
| [[maybe_unused]] const std::string& sensor_key, |
| [[maybe_unused]] const SensorValue& value) { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::WriteToSensor is not implemented"); |
| } |
| |
| absl::StatusOr<const std::string&> Octeon10EvkStore::GetDevpathFromSensor( |
| [[maybe_unused]] std::shared_ptr<const Sensor> sensor) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetDevpathFromSensor is not implemented"); |
| } |
| |
| absl::StatusOr<const Fru*> Octeon10EvkStore::GetFru( |
| absl::string_view key) const { |
| auto it = fru_table_.key_to_fru().find(key); |
| if (it == fru_table_.key_to_fru().end()) { |
| return absl::NotFoundError(absl::StrCat("FRU not found: ", key)); |
| } |
| return &it->second; |
| } |
| |
| absl::StatusOr<const FruTable*> Octeon10EvkStore::GetAllFrus() const { |
| return &fru_table_; |
| } |
| |
| absl::StatusOr<const TopologyConfigNode*> Octeon10EvkStore::GetFruTopology( |
| absl::string_view config_key) const { |
| auto it = topology_config_.topology_config_nodes().find(config_key); |
| if (it == topology_config_.topology_config_nodes().end()) { |
| return absl::NotFoundError( |
| absl::StrCat("Topology node not found: ", config_key)); |
| } |
| return &it->second; |
| } |
| |
| absl::StatusOr<const TopologyConfig*> Octeon10EvkStore::GetTopologyConfig() |
| const { |
| return &topology_config_; |
| } |
| |
| absl::StatusOr<std::vector<std::string>> Octeon10EvkStore::GetAllConfigKeys() |
| const { |
| std::vector<std::string> keys; |
| for (const auto& [key, _] : topology_config_.topology_config_nodes()) { |
| keys.push_back(key); |
| } |
| return keys; |
| } |
| |
| bool Octeon10EvkStore::IsConfigKeyOwningAllSensors( |
| absl::string_view config_key) const { |
| return sensor_table_.contains(config_key); |
| } |
| |
| absl::StatusOr<std::string> Octeon10EvkStore::GetConfigKeyByFruKey( |
| absl::string_view fru_key) const { |
| auto it = topology_config_.fru_configs().find(fru_key); |
| if (it == topology_config_.fru_configs().end()) { |
| return absl::NotFoundError( |
| absl::StrCat("Config key not found for FRU: ", fru_key)); |
| } |
| return it->second; |
| } |
| |
| absl::StatusOr<std::string> Octeon10EvkStore::GetFruKeyByConfigKey( |
| absl::string_view config_key) const { |
| for (const auto& [fru_key, cfg_key] : topology_config_.fru_configs()) { |
| if (cfg_key == config_key) { |
| return fru_key; |
| } |
| } |
| return absl::NotFoundError( |
| absl::StrCat("FRU key not found for config: ", config_key)); |
| } |
| |
| absl::StatusOr<std::vector<std::pair<std::string, std::string>>> |
| Octeon10EvkStore::GetFanInfoByConfigKey( |
| [[maybe_unused]] absl::string_view config_key) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetFanInfoByConfigKey is not implemented"); |
| } |
| |
| nlohmann::json Octeon10EvkStore::ToJson() const { |
| nlohmann::json root; |
| root["Name"] = "Octeon10EvkStore"; |
| root["Scheduler"] = task_scheduler_.ToJson(); |
| root["FruTable"] = absl::StrCat(fru_table_); |
| root["TopologyConfig"] = absl::StrCat(topology_config_); |
| root["SensorTable"] = nlohmann::json(); |
| for (const auto& [board_config_key, board_sensors] : sensor_table_) { |
| nlohmann::json board_sensors_json; |
| for (const auto& [sensor_key, sensor] : board_sensors) { |
| board_sensors_json[sensor_key] = sensor->ToJson().value_or("Unhealthy"); |
| } |
| root["SensorTable"][board_config_key] = board_sensors_json; |
| } |
| return root; |
| } |
| |
| nlohmann::json Octeon10EvkStore::GetSchedulerStats() const { |
| return nlohmann::json(); |
| } |
| |
| Store::Metrics Octeon10EvkStore::GetMetrics() const { return Metrics(); } |
| |
| void Octeon10EvkStore::SetSmartRouter( |
| [[maybe_unused]] ::crow::RouterInterface* smart_router) {} |
| |
| std::string Octeon10EvkStore::ToString() const { return "Octeon10EvkStore"; } |
| |
| absl::StatusOr<std::vector<const thermal::ZoneManager*>> |
| Octeon10EvkStore::GetAllThermalZones() const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetAllThermalZones is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<const thermal::PidController*>> |
| Octeon10EvkStore::GetAllPidControllers() const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetAllPidControllers is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<const thermal::StepwiseController*>> |
| Octeon10EvkStore::GetAllStepwiseControllers() const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetAllStepwiseControllers is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<const thermal::FanPidController*>> |
| Octeon10EvkStore::GetAllFanPidControllers() const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetAllFanPidControllers is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<const thermal::DffController*>> |
| Octeon10EvkStore::GetAllDffControllers() const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetAllDffControllers is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<const thermal::EatController*>> |
| Octeon10EvkStore::GetAllEatControllers() const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetAllEatControllers is not implemented"); |
| } |
| |
| FruCollector* Octeon10EvkStore::GetFruCollector() const { return nullptr; } |
| |
| GpioCollector* Octeon10EvkStore::GetGpioCollector() const { return nullptr; } |
| |
| LedCollector* Octeon10EvkStore::GetLedCollector() const { return nullptr; } |
| |
| PcieCollector* Octeon10EvkStore::GetPcieCollector() const { return nullptr; } |
| |
| SoftwareMetricsValue Octeon10EvkStore::GetMetricValues() const { |
| return SoftwareMetricsValue(); |
| } |
| |
| SocketStatStates Octeon10EvkStore::GetMetricSocketStatValues() const { |
| return SocketStatStates(); |
| } |
| |
| NetFilterStates Octeon10EvkStore::GetMetricNetFilterValues() const { |
| return NetFilterStates(); |
| } |
| |
| std::string Octeon10EvkStore::GetBmcUuid() const { return ""; } |
| |
| std::string Octeon10EvkStore::GetBmcFirmwareVersion() const { return ""; } |
| |
| std::string Octeon10EvkStore::GetBmcFirmwareVersionId() const { return ""; } |
| |
| absl::StatusOr<std::string> Octeon10EvkStore::GenerateCsr( |
| [[maybe_unused]] const CredentialManager::CsrParams& csr_params) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GenerateCsr is not implemented"); |
| } |
| |
| absl::Status Octeon10EvkStore::InstallServerCert( |
| [[maybe_unused]] const std::string& certificate) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::InstallServerCert is not implemented"); |
| } |
| |
| absl::Status Octeon10EvkStore::InstallTrustBundle( |
| [[maybe_unused]] const std::string& trust_bundle, |
| [[maybe_unused]] const std::string& signature) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::InstallTrustBundle is not implemented"); |
| } |
| |
| absl::Status Octeon10EvkStore::InstallOsVerificationCertificate( |
| [[maybe_unused]] const std::string& cert_string) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::InstallOsVerificationCertificate is not implemented"); |
| } |
| |
| absl::Status Octeon10EvkStore::InstallSerialConsoleTrustedUserCAKeys( |
| [[maybe_unused]] const std::string& trusted_user_ca_keys, |
| [[maybe_unused]] const std::string& signature) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::InstallSerialConsoleTrustedUserCAKeys is not " |
| "implemented"); |
| } |
| |
| bool Octeon10EvkStore::IsFirmwareUpdateable() const { return false; } |
| |
| absl::StatusOr<std::optional<std::string>> |
| Octeon10EvkStore::GetOwnerVerificationCert() const { |
| return std::nullopt; |
| } |
| absl::StatusOr< |
| std::optional<owner_certificate::OwnerVerificationCertConfiguration>> |
| Octeon10EvkStore::GetOwnerVerificationCertConfiguration() const { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> |
| Octeon10EvkStore::GetBmcSshTrustedUserCAKeysSignature() const { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> Octeon10EvkStore::GetTrustBundle() |
| const { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> |
| Octeon10EvkStore::GetTrustBundleSignature() const { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> Octeon10EvkStore::GetServerCert() |
| const { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> |
| Octeon10EvkStore::GetOsVerificationCert() const { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> |
| Octeon10EvkStore::GetSerialConsoleTrustedUserCAKeys() const { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> |
| Octeon10EvkStore::GetSerialConsoleDetatchedSignature() const { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<SyslogTargetConfig>> |
| Octeon10EvkStore::GetSyslogClientConf() const { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> Octeon10EvkStore::GetSyslogRootCert() |
| const { |
| return std::nullopt; |
| } |
| |
| TrueHitlessMetrics Octeon10EvkStore::GetTrueHitlessMetrics() const { |
| return TrueHitlessMetrics(); |
| } |
| |
| absl::Time Octeon10EvkStore::GetCurrentTime() const { |
| return absl::UnixEpoch(); |
| } |
| |
| absl::Time Octeon10EvkStore::GetLastResetTime() const { |
| return absl::UnixEpoch(); |
| } |
| |
| absl::Status Octeon10EvkStore::SetGpio( |
| [[maybe_unused]] absl::string_view gpio_name, [[maybe_unused]] bool value) { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::SetGpio is not implemented"); |
| } |
| |
| absl::Status Octeon10EvkStore::SetGpioActive( |
| [[maybe_unused]] absl::string_view gpio_name) { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::SetGpioActive is not implemented"); |
| } |
| |
| absl::Status Octeon10EvkStore::SetGpioActiveForDuration( |
| [[maybe_unused]] absl::string_view gpio_name, |
| [[maybe_unused]] absl::Duration duration) { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::SetGpioActiveForDuration is not implemented"); |
| } |
| |
| absl::StatusOr<bool> Octeon10EvkStore::GetGpio( |
| [[maybe_unused]] absl::string_view gpio_name) { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetGpio is not implemented"); |
| } |
| |
| absl::Status Octeon10EvkStore::SendSystemResetRequest( |
| [[maybe_unused]] absl::string_view system_id, |
| [[maybe_unused]] ResetType reset_type, |
| [[maybe_unused]] absl::Duration delay) { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::SendSystemResetRequest is not implemented"); |
| } |
| |
| absl::StatusOr<std::string> Octeon10EvkStore::GetHotswapGpioName() { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetHotswapGpioName is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<ResetType>> |
| Octeon10EvkStore::GetSupportedCustomChassisResetTypes( |
| [[maybe_unused]] absl::string_view chassis_id) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetSupportedCustomChassisResetTypes is not " |
| "implemented"); |
| } |
| |
| absl::StatusOr<bool> Octeon10EvkStore::SupportsCustomChassisReset( |
| [[maybe_unused]] absl::string_view chassis_id) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::SupportsCustomChassisReset is not implemented"); |
| } |
| |
| absl::Status Octeon10EvkStore::ExecuteCustomChassisReset( |
| [[maybe_unused]] absl::string_view chassis_id, |
| [[maybe_unused]] ResetType reset_type) { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::ExecuteCustomChassisReset is not implemented"); |
| } |
| |
| PowerFaultLogEntries Octeon10EvkStore::GetPowerFaultLogEntries() const { |
| return PowerFaultLogEntries(); |
| } |
| |
| absl::StatusOr<std::string> Octeon10EvkStore::GetPowerFaultLogFileContent( |
| [[maybe_unused]] absl::string_view folder_name, |
| [[maybe_unused]] absl::string_view file_name) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetPowerFaultLogFileContent is not implemented"); |
| } |
| |
| std::vector<nlohmann::json> Octeon10EvkStore::GetSelEntriesForward( |
| [[maybe_unused]] uint64_t start_id, |
| [[maybe_unused]] size_t max_count) const { |
| return {}; |
| } |
| |
| std::vector<nlohmann::json> Octeon10EvkStore::GetSelEntriesBackward( |
| [[maybe_unused]] uint64_t start_id, |
| [[maybe_unused]] size_t max_count) const { |
| return {}; |
| } |
| |
| std::vector<nlohmann::json> Octeon10EvkStore::GetLatestSelEntries( |
| [[maybe_unused]] size_t max_count) const { |
| return {}; |
| } |
| |
| void Octeon10EvkStore::DumpSelEntriesRaw( |
| [[maybe_unused]] uint64_t start_id, |
| [[maybe_unused]] std::ostream& os) const {} |
| |
| absl::StatusOr<PsiMetrics> Octeon10EvkStore::GetPsiMetrics() const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetPsiMetrics is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<std::string>> |
| Octeon10EvkStore::GetAvailableServices() const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetAvailableServices is not implemented"); |
| } |
| |
| absl::StatusOr<PsiMetrics> Octeon10EvkStore::GetPsiMetricsForService( |
| [[maybe_unused]] const std::string& service_name) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::GetPsiMetricsForService is not implemented"); |
| } |
| |
| void Octeon10EvkStore::SetManualMode([[maybe_unused]] bool enable_manual_mode) { |
| } |
| |
| absl::Status Octeon10EvkStore::SetPidControllerCoefficients( |
| [[maybe_unused]] absl::string_view controller_id, |
| [[maybe_unused]] const thermal::PidController::PidControllerCoefficients& |
| coefficients, |
| [[maybe_unused]] absl::Duration timeout) { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::SetPidControllerCoefficients is not implemented"); |
| } |
| |
| absl::Status Octeon10EvkStore::SetFanPidControllerCoefficients( |
| [[maybe_unused]] absl::string_view controller_id, |
| [[maybe_unused]] const thermal::FanPidController:: |
| FanPidControllerCoefficients& coefficients, |
| [[maybe_unused]] absl::Duration timeout) { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::SetFanPidControllerCoefficients is not implemented"); |
| } |
| |
| absl::Status Octeon10EvkStore::InstallSyslogCert( |
| [[maybe_unused]] const std::string& cert_string, |
| [[maybe_unused]] const std::string& target_ip, |
| [[maybe_unused]] int64_t target_port, |
| [[maybe_unused]] SyslogProtocol protocol, |
| [[maybe_unused]] SyslogTlsMode tls_mode) const { |
| return absl::UnimplementedError( |
| "Octeon10EvkStore::InstallSyslogCert is not implemented"); |
| } |
| |
| } // namespace milotic_tlbmc |