summaryrefslogtreecommitdiffstats
path: root/sensorhandler.cpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-08-23 09:16:07 -0700
committerPatrick Venture <venture@google.com>2019-09-17 01:43:45 +0000
commit235b3c76c354f9242192f56cab609ec9e53c0cc3 (patch)
treed920ade4e1310e0d34f2025ff30721a1a5cfdde4 /sensorhandler.cpp
parentf1d691ac5b12f2a59c1f73d66bc66f1ae63e6ec7 (diff)
downloadphosphor-host-ipmid-235b3c76c354f9242192f56cab609ec9e53c0cc3.tar.gz
phosphor-host-ipmid-235b3c76c354f9242192f56cab609ec9e53c0cc3.zip
move entities into ipmi::sensor namespace
The object was left in the global namespace, but the type was in the ipmi::sensor namespace. Move the object into the namespace. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: If3aa72ebbae980b0b837c45c8fcbc4b47b7fb742
Diffstat (limited to 'sensorhandler.cpp')
-rw-r--r--sensorhandler.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index d2594f5..1901464 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -28,7 +28,6 @@ extern int updateSensorRecordFromSSRAESC(const void*);
extern sd_bus* bus;
extern const ipmi::sensor::IdInfoMap sensors;
extern const FruMap frus;
-extern const ipmi::sensor::EntityInfoMap entities;
using namespace phosphor::logging;
using InternalFailure =
@@ -78,11 +77,20 @@ struct sensorreadingresp_t
uint8_t indication[2];
} __attribute__((packed));
-const ipmi::sensor::EntityInfoMap& getIpmiEntityRecords()
+namespace ipmi
+{
+namespace sensor
+{
+extern const EntityInfoMap entities;
+
+const EntityInfoMap& getIpmiEntityRecords()
{
return entities;
}
+} // namespace sensor
+} // namespace ipmi
+
int get_bus_for_path(const char* path, char** busname)
{
return mapper_get_service(bus, path, busname);
@@ -599,7 +607,7 @@ ipmi::RspType<uint8_t, // respcount
if (count.value_or(0) == getSdrCount)
{
// Get SDR count. This returns the total number of SDRs in the device.
- const auto& entityRecords = getIpmiEntityRecords();
+ const auto& entityRecords = ipmi::sensor::getIpmiEntityRecords();
sdrCount = sensors.size() + frus.size() + entityRecords.size();
}
else if (count.value_or(0) == getSensorCount)
@@ -767,7 +775,7 @@ ipmi_ret_t ipmi_fru_get_sdr(ipmi_request_t request, ipmi_response_t response,
{
// we have reached till end of fru, so assign the next record id to
// 512(Max fru ID = 511) + Entity Record ID(may start with 0).
- const auto& entityRecords = getIpmiEntityRecords();
+ const auto& entityRecords = ipmi::sensor::getIpmiEntityRecords();
auto next_record_id =
(entityRecords.size())
? entityRecords.begin()->first + ENTITY_RECORD_ID_START
@@ -806,7 +814,7 @@ ipmi_ret_t ipmi_entity_get_sdr(ipmi_request_t request, ipmi_response_t response,
get_sdr::SensorDataEntityRecord record{};
auto dataLength = 0;
- const auto& entityRecords = getIpmiEntityRecords();
+ const auto& entityRecords = ipmi::sensor::getIpmiEntityRecords();
auto entity = entityRecords.begin();
uint8_t entityRecordID;
auto recordID = get_sdr::request::get_record_id(req);
OpenPOWER on IntegriCloud