History log of /openbmc/phosphor-host-ipmid/include/ (Results 76 – 100 of 121)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
4cc4255611-Sep-2019 Sui Chen <suichen@google.com>

Refactor ipmi::sensor::GetSensorResponse away from std::array

This change refactors GetSensorResponse from std::array to struct.
This change depends on change #23544.

GetSensorResponse is an intern

Refactor ipmi::sensor::GetSensorResponse away from std::array

This change refactors GetSensorResponse from std::array to struct.
This change depends on change #23544.

GetSensorResponse is an internal, intermediate structure, an unpacked
form of a Get Sensor Reading response, providing direct access to its
fields. Its life time is:
GetReadingResponse -> GetSensorResponse -> ipmi::RspType.

It is written to in 5 functions in the ipmi::sensor::get namespace, by
four setter functions (setOffset, setReading, setAssertionBytes,
enableScanning).
It is currently read from by 1 function (ipmiSensorGetSensorReading)
for transforming to an ipmi::RspType.

Originally, the setter functions assumed bitwise equivalence between
GetSensorResponse and GetReadingResponse, and the setter functions
used reinterpret_cast to assign to a GetSensorResponse as if it were
a GetReadingResponse.

With this change, the reinterpret_cast's are removed, and the set
functions now accept GetSensorResponse instead of GetReadingResponse,
so the code gets a bit easier to read.

Tested: Tested using a server with a BMC; sensor readings obtained
through `ipmitool` appear to be correct (the reading might change
within a small range):
# ipmitool raw 0x04 0x2d 0x16
9B 40 00 00

Signed-off-by: Sui Chen <suichen@google.com>
Change-Id: I5d454d6249f5431fb98169e6ef7c585c34024004

show more ...

f71444da25-Jul-2019 Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com>

Implemented get session info cmd in host interface

This command can get info of any session

Tested all positive and negative test cases

Tested:

Get active session info by valid session handle
ipm

Implemented get session info cmd in host interface

This command can get info of any session

Tested all positive and negative test cases

Tested:

Get active session info by valid session handle
ipmitool raw 0x6 0x3d <sesssion index = search session by handle> <valid session handle>
Response : successfully gets the session info as per IPMI spec

Get active session info by valid session id
ipmitool raw 0x6 0x3d <sesssion index = search session by id> <valid session id>
Response : successfully gets the session info as per IPMI spec

Get inactive session info by valid session handle
ipmitool raw 0x6 0x3d <sesssion index = search session by handle> <valid session handle>
Response : successfully gets the session info as per IPMI spec

Get inactive session info by valid session id
ipmitool raw 0x6 0x3d <sesssion index = search session by id> <valid session id>
Response : successfully gets the session info as per IPMI spec

Get session info by invalid session handle
ipmitool raw 0x6 0x3d <sesssion index = search session by handle> <invalid session handle>
Response : 0x88 // Inavlid Session Handle

Get session info by invalid session id
ipmitool raw 0x6 0x3d <sesssion index = search session by id> <invalid session id>
Response : 0x87 // Inavlid Session Id

Signed-off-by: Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com>
Change-Id: Ib36a9fe5eac58d15011cc9379ceed480ba0be96d

show more ...

c514d87406-Apr-2019 William A. Kennington III <wak@google.com>

transporthandler: Rewrite + New Handler

This rewrites the old transport handler to use the new ipmi handler
registration functions. It attempts to clean up the old code, by
refactoring any business

transporthandler: Rewrite + New Handler

This rewrites the old transport handler to use the new ipmi handler
registration functions. It attempts to clean up the old code, by
refactoring any business logic out of the code that parses the IPMI
messages. This makes the code paths easier to understand and allows for
better code re-use.

This also gets rid of the concept of the settings change timer. Clients
expect to see their settings take effect as soon as they are set,
regardless of the "Set In Progress" flag. This means we no longer need a
cache for our network settings that are about to be set by the daemon,
and a client can hold the BMC in "Set In Progress" while it verifies
settings like other BMC implementations.

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

show more ...

e702392610-Jul-2019 Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com>

Implemented close session cmd in host interface

This command can close any session via host interface.

Tested:

Close the existing valid session by session id
ipmitool raw 0x6 0x3c <valid sesssion

Implemented close session cmd in host interface

This command can close any session via host interface.

Tested:

Close the existing valid session by session id
ipmitool raw 0x6 0x3c <valid sesssion id >
Response : 00 // success

Close the existing valid session by session handle
ipmitool raw 0x6 0x3c <zero session id> <valid session handle>
Response : 00 // success

Close the session by zero session id
ipmitool raw 0x6 0x3c <zero session id>
Response : 0x87 // inavlid session id

