Lines Matching +full:system +full:- +full:bus
4 #include <linux/i2c-dev.h>
12 #include <phosphor-logging/elog-errors.hpp>
13 #include <phosphor-logging/lg2.hpp>
30 * @param[in] ipaddress - IPAddress.
43 getDbusObject(sdbusplus::bus_t& bus, const std::string& interface, in getDbusObject() argument
49 ObjectTree objectTree = getSubTree(bus, interfaces, serviceRoot); in getDbusObject()
63 objectTree.begin()->first, in getDbusObject()
64 std::move(objectTree.begin()->second.begin()->first)); in getDbusObject()
82 return make_pair(found->first, std::move(found->second.begin()->first)); in getDbusObject()
85 Value getDbusProperty(sdbusplus::bus_t& bus, const std::string& service, in getDbusProperty() argument
92 auto method = bus.new_method_call(service.c_str(), objPath.c_str(), in getDbusProperty()
97 auto reply = bus.call(method, timeout.count()); in getDbusProperty()
104 sdbusplus::bus_t& bus, const std::string& service, in getAllDbusProperties() argument
110 auto method = bus.new_method_call(service.c_str(), objPath.c_str(), in getAllDbusProperties()
115 auto reply = bus.call(method, timeout.count()); in getAllDbusProperties()
121 ObjectValueTree getManagedObjects(sdbusplus::bus_t& bus, in getManagedObjects() argument
127 auto method = bus.new_method_call(service.c_str(), objPath.c_str(), in getManagedObjects()
130 auto reply = bus.call(method); in getManagedObjects()
136 void setDbusProperty(sdbusplus::bus_t& bus, const std::string& service, in setDbusProperty() argument
141 auto method = bus.new_method_call(service.c_str(), objPath.c_str(), in setDbusProperty()
146 if (!bus.call(method, timeout.count())) in setDbusProperty()
166 const std::string& ServiceCache::getService(sdbusplus::bus_t& bus) in getService() argument
168 if (!isValid(bus)) in getService()
170 cachedBusName = bus.get_unique_name(); in getService()
171 cachedService = ::ipmi::getService(bus, intf, path); in getService()
183 sdbusplus::bus_t& bus, const char* intf, const char* method) in newMethodCall() argument
185 return bus.new_method_call(getService(bus).c_str(), path.c_str(), intf, in newMethodCall()
189 bool ServiceCache::isValid(sdbusplus::bus_t& bus) const in isValid()
191 return cachedService && cachedBusName == bus.get_unique_name(); in isValid()
194 std::string getService(sdbusplus::bus_t& bus, const std::string& intf, in getService() argument
198 bus.new_method_call("xyz.openbmc_project.ObjectMapper", in getService()
205 auto mapperResponseMsg = bus.call(mapperCall); in getService()
215 return mapperResponse.begin()->first; in getService()
218 ObjectTree getSubTree(sdbusplus::bus_t& bus, const InterfaceList& interfaces, in getSubTree() argument
221 auto mapperCall = bus.new_method_call(MAPPER_BUS_NAME, MAPPER_OBJ, in getSubTree()
226 auto mapperReply = bus.call(mapperCall); in getSubTree()
234 getAllDbusObjects(sdbusplus::bus_t& bus, const std::string& serviceRoot, in getAllDbusObjects() argument
240 ObjectTree objectTree = getSubTree(bus, interfaces, serviceRoot); in getAllDbusObjects()
243 if (it->first.find(match) == std::string::npos) in getAllDbusObjects()
256 void deleteAllDbusObjects(sdbusplus::bus_t& bus, const std::string& serviceRoot, in deleteAllDbusObjects() argument
262 auto objectTree = getAllDbusObjects(bus, serviceRoot, interface, match); in deleteAllDbusObjects()
266 method_no_args::callDbusMethod(bus, object.second.begin()->first, in deleteAllDbusObjects()
273 lg2::info("sdbusplus exception - Unable to delete the objects, " in deleteAllDbusObjects()
289 ObjectTree getAllAncestors(sdbusplus::bus_t& bus, const std::string& path, in getAllAncestors() argument
292 auto mapperCall = bus.new_method_call(MAPPER_BUS_NAME, MAPPER_OBJ, in getAllAncestors()
296 auto mapperReply = bus.call(mapperCall); in getAllAncestors()
314 void callDbusMethod(sdbusplus::bus_t& bus, const std::string& service, in callDbusMethod() argument
319 auto busMethod = bus.new_method_call(service.c_str(), objPath.c_str(), in callDbusMethod()
321 auto reply = bus.call(busMethod); in callDbusMethod()
326 /********* Begin co-routine yielding alternatives ***************/
328 boost::system::error_code
332 boost::system::error_code ec; in getService()
334 ctx->bus->yield_method_call<decltype(mapperResponse)>( in getService()
335 ctx->yield, ec, "xyz.openbmc_project.ObjectMapper", in getService()
342 service = std::move(mapperResponse.begin()->first); in getService()
347 boost::system::error_code getSubTree( in getSubTree()
351 boost::system::error_code ec; in getSubTree()
352 objectTree = ctx->bus->yield_method_call<ObjectTree>( in getSubTree()
353 ctx->yield, ec, MAPPER_BUS_NAME, MAPPER_OBJ, MAPPER_INTF, "GetSubTree", in getSubTree()
359 boost::system::error_code
369 boost::system::error_code ec = in getDbusObject()
381 "INTERFACE", interface, "NETFN", lg2::hex, ctx->netFn, "CMD", in getDbusObject()
382 lg2::hex, ctx->cmd); in getDbusObject()
383 return boost::system::errc::make_error_code( in getDbusObject()
384 boost::system::errc::no_such_process); in getDbusObject()
391 std::move(objectTree.begin()->first), in getDbusObject()
392 std::move(objectTree.begin()->second.begin()->first)); in getDbusObject()
406 "MATCH", match, "NETFN", lg2::hex, ctx->netFn, "CMD", in getDbusObject()
407 lg2::hex, ctx->cmd); in getDbusObject()
409 return boost::system::errc::make_error_code( in getDbusObject()
410 boost::system::errc::no_such_file_or_directory); in getDbusObject()
413 dbusObject = std::make_pair(std::move(found->first), in getDbusObject()
414 std::move(found->second.begin()->first)); in getDbusObject()
418 boost::system::error_code getAllDbusProperties( in getAllDbusProperties()
422 boost::system::error_code ec; in getAllDbusProperties()
423 properties = ctx->bus->yield_method_call<PropertyMap>( in getAllDbusProperties()
424 ctx->yield, ec, service.c_str(), objPath.c_str(), PROP_INTF, in getAllDbusProperties()
429 boost::system::error_code
434 boost::system::error_code ec; in setDbusProperty()
435 ctx->bus->yield_method_call(ctx->yield, ec, service.c_str(), in setDbusProperty()
441 boost::system::error_code
450 boost::system::error_code ec = in getAllDbusObjects()
459 if (it->first.find(match) == std::string::npos) in getAllDbusObjects()
472 boost::system::error_code
477 boost::system::error_code ec = in deleteAllDbusObjects()
486 ctx->bus->yield_method_call(ctx->yield, ec, in deleteAllDbusObjects()
487 object.second.begin()->first, object.first, in deleteAllDbusObjects()
495 lg2::hex, ctx->netFn, "CMD", lg2::hex, ctx->cmd, "ERROR", in deleteAllDbusObjects()
503 boost::system::error_code
507 boost::system::error_code ec; in getManagedObjects()
508 objects = ctx->bus->yield_method_call<ipmi::ObjectValueTree>( in getManagedObjects()
509 ctx->yield, ec, service.c_str(), objPath.c_str(), in getManagedObjects()
514 boost::system::error_code
520 boost::system::error_code ec; in getAllAncestors()
521 objectTree = ctx->bus->yield_method_call<ObjectTree>( in getAllAncestors()
522 ctx->yield, ec, MAPPER_BUS_NAME, MAPPER_OBJ, MAPPER_INTF, in getAllAncestors()
541 boost::system::error_code callDbusMethod( in callDbusMethod()
545 boost::system::error_code ec; in callDbusMethod()
546 ctx->bus->yield_method_call(ctx->yield, ec, service, objPath, interface, in callDbusMethod()
551 /********* End co-routine yielding alternatives ***************/
557 // Open the i2c device, for low-level combined data write/read in i2cWriteRead()
561 lg2::error("Failed to open i2c bus: {BUS}", "BUS", i2cBus); in i2cWriteRead()
603 readBuf.resize(msgReadWrite.msgs[msgCount - 1].len); in i2cWriteRead()