forked from openbmc/openbmc
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta-ampere: ipmid: correct dcmi get/set conf param commands
By updating on the dbus interfaces, ipmid has to update the getDHCPEnable function and dhcp object path. Tested: 1. Request to set configuration parameters $ipmitool dcmi set_conf_param activate_dhcp 2. Request to get configuration parameters $ipmitool dcmi get_conf_param Signed-off-by: Thang Tran <[email protected]>
- Loading branch information
1 parent
b6e1229
commit 748e0ce
Showing
3 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
...phosphor/ipmi/phosphor-ipmi-host/0007-update-return-type-of-getDHCPEnabled-function.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
From 142e6982554431d507a3fe58ed100a1b883bf43d Mon Sep 17 00:00:00 2001 | ||
From: Thang Tran <[email protected]> | ||
Date: Tue, 20 Dec 2022 12:58:25 +0700 | ||
Subject: [PATCH] update return type of getDHCPEnabled function | ||
|
||
In the phosphor-dbus-interfaces, the DHCPEnabled has been changed | ||
from bool to enum type, therefore this function has to be updated. | ||
|
||
Tested: | ||
1. Request to active dhcp successfully | ||
$ipmitool dcmi set_conf_param activate_dhcp | ||
|
||
Signed-off-by: Thang Tran <[email protected]> | ||
--- | ||
dcmihandler.cpp | 9 ++++++--- | ||
1 file changed, 6 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/dcmihandler.cpp b/dcmihandler.cpp | ||
index 00e06f8..a17ae60 100644 | ||
--- a/dcmihandler.cpp | ||
+++ b/dcmihandler.cpp | ||
@@ -15,8 +15,11 @@ | ||
#include <sdbusplus/bus.hpp> | ||
#include <variant> | ||
#include <xyz/openbmc_project/Common/error.hpp> | ||
+#include <xyz/openbmc_project/Network/EthernetInterface/server.hpp> | ||
|
||
using namespace phosphor::logging; | ||
+using sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface; | ||
+ | ||
using InternalFailure = | ||
sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; | ||
|
||
@@ -245,7 +248,7 @@ std::string getHostName(void) | ||
return std::get<std::string>(value); | ||
} | ||
|
||
-bool getDHCPEnabled() | ||
+EthernetInterface::DHCPConf getDHCPEnabled() | ||
{ | ||
sdbusplus::bus_t bus{ipmid_get_sd_bus_connection()}; | ||
|
||
@@ -256,7 +259,7 @@ bool getDHCPEnabled() | ||
auto value = ipmi::getDbusProperty(bus, service, ethernetObj.first, | ||
ethernetIntf, "DHCPEnabled"); | ||
|
||
- return std::get<bool>(value); | ||
+ return EthernetInterface::convertDHCPConfFromString(std::get<std::string>(value)); | ||
} | ||
|
||
bool getDHCPOption(std::string prop) | ||
@@ -1050,7 +1053,7 @@ ipmi_ret_t setDCMIConfParams(ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request, | ||
case dcmi::DCMIConfigParameters::ActivateDHCP: | ||
|
||
if ((requestData->data[0] & DCMI_ACTIVATE_DHCP_MASK) && | ||
- dcmi::getDHCPEnabled()) | ||
+ (dcmi::getDHCPEnabled() != EthernetInterface::DHCPConf::none)) | ||
{ | ||
// When these conditions are met we have to trigger DHCP | ||
// protocol restart using the latest parameter settings, but | ||
-- | ||
2.30.0 | ||
|
33 changes: 33 additions & 0 deletions
33
...a-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0008-Correct-the-dhcp-object-path.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From 2fa5e91b5bc7641139d9469979490067852b8440 Mon Sep 17 00:00:00 2001 | ||
From: Thang Tran <[email protected]> | ||
Date: Tue, 20 Dec 2022 14:12:01 +0700 | ||
Subject: [PATCH] Correct the dhcp object path | ||
|
||
The object path which includes DHCPConfiguration interface is | ||
"/xyz/openbmc_project/network/dhcp", it does not include "config". | ||
|
||
Tested: | ||
1. Get configuration params successfully | ||
$ipmitool dcmi get_conf_param | ||
|
||
Signed-off-by: Thang Tran <[email protected]> | ||
--- | ||
dcmihandler.hpp | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/dcmihandler.hpp b/dcmihandler.hpp | ||
index 81c1e0b..303f6d0 100644 | ||
--- a/dcmihandler.hpp | ||
+++ b/dcmihandler.hpp | ||
@@ -48,7 +48,7 @@ static constexpr auto ethernetIntf = | ||
"xyz.openbmc_project.Network.EthernetInterface"; | ||
static constexpr auto ethernetDefaultChannelNum = 0x1; | ||
static constexpr auto networkRoot = "/xyz/openbmc_project/network"; | ||
-static constexpr auto dhcpObj = "/xyz/openbmc_project/network/config/dhcp"; | ||
+static constexpr auto dhcpObj = "/xyz/openbmc_project/network/dhcp"; | ||
static constexpr auto dhcpIntf = | ||
"xyz.openbmc_project.Network.DHCPConfiguration"; | ||
static constexpr auto systemBusName = "org.freedesktop.systemd1"; | ||
-- | ||
2.30.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters