History log of /openbmc/google-ipmi-sys/main.cpp (Results 1 – 19 of 19)
Revision Date Author Comments
# 8c0094e4 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I8c81e5e5b6bd1ec4bdd52aa9039ef1c4bbef088d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 8d618532 25-Oct-2023 Michael Shen <gpgpgp@google.com>

all: Use stdplus::print over std::fprintf

Replacing `std::fprintf` with `stdplus::print`.
No logical change.

Tested: Buildable.
Signed-off-by: Michael Shen <gpgpgp@google.com>
Change-Id: I7050885c1

all: Use stdplus::print over std::fprintf

Replacing `std::fprintf` with `stdplus::print`.
No logical change.

Tested: Buildable.
Signed-off-by: Michael Shen <gpgpgp@google.com>
Change-Id: I7050885c13e33244a4128aa519d163fd5b725098

show more ...


# 444b5ea4 19-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I0a1783b101aa4e7d4b80fd5e1fc1b2beb86c5caa

show more ...


# b4e3704c 12-Oct-2021 Willy Tu <wltu@google.com>

google-ipmi-sys: Convert input to use std::span<const uint8_t>

Change-Id: I533de34c04e3d2577cb9076add441153b2994c30
Signed-off-by: Willy Tu <wltu@google.com>


# ff3cd8e9 15-Sep-2021 Willy Tu <wltu@google.com>

google-ipmi-sys: Refactor to use new version of OEM IPMI Handler

Using the new version of ipmi handler provide a higher level wrapper
over the same functionalities. It helps us parse the input and o

google-ipmi-sys: Refactor to use new version of OEM IPMI Handler

Using the new version of ipmi handler provide a higher level wrapper
over the same functionalities. It helps us parse the input and output to
have more control of the input/output we see.

The input and output will be
`std::uint8_t, std::optional<std::vector<uint8_t>>`.

This represents `subcommand` and any input data.

Changes to note,
- all subcommand in the request/response struct are removed. It will be
managed by the wrapper directly.
- Unit tests checking for input with only the subcommand are
removed.
- Move all reply struct to header files to be accessible in unit test.

Tested:
All IPMI OEM command still works the same as before this change.

Change-Id: I4230ab84a497a867248fe82224e32cc69b314b64
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# a2056e9c 10-Oct-2021 Willy Tu <wltu@google.com>

Add Google Copyright 2021

Change-Id: I26020265613218d0c8df85b83772856bfc555e86
Signed-off-by: Willy Tu <wltu@google.com>


# 96ad9069 24-Nov-2020 William A. Kennington III <wak@google.com>

Remove globally constructed variables

Using global variables that have construction order dependencies on each
other do not guarantee the expected execution order. We had an issue
where the defaultC

Remove globally constructed variables

Using global variables that have construction order dependencies on each
other do not guarantee the expected execution order. We had an issue
where the defaultConfigPath is not constructed from the string in
handler.cpp before it was used to construct the Handler impl.

This resolves the issue by removing runtime constructed global variables
entirely.

Change-Id: I868f34782d22d3b2b07be303a05f58b9c9f8c8b8
Signed-off-by: William A. Kennington III <wak@google.com>

show more ...


# eff1f2eb 05-Aug-2020 Patrick Venture <venture@google.com>

move implementation to ipmi file

Move the entrance point for the IPMI OEM handling to a separate file and
pass in the handler pointer via binding.

Signed-off-by: Patrick Venture <venture@google.com

move implementation to ipmi file

Move the entrance point for the IPMI OEM handling to a separate file and
pass in the handler pointer via binding.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I4371ebee1c252ab6e9d8a7ff2389583919ecc996

show more ...


# c87de558 20-May-2020 Patrick Venture <venture@google.com>

split out handler implementation from interface

Split out the handler object definition from the interface and drop the
default parameters.

Signed-off-by: Patrick Venture <venture@google.com>
Chang

split out handler implementation from interface

Split out the handler object definition from the interface and drop the
default parameters.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ie8c9dbf7881bbe6b5af3596a60430e3b3d573762

show more ...


# 45fad1bb 18-Mar-2019 Patrick Venture <venture@google.com>

style change: lowerCamel

Methods in openbmc are lowercamel.

Change-Id: I57567b66acdc1fc618f3ca7d237455d55783630c
Signed-off-by: Patrick Venture <venture@google.com>


# 2c9e1625 07-Feb-2019 William A. Kennington III <wak@google.com>

Convert host-ipmid -> libipmid

phosphor-host-ipmid now exposes a library along with headers for
interfacing with the ipmi daemon. Compile and link against the new
library.

Change-Id: I7dfdf4ce6364a

Convert host-ipmid -> libipmid

phosphor-host-ipmid now exposes a library along with headers for
interfacing with the ipmi daemon. Compile and link against the new
library.

Change-Id: I7dfdf4ce6364a29b5bbc0696adc1e695651fbe1c
Signed-off-by: William A. Kennington III <wak@google.com>