Close the session by zero session handle
ipmitool raw 0x6 0x3c <zero session id> <zero session handle>
Response : 0x88 // inavlid session handle

Close an inactive session.
ipmitool raw 0x6 0x3c <valid session id>
Response : 0xcc // invalid data field in request

Close an inactive session.
ipmitool raw 0x6 0x3c <zero session id> <valid session hnadle>
Response : 0xcc // invalid data field in request

Signed-off-by: Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com>
Change-Id: I8af290001d8effbbcdbbe2dd93aabf1b015e7a88

show more ...

caabc36b23-Jul-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

fix logic error for unpack vector of tuple

Unpacking a vector of tuples is failing if the correct number of bytes
does not match an integral number of bytes needed to fully unpack all
the tuples.

U

fix logic error for unpack vector of tuple

Unpacking a vector of tuples is failing if the correct number of bytes
does not match an integral number of bytes needed to fully unpack all
the tuples.

Unpacking a tuple should return an error if it does not fully unpack all
the items. This will signal the vector unpack to bail and return however
many items it has unpacked to that point.

A vector unpack should always return success because no matter how many
items it has unpacked, it is fine, because a vector can have any number
of items.

Tested: Unit tests updated to check for proper unpacking of vectors and
tuples (and optionals) as well as new unit tests added for more
targetted testing.

Change-Id: I4b45198f8bc4a49913beb923d10079983179402a
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

cb09aa0006-Sep-2019 James Feist <james.feist@linux.intel.com>

Change yield from ptr to object

The ptr makes for ugly code:
i.e. *(ctx->yield) all over the place.

Change it to copy as it is just 4 pointers.

Tested: ipmitool mc info still works

Change-Id: I30

Change yield from ptr to object

The ptr makes for ugly code:
i.e. *(ctx->yield) all over the place.

Change it to copy as it is just 4 pointers.

Tested: ipmitool mc info still works

Change-Id: I30c5bc395849875cd58925fac99bb23c1804cd5b
Signed-off-by: James Feist <james.feist@linux.intel.com>

show more ...

7dc4ac0223-Aug-2019 Yong Li <yong.b.li@linux.intel.com>

Move i2c WR api into libipmid

Move the low-level i2c write-read api into libipmid,
to allow provider libraries access to i2c without duplicating this code.

Tested:
I2c master write read command sti

Move i2c WR api into libipmid

Move the low-level i2c write-read api into libipmid,
to allow provider libraries access to i2c without duplicating this code.

Tested:
I2c master write read command still works:
ipmitool i2c bus=2 0x9c 8 0

Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Change-Id: I0d5f82cf46ecf871eebb47aae25537b5da1f2e6a

show more ...

48408b6d22-Aug-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

legacy handlers need a bigger buffer

In the original ipmi execution queue, handlers were passed a larger
buffer. The current code was only passing in the configured channel
size, or 64 if no size wa

legacy handlers need a bigger buffer

In the original ipmi execution queue, handlers were passed a larger
buffer. The current code was only passing in the configured channel
size, or 64 if no size was configured. This is too small and leads
to buffer overflows for responses greater than 64 bytes.

This brings the buffer sizes up to a point that matches the legacy
code and to a size that is larger than any of IPMI standard transport
sizes.

Tested: used a bogus handler to create a large response and found that
the entire response was returned.

Change-Id: I91b359812247ae5fdef105c7b7a9dfe003548494
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

23d0644113-Mar-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

Use boost::asio::post() instead of io->post()

According to the documentation io->post is deprecated, saying
that boost::asio::post() should be used instead.

Tested: ipmid runs the same as it did be

Use boost::asio::post() instead of io->post()

According to the documentation io->post is deprecated, saying
that boost::asio::post() should be used instead.

Tested: ipmid runs the same as it did before.

Change-Id: I552c7cb5cb8ad8f9f6e2bcffa61ce5135e2faad2
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

1a4beed912-Jun-2019 Suryakanth Sekar <suryakanth.sekar@linux.intel.com>

Defining session const for multi net session mgmt

This session const will be used in multi session management and session
commands and replace the existing session const used into lowercamel case

Defining session const for multi net session mgmt

This session const will be used in multi session management and session
commands and replace the existing session const used into lowercamel case

Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com>
Change-Id: I76725acdf5d3d002f82a1076509ed37d668d01d3

show more ...

a3dd766130-May-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

unpack static assert on unsupported types

Unsupported types might not cause compile time errors but can result
in SIGILL errors at runtime when compiler warnings are ignored.

This was found when co

unpack static assert on unsupported types

Unsupported types might not cause compile time errors but can result
in SIGILL errors at runtime when compiler warnings are ignored.

