History log of /openbmc/google-ipmi-sys/handler.cpp (Results 1 – 25 of 33)
Revision Date Author Comments
# 56b2d9f3 30-May-2024 Brandon Kim <brandonkim@google.com>

handler: Fix getBMInstanceProperty to read spaces

std::getline should be used to avoid terminating the read when there are
spaces.

Tested:
Before:
~# cat /run/bm-instance/asset-tag
testing space
~#

handler: Fix getBMInstanceProperty to read spaces

std::getline should be used to avoid terminating the read when there are
spaces.

Tested:
Before:
~# cat /run/bm-instance/asset-tag
testing space
~# ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x17 0x00
79 2b 00 17 07 74 65 73 74 69 6e 67

After:
~# cat /run/bm-instance/asset-tag
testing space
~# ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x17 0x00
79 2b 00 17 0d 74 65 73 74 69 6e 67 20 73 70 61 63 65

Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: Ia13880e385150487dfe07c4aabf7b3edc814ccf0

show more ...


# 559cb011 03-May-2024 Brandon Kim <brandonkim@google.com>

bm_instance: Create a new handler

This OEM handler will get properties from tmpfs to serve over IPMI.

Tested:
~# cat /run/bm-instance/asset-tag
12345
~# ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x17 0

bm_instance: Create a new handler

This OEM handler will get properties from tmpfs to serve over IPMI.

Tested:
~# cat /run/bm-instance/asset-tag
12345
~# ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x17 0x00
79 2b 00 17 05 31 32 33 34 35
...
...
(Verified this works for all 7 sub commands)

Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: I191b6f4994d91ada49a3332a8e93a3a305561904

show more ...


# d455bfd6 30-Jan-2024 Gaurav Gandhi <gauravgandhi@google.com>

Add new oem command to set accel power mode

Signed-off-by: Gaurav Gandhi <gauravgandhi@google.com>
Change-Id: Ie0b47477b7ae9e8ae206ac0645571a7a79dbda40


# 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 ...


# 15d4d21c 11-Jul-2023 Hao Zhou <haoooamazing@google.com>

File System: Dependency Injection and Mock

1. Add an abstract FileSystemInterface for Dependency Injection
2. Add FileSystemWrapper for real file system operations, which is
called in produciton

File System: Dependency Injection and Mock

1. Add an abstract FileSystemInterface for Dependency Injection
2. Add FileSystemWrapper for real file system operations, which is
called in produciton
3. Add FileSystemMock for unit test mock only
4. Add bm_mode_transition_unittest.cpp to cover file system based bm
mode transition

Tested:
1/14 eth OK 0.22s
2/14 flash OK 0.21s
3/14 machine OK 0.12s
4/14 bmc_mode OK 0.05s
5/14 cable OK 0.27s
6/14 cpld OK 0.25s
7/14 entity OK 0.24s
8/14 google_accel_oob OK 0.20s
9/14 pcie OK 0.11s
10/14 poweroff OK 0.09s
11/14 psu OK 0.08s
12/14 pcie_bifurcation OK 0.07s
13/14 bm_mode_transition OK 0.29s
14/14 handler OK 0.44s

Ok: 14
Expected Fail: 0
Fail: 0
Unexpected Pass: 0
Skipped: 0
Timeout: 0

Change-Id: I8d0d9096fbeee7af1946d7e73f548e4a249d3bee
Signed-off-by: Hao Zhou <haoooamazing@google.com>

show more ...


# a92d0e6b 29-Jun-2023 John Wedig <johnwedig@google.com>

Add IPMI OEM command LinuxBootDone

Add a new OEM command for LinuxBoot to notify the BMC when it is about
to kexec into the OS. This is intended to give the BMC a chance to
prepare for an untrusted

Add IPMI OEM command LinuxBootDone

Add a new OEM command for LinuxBoot to notify the BMC when it is about
to kexec into the OS. This is intended to give the BMC a chance to
prepare for an untrusted OS, e.g. disable any interfaces it doesn't want
the OS to have access to.

Tested:
Exercised the new OEM command using ipmitool
$ ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x11
79 2b 00 11

Change-Id: Ica76d77cdde48cebfbced32d8e7e860b559074e8
Signed-off-by: John Wedig <johnwedig@google.com>

show more ...


# 4baf41c8 06-Jul-2023 Hao Zhou <haoooamazing@google.com>

Add flags for bmc modes transitions

1. When /run/bm-drive-cleaning-done.flag is present, it means cleaning
is done and we are in BM_MODE. Also, it is acked by renaming flag to
bm-drive-cleani