show more ...


# fd0f1cf9 18-Jan-2019 Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>

google-ipmi-sys: Add "Entity Id:Entity Instance" mapping to Entity name

Say the system has a JSON file like :
{
"cpu": [
{"instance": 1, "name": "CPU0"},
{"instance": 2, "name":

google-ipmi-sys: Add "Entity Id:Entity Instance" mapping to Entity name

Say the system has a JSON file like :
{
"cpu": [
{"instance": 1, "name": "CPU0"},
{"instance": 2, "name": "CPU1"}
],
"memory_module": [
{"instance": 1, "name": "DIMM_A1"},
{"instance": 2, "name": "DIMM_A2"},
{"instance": 3, "name": "DIMM_B1"},
{"instance": 4, "name": "DIMM_B2"},
{"instance": 5, "name": "DIMM_C1"},
{"instance": 6, "name": "DIMM_C2"},
{"instance": 7, "name": "DIMM_D1"},
{"instance": 8, "name": "DIMM_D2"},
{"instance": 9, "name": "DIMM_E1"},
{"instance": 10, "name": "DIMM_E2"},
{"instance": 11, "name": "DIMM_F1"},
],
"add_in_card": [
{"instance": 1, "name": "slot1"},
{"instance": 2, "name": "slot2"},
{"instance": 3, "name": "slot3"},
{"instance": 4, "name": "slot5"}
],
"storage_device": [
{"instance": 1, "name": "SATA0"},
{"instance": 2, "name": "SATA1"},
{"instance": 3, "name": "SATA2"},
{"instance": 4, "name": "SATA3"}
]
}

The system can query the BMC for an Entity name given the Entity ID and Entity Instance.

Tested:
Yes;
1) Sending GetEntityName command; Expecting error since entity ID and
entity instance are not specified.
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06
Unable to send RAW command (channel=0x0 netfn=0x2e lun=0x0 cmd=0x32
rsp=0xc7): Request data length invalid

2) Sending GetEntityName command; Expecting error since entity instance
is not specified.
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06 0x01
Unable to send RAW command (channel=0x0 netfn=0x2e lun=0x0 cmd=0x32
rsp=0xc7): Request data length invalid

3) Sending GetEntityName command; Expecting error since Entity Id = 0x07
is not supported.
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06 0x07 0x01
Unable to send RAW command (channel=0x0 netfn=0x2e lun=0x0 cmd=0x32
rsp=0xcc): Invalid data field in request

4) Sending GetEntityName command; Expecting error since Entity Instance
= 0x06 is not added in the JSON file.
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06 0x3
0x06
Unable to send RAW command (channel=0x0 netfn=0x2e lun=0x0 cmd=0x32
rsp=0xcc): Invalid data field in request

5) Sending GetEntityName command; Expecting success.
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06 0x3
0x01
79 2b 00 06 04 43 50 55 30
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06 0x0B
0x01
79 2b 00 06 05 73 6c 6f 74 31
root@adler:~#

Change-Id: Idf6caae863acacd62460cbb7f73bf56fc927bcff
Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>

show more ...


# 2d4836db 29-Nov-2018 Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>

google-ipmi-sys: Add support for PCIE slot to I2C bus mapping

Say the bmc has the following information:
root@xyz:/sys/bus/i2c/devices# ls
0-0070 10-0048 4-0049 5-0062 5-0066 5-0074 i2c-1

google-ipmi-sys: Add support for PCIE slot to I2C bus mapping

Say the bmc has the following information:
root@xyz:/sys/bus/i2c/devices# ls
0-0070 10-0048 4-0049 5-0062 5-0066 5-0074 i2c-1 i2c-15 i2c-18 i2c-20 i2c-4 i2c-7
1-004e 3-0054 4-004d 5-0063 5-0067 9-004c i2c-10 i2c-16 i2c-19 i2c-21 i2c-5 i2c-8
1-004f 4-0048 5-0061 5-0065 5-0072 i2c-0 i2c-14 i2c-17 i2c-2 i2c-3 i2c-6 i2c-9
root@xyz:/sys/bus/i2c/devices# cd i2c-18
root@xyz:/sys/bus/i2c/devices/i2c-18# ls
delete_device i2c-dev mux_device name new_device
of_node power subsystem uevent
root@xyz:/sys/bus/i2c/devices/i2c-18# cd of_node
root@xyz:/sys/bus/i2c/devices/i2c-18/of_node# ls
root@xyz:/sys/bus/i2c/devices/i2c-18/of_node# cat pcie-slot
/pcie-slot/pcie@4root@xyz:/sys/bus/i2c/devices/i2c-18/of_node# cd
root@xyz:~# cd /sys/firmware/devicetree/base
root@xyz:/sys/firmware/devicetree/base# ls
root@xyz:/sys/firmware/devicetree/base# cd pcie-slot/
root@xyz:/sys/firmware/devicetree/base/pcie-slot# ls
name pcie@1a pcie@2a pcie@4 pcie@6
root@xyz:/sys/firmware/devicetree/base/pcie-slot# cd pcie\@4
root@xyz:/sys/firmware/devicetree/base/pcie-slot/pcie@4# ls
name slot-name
root@xyz:/sys/firmware/devicetree/base/pcie-slot/pcie@4# cat slot-name
slot4root@xyz:/sys/firmware/devicetree/base/pcie-slot/pcie@4#