This was found when compiling an intel-ipmi-oem handler that attempted
to unpack an enum class type. The code compiles down to an empty
function (no return statement or value), which can result in all sorts
of undefined behavior. This change forces the unsupported types to emit
a static assert and fail to compile.

Tested: Created a handler that requests an enum class as an input and
saw that the build fails with a static assert.

Change-Id: I123da15cb001756f07761cf7a60b799469926a2a
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

33298af113-May-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

Add sdbusplus::asio::connection pointer to ipmi::Context

This adds a std::shared_ptr<sdbusplus::asio::connection> to every
ipmi::Context in order to facilitate easy transition to
yield_method_call o

Add sdbusplus::asio::connection pointer to ipmi::Context

This adds a std::shared_ptr<sdbusplus::asio::connection> to every
ipmi::Context in order to facilitate easy transition to
yield_method_call over other D-Bus interfaces. This means that a
getDbusObjects call could just pass in the ipmi::Context and it will get
a yielding call. ipmi::Context is a natural fit because one is created
for each of the boost::asio::coroutine contexts. And because a yielding
call needs both an async D-Bus connection and a yield_context, this
means that we now have one object to rule them all.

Tested: Created a handler that uses the new shared_ptr in the context
to see the API in action.

Change-Id: I429a324180a38bf17845f7fd0544df2226d0300a
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

16b8693d01-May-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

remove usage of sdbusplus::message::variant

sdbusplus has had its alias of std::variant in place for long
enough. This changes all ipmid references to use std::variant
directly instead of the sdbusp

remove usage of sdbusplus::message::variant

sdbusplus has had its alias of std::variant in place for long
enough. This changes all ipmid references to use std::variant
directly instead of the sdbusplus alias.

Tested-by: building and running ipmid

Change-Id: Id5b4136d4589aa598815edd3ef4202e64a7698e2
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

f865dea903-May-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

Return invalid data length (0xc7) for commands not properly unpacked

The correct value for commands that unpacked but did not consume all
the data was already returned (0xc7), but if all the expecte

Return invalid data length (0xc7) for commands not properly unpacked

The correct value for commands that unpacked but did not consume all
the data was already returned (0xc7), but if all the expected data
was not present, the return code was the response of the unpack
command, which is not an IPMI value. This changes the unpack response
to always return 0xc7 if it is too short or too long for the command.

Tested-by: run ipmitool with correct and incorrect byte counts
(get channel access command expects 2 bytes of data)
# ipmitool raw 6 0x41
Unable to send RAW command (channel=0x0 netfn=0x6
lun=0x0 cmd=0x41 rsp=0xc7): Request data length invalid
# ipmitool raw 6 0x41 1
Unable to send RAW command (channel=0x0 netfn=0x6
lun=0x0 cmd=0x41 rsp=0xc7): Request data length invalid
# ipmitool raw 6 0x41 1 0x80
40 40
# ipmitool raw 6 0x41 1 0x80 1
Unable to send RAW command (channel=0x0 netfn=0x6
lun=0x0 cmd=0x41 rsp=0xc7): Request data length invalid

Change-Id: Ic72c1f2050f7bdcdcc8a5b808d11f80fac4e9813
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

5d06cc6d25-Apr-2019 William A. Kennington III <wak@google.com>

handler: Fix request passing for legacy commands

Legacy OEM commands didn't handle the IANA numbers themselves as part
of their handler body, and expect the request buffer to not contain
them. We ca

handler: Fix request passing for legacy commands

Legacy OEM commands didn't handle the IANA numbers themselves as part
of their handler body, and expect the request buffer to not contain
them. We can't pass the raw buffer without removing the already
extracted prefixes.

This should make legacy OEM commands work again.

Also reworks group handling to become consistent with OEM handling. This
happens to fix cases where groupIds were not being returned with error
codes.

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

show more ...

92476a8425-Apr-2019 William A. Kennington III <wak@google.com>

message: Support prepending payloads

Needed solely so that we can support adding the necessary
bits for oem and group commands. We shouldn't be using this anywhere
else, which is why it is not gener

message: Support prepending payloads

Needed solely so that we can support adding the necessary
bits for oem and group commands. We shouldn't be using this anywhere
else, which is why it is not generalized to non-payload types.

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

show more ...

e15e53eb24-Apr-2019 William A. Kennington III <wak@google.com>

message/pack: Allow packing payloads

Some IPMI handlers need the ability to support variable return types.
The easiest way to do that is to be able to return payloads and pack
them into the final pa

message/pack: Allow packing payloads

Some IPMI handlers need the ability to support variable return types.
The easiest way to do that is to be able to return payloads and pack
them into the final payload.

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