Add flags for bmc modes transitions

1. When /run/bm-drive-cleaning-done.flag is present, it means cleaning
is done and we are in BM_MODE. Also, it is acked by renaming flag to
bm-drive-cleaning-done-ack.flag
2. if not case 1, when /run/bm-drive-cleaning-done-ack.flag is present,
it means the cleaing is done and acked
3. if not case 2, when bm-ready.flag is present, it means we are in
BM_CLEANING_MODE. /run/bm-drive-cleaning.flag is created if needed
4. otherwise, we are in NON_BM_MODE

Tested:
bm-ready.flag is not present. Respond Non-BM mode:

ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x10
79 2b 00 10 00

bm-ready.flah is present. For next call, respond Cleaning Mode and
bm-drive-cleaning.flag is created:

ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x10
79 2b 00 10 02

keep responding Cleaning Mode until bm-drive-cleaning-done.flag is
created. So cleaning is done and for next call, respond BM mode and
rename bm-drive-cleaning-done.flag to bm-drive-cleaning-done-ack.flag:

ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x10
79 2b 00 10 01

Change-Id: Id8a6049550631c30c68a536313b81a8d800fede0
Signed-off-by: Hao Zhou <haoooamazing@google.com>

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 ...


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

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

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

show more ...


# 3f3ca035 17-Mar-2023 Brandon Kim <brandonkim@google.com>

handler: Add check for file existence for BM mode

/tmp/BMReady.flag indicates that we are in BM mode.

Tested:
Verified both cases -
- Mar 21 11:17:52 ipmid[1130]: /tmp/BMReady.flag exists so we mus

handler: Add check for file existence for BM mode

/tmp/BMReady.flag indicates that we are in BM mode.

Tested:
Verified both cases -
- Mar 21 11:17:52 ipmid[1130]: /tmp/BMReady.flag exists so we must be in BM mode
- Mar 21 10:37:04 ipmid[1076]: Unable to find /tmp/BMReady so we must not be in BM mode

Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: I9fa99b40afea7e48ce7e1f9c47e8f081b71b897f

show more ...


# 8ec4106b 24-Oct-2022 Nikhil Namjoshi <nikhilnamjoshi@google.com>

Move bmc mode enum to a header file

Tested:

Response in BM Mode:
ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x10
79 2b 00 14 01

Response in Non-BM Mode:
ipmitool raw 0x2e 0x32 0x79

Move bmc mode enum to a header file

Tested:

Response in BM Mode:
ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x10
79 2b 00 14 01

Response in Non-BM Mode:
ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x10
79 2b 00 14 00

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
Change-Id: I3e0ca730ccaed74c3195eb3a4002719077251745

show more ...


# 5e70dc8c 15-Sep-2022 Nikhil Namjoshi <nikhilnamjoshi@google.com>

Add ipmi OEM handler to get the BMC mode

The response can indicate one of the BMC mode
below
0 -> Non Bare Metal Mode
1 -> Bare Metal Mode
2 -> Bare Metal Cleaning Mode

The Bare Metal Cleaning Mode

Add ipmi OEM handler to get the BMC mode

The response can indicate one of the BMC mode
below
0 -> Non Bare Metal Mode
1 -> Bare Metal Mode
2 -> Bare Metal Cleaning Mode

The Bare Metal Cleaning Mode is not
yet supported

Tested:

Response in BM Mode

ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x10
79 2b 00 14 01

Response in Non-BM Mode

ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x10
79 2b 00 14 00

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
Change-Id: I34474fd04f9aed35bd71725805ed52a5df8ab8c9

show more ...


# 0e928ac6 20-Jun-2022 Michael Shen <gpgpgp@google.com>

accel: rename `accelOobGetDbus` to `getBus`

accelOobGetDbus returns a dbus bus which can be leverage by others.
Rename it to a more common name.

Tested: Unittest passed.
Signed-off-by: Michael Shen

accel: rename `accelOobGetDbus` to `getBus`

accelOobGetDbus returns a dbus bus which can be leverage by others.
Rename it to a more common name.

Tested: Unittest passed.
Signed-off-by: Michael Shen <gpgpgp@google.com>
Change-Id: I0e48f7f6a49c09b397d52e9343bc3e32ca41d9d8

show more ...


# e5a06675 20-Jun-2022 Michael Shen <gpgpgp@google.com>

all: cleanup, prefer "ipmid/api-types.hpp" type to "ipmid/api.h" type

Tested: N/A
Signed-off-by: Michael Shen <gpgpgp@google.com>
Change-Id: Id3e9f206516c55b3605835b32d6cd2b488c52a60


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