Then the system can send commands to
1) Get the number of pcie slots.
2) Get information about which i2c bus is routed to which pcie slot.

Tested:
Yes;
1) Sending GetPCIeSlotsCount command; Getting pcie slots count as 4.
root@xyz:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x04
79 2b 00 04 04

3) Sending GetPCIeSlotI2cBusMapping command with entry ID 0; expecting success;
received "slot5".
root@xyz:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x05 0x00
79 2b 00 05 14 05 73 6c 6f 74 35

4) Sending GetPCIeSlotI2cBusMapping command with entry ID 1; expecting success;
received "slot1".
root@xyz:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x05 0x01
79 2b 00 05 0e 05 73 6c 6f 74 31

5) Sending GetPCIeSlotI2cBusMapping command with entry ID 2; expecting success;
received "slot3".
root@xyz:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x05 0x02
79 2b 00 05 12 05 73 6c 6f 74 33

6) Sending GetPCIeSlotI2cBusMapping command with entry ID 3; expecting success;
received "slot2".
root@xyz:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x05 0x03
79 2b 00 05 10 05 73 6c 6f 74 32

7) Sending GetPCIeSlotI2cBusMapping command with entry ID 4; expecting failure
root@xyz:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x05 0x04
Unable to send RAW command (channel=0x0 netfn=0x2e lun=0x0 cmd=0x32 rsp=0xc1): Invalid command
root@xyz:~#

Change-Id: Id6e514bb11e8d4a00c615cffea6c2fdb6f5df03e
Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>

show more ...


# fff98617 12-Nov-2018 Patrick Venture <venture@google.com>

Use more specific ipmi error codes

Most errors in the handler were returning an unsupported code and not a
more specific code articulating the failure. Update the code to use
more specific errors.

Use more specific ipmi error codes

Most errors in the handler were returning an unsupported code and not a
more specific code articulating the failure. Update the code to use
more specific errors.

Change-Id: I7f517d094245e8e1a6169f43582522889bb895d0
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 96b088a7 13-Nov-2018 Patrick Venture <venture@google.com>

s/setupGlobalOemCableCheck/setupGoogleOemSysCommands/g

Rename the library constructor to reflect its true purpose.

Change-Id: I40e43b6c658494fd08086bd371432ba5a8198277
Signed-off-by: Patrick Ventur

s/setupGlobalOemCableCheck/setupGoogleOemSysCommands/g

Rename the library constructor to reflect its true purpose.

Change-Id: I40e43b6c658494fd08086bd371432ba5a8198277
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 28557a1f 28-Sep-2018 Patrick Venture <venture@google.com>

main: drop unused headers

Dropped headers that were added during development. These headers are
no longer required.

Change-Id: Ib725e642dfb33dfaf55eb10d36f7ffe32f3a6789
Signed-off-by: Patrick Vent

main: drop unused headers

Dropped headers that were added during development. These headers are
no longer required.

Change-Id: Ib725e642dfb33dfaf55eb10d36f7ffe32f3a6789
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# ce07ee0a 19-Sep-2018 Patrick Venture <venture@google.com>

wrap stdlib calls into cpp namespace

Wrap the stdlib calls into the cpp namespace.

Change-Id: I7ae16d0d18312f3d4118b1d5345df07e28773484
Signed-off-by: Patrick Venture <venture@google.com>


# 90246e26 17-Sep-2018 Patrick Venture <venture@google.com>

main: fixup log message to fixed type

By statically casting to a fixed-size type we can ensure the code
compiles the same for 64-bit and 32-bit environments (for the most
part w.r.t this).

Change-I

main: fixup log message to fixed type

By statically casting to a fixed-size type we can ensure the code
compiles the same for 64-bit and 32-bit environments (for the most
part w.r.t this).

Change-Id: If4989c7d3d0879e08be89dfa2a7846cf06dee883
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 4d49ae65 17-Sep-2018 Patrick Venture <venture@google.com>

google-ipmi-sys: initial commit: OEM IPMI handler

This implements a set of OEM IPMI commands built as sub-commands under
one OEM IPMI command registered in the Google OEM Namespace.

Change-Id: I65f

google-ipmi-sys: initial commit: OEM IPMI handler

This implements a set of OEM IPMI commands built as sub-commands under
one OEM IPMI command registered in the Google OEM Namespace.

Change-Id: I65ff6f35838b501ac6ac67f7765bbc474b808660
Signed-off-by: Patrick Venture <venture@google.com>

show more ...