Skip to content

Commit

Permalink
Merge pull request #2 from wistron-corporation/OP940_20190917
Browse files Browse the repository at this point in the history
Add 2nd MAC address for 2nd NIC
  • Loading branch information
rfrandse authored Sep 18, 2019
2 parents ee79ca8 + 27360f1 commit 540038a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ constexpr const char* getKeyword<Keyword::VP>()
*
* BMC The VPD on the BMC planar, for eg
* ETHERNET The ethernet card on the BMC
* ETHERNET1 The 2nd ethernet card on the BMC
*/
enum Fru
{
BMC,
ETHERNET
ETHERNET,
ETHERNET1
};

} // namespace vpd
Expand Down
11 changes: 10 additions & 1 deletion write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ namespace vpd
namespace inventory
{

// Some systems have two MAC addresses
static const std::unordered_map<std::string, Fru> supportedFrus = {
{"BMC", Fru::BMC}, {"ETHERNET", Fru::ETHERNET}};
{"BMC", Fru::BMC},
{"ETHERNET", Fru::ETHERNET},
{"ETHERNET1", Fru::ETHERNET1}};

void write(const std::string& type, const Store& vpdStore,
const std::string& path)
Expand Down Expand Up @@ -46,6 +49,12 @@ void write(const std::string& type, const Store& vpdStore,
break;
}

case Fru::ETHERNET1:
{
writeFru<Fru::ETHERNET1>(vpdStore, path);
break;
}

default:
break;
}
Expand Down
6 changes: 6 additions & 0 deletions writefru.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ ETHERNET:
VINI,B1: MACAddress
OPFR,B1: MACAddress
xyz.openbmc_project.Inventory.Item.Ethernet:

ETHERNET1:
xyz.openbmc_project.Inventory.Item.NetworkInterface:
VINI,B1: MACAddress
OPFR,B1: MACAddress
xyz.openbmc_project.Inventory.Item.Ethernet:

0 comments on commit 540038a

Please sign in to comment.