pcie_bifurcation: Fetch bifurcation at a PCIe slot with hardcoded values

This will read a json config and return the bifurcation based on that.
It will read the configure file in a persistent file t

pcie_bifurcation: Fetch bifurcation at a PCIe slot with hardcoded values

This will read a json config and return the bifurcation based on that.
It will read the configure file in a persistent file to see if it is
valid machine config and return the bifurcation information
accordingly.

For example,
If it is valid config, it will return 8x8 for PE1,3,4,6.

Tested:
Unit tests passed.

Physical Tests.

PE0 -> no bifurcation
PE1 -> x8x8

```
$ ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x0f 0
79 2b 00 0b 00

$ ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x0f 1
79 2b 00 0b 02 08 08
```

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

show more ...


# 4f0d1de6 20-Sep-2021 Steve Foreman <foremans@google.com>

Add IPMI interface for CustomAccel service

Change-Id: I28a8976e382b457233ac521e9ab71f75abe029d1
Signed-off-by: Steve Foreman <foremans@google.com>


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

Add Google Copyright 2021

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


# b69209b4 13-Jul-2021 William A. Kennington III <wak@google.com>

eth: Support looking up alternate interace channels

This makes it possible to use the GetEthDevice command to look up
interfaces other than the default NCSI interface.

Change-Id

eth: Support looking up alternate interace channels

This makes it possible to use the GetEthDevice command to look up
interfaces other than the default NCSI interface.

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

show more ...


# 8d3d46a2 13-Jul-2021 William A. Kennington III <wak@google.com>

handler: Don't hardcode channel information

We can use the functions from the ipmi daemon to get the proper channel
for the named NIC.

Change-Id: I9f479ec90bffed147a68131a6dda5a

handler: Don't hardcode channel information

We can use the functions from the ipmi daemon to get the proper channel
for the named NIC.

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

show more ...


# 8cfa4c44 16-Jun-2021 linyuny <linyuny@google.com>

Add new google ipmi sys command: SysHostPowerOff

New google ipmi sys command to let the BMC knows host shutdown,
allow host to gracefully shutdown and disable the watchdog with given

Add new google ipmi sys command: SysHostPowerOff

New google ipmi sys command to let the BMC knows host shutdown,
allow host to gracefully shutdown and disable the watchdog with given
time delay.

Signed-off-by: Yunyun Lin <linyuny@google.com>
Change-Id: I02171c9cfed57ae5d10d66b515e4ab7ee8856466

show more ...


# 3b1b427c 02-Mar-2021 Willy Tu <wltu@google.com>

Add OEM command to request flash size

The BMC flash is `/dev/mtd0` and the size can found in
`/sys/class/mtd/mtd0/size`. This OEM command will request that
information with MTDINFO.

Add OEM command to request flash size

The BMC flash is `/dev/mtd0` and the size can found in
`/sys/class/mtd/mtd0/size`. This OEM command will request that
information with MTDINFO.

Tested:
Successfully requested the flash size information with ipmitool.

```
cat /sys/class/mtd/mtd0/size
67108864
```
67108864 / 1024 / 1024 = 64MB flash

```
ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x09
79 2b 00 09 00 00 00 04
```
Output in little endian.
0x04000000 -> 67108864

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

show more ...


# ac4a16f7 02-Feb-2021 Shounak Mitra <shounak@google.com>

Add sys command for powercycle on host shutdown.

The new command will trigger a power cycle the next time the host shuts
down. This can exist in parallel with the existing mechanism to t

Add sys command for powercycle on host shutdown.

The new command will trigger a power cycle the next time the host shuts
down. This can exist in parallel with the existing mechanism to trigger
a power cycle after a specified time interval.

The implementation of host state detection and power cycling is platfrom
specific; the new command will just add a temporary file that marks the
system ready to powercycle on the next shutdown. Usually, a systemd unit
would be enabled by the presence of this file to handle the power
cycling process.

Signed-off-by: Shounak Mitra <shounak@google.com>
Change-Id: I0cc40307748fb996be3f6062d8cba1a4b5049683

show more ...


# 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
wh

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 ...


# 29f35bce 04-Nov-2020 William A. Kennington III <wak@google.com>

Add suppport for retrieving machine name

This adds support for reading /etc/os-release, parsing out
OPENBMC_TARGET_MACHINE and returning this to the caller.

Change-Id: If2a419b9

Add suppport for retrieving machine name

This adds support for reading /etc/os-release, parsing out
OPENBMC_TARGET_MACHINE and returning this to the caller.

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

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 <ventu

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 ...


12