show more ...

e2aec26c24-Apr-2019 William A. Kennington III <wak@google.com>

message/pack: Support packing string_views

Now we don't need to make an intermediate copy of our data into an array
before packing it into a payload.

Change-Id: Iac79a79e0ae95835cb67d617a966a92ce8d

message/pack: Support packing string_views

Now we don't need to make an intermediate copy of our data into an array
before packing it into a payload.

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

show more ...

906e0f8024-Apr-2019 William A. Kennington III <wak@google.com>

message/pack: Check for outstanding bits

Currently, if you pack a non-byte aligned member into a message and then
pack an array, it will do the wrong thing and treat the unaligned data
as being appe

message/pack: Check for outstanding bits

Currently, if you pack a non-byte aligned member into a message and then
pack an array, it will do the wrong thing and treat the unaligned data
as being appended to the end of the message. Allowing for this behavior
is convoluted and probably not useful, so just return an error.

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

show more ...

f2fd17a424-Apr-2019 William A. Kennington III <wak@google.com>

message/payload: Ignore unchecked unpack warning during unwind

If we are caught in an exception unwind we don't care that the
payload is not be fully checked. Otherwise, this encourages the pattern

message/payload: Ignore unchecked unpack warning during unwind

If we are caught in an exception unwind we don't care that the
payload is not be fully checked. Otherwise, this encourages the pattern
of wrapping all handler code in try catch blocks that set trailingOk as
it is not required to read the entire payload when throwing an
exception.

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

show more ...

51694c2224-Apr-2019 William A. Kennington III <wak@google.com>

message/payload: Clean up check / trailing state

We want to be able to trivially re-use payloads for marshalling data
from a buffer into other formats. This change tries to make the meaning
of trail

message/payload: Clean up check / trailing state

We want to be able to trivially re-use payloads for marshalling data
from a buffer into other formats. This change tries to make the meaning
of trailingOk and unpackCheck consistent, since the meanings didn't seem
clear in the previous code. Now, unpackCheck is only used to determine
if unpacking was checked, and trailingOk determines if unpackCheck is
required.

This also fixes lots of spurious warnings being printed for commands
which were checking their output correctly, or were legacy and unable to
check output.

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

show more ...

d6a2da0709-Apr-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

add rqSA ipmb request source address

Platform Event Message Command requires that if the message
comes in over IPMB, the generator ID is the rqSA of the message.
IPMB bridge is now responsible for p

add rqSA ipmb request source address

Platform Event Message Command requires that if the message
comes in over IPMB, the generator ID is the rqSA of the message.
IPMB bridge is now responsible for passing this in via the options
map so it can be passed in the context to the command.

Change-Id: I52b7c9ef23896a4efcceeebf12559bbdf897d1c2
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

00b096d115-Apr-2019 Alexander Amelkin <a.amelkin@yadro.com>

Fix compilation warning regarding std::variant

When building with SDK, the compiler complains about
’variant’ being not a member of ’std’:

.../pack.hpp:249:24: error: ‘variant’ is not a member of ‘

Fix compilation warning regarding std::variant

When building with SDK, the compiler complains about
’variant’ being not a member of ’std’:

.../pack.hpp:249:24: error: ‘variant’ is not a member of ‘std’

This commit adds appropriate #include to fix that.

Change-Id: I99d6b7c17cbe1f49d706821797cf3fa03ca8c26a
Signed-off-by: Alexander Amelkin <a.amelkin@yadro.com>

show more ...

0d49e47908-Apr-2019 William A. Kennington III <wak@google.com>

message/unpack: Fix undefined behavior

It's UB to shift an integer by the size of that integer. More
specifically, if you disable compiler optimization and try and unpack a
32 bit bitset you will en

message/unpack: Fix undefined behavior

It's UB to shift an integer by the size of that integer. More
specifically, if you disable compiler optimization and try and unpack a
32 bit bitset you will end up with a 0x0 mask. Avoid UB by replacing
shift subtract with a negate shift.

Tested:
Unit tests pass now.

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

show more ...

508c457608-Apr-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

Add a tuple type for packing

At the top level, payload had the ability to pack a tuple, but it did it
by splitting it into its parts and packing those individually. But if
one of those parts was a t

Add a tuple type for packing

At the top level, payload had the ability to pack a tuple, but it did it
by splitting it into its parts and packing those individually. But if
one of those parts was a tuple, it would fail. This moves the tuple
packing code into the packing templates so that it is possible to pack a
nested tuple of tuples.

Tested-by: newly written tuple unit tests pass

Change-Id: Icd80926314072df78b0083a823dcfb46e944e365
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

12345