Add capability to set PECI device file name

This adds capability to set the name of the PECI device file.
If the PECI device name is null, use "/dev/peci-default".
If that does not exist fall back to "/dev/peci-0"

PECI_DEV environment variable can be used to override default
PECI device name, for example: export PECI_DEV=/dev/peci-wire

Added -d <dev name> command line option to peci_cmds, that
can be used to specify PECI device name, for example:
peci_cmds -d /dev/peci-0 gettemp

Added peci_SetDevName(char* dev_name) to libpeci API.

Tested manually:
1) using peci_cmds -d <dev_name> gettemp
2) calling peci_SetDevName(<dev_name>) from client application

Change-Id: I236857ec3ac42b8ff227aa32899ca8f1f3577d2b
Signed-off-by: Anna Platash <anna.platash@intel.com>
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
3 files changed
tree: b4b891029531d04c8ac10a599a1220529c54001f
  1. linux/
  2. .clang-format
  3. .clang-ignore
  4. CMakeLists.txt
  5. LICENSE
  6. MAINTAINERS
  7. peci.c
  8. peci.h
  9. peci_cmds.c
  10. README.md
README.md

libpeci

libpeci is a library that provides various APIs to interface with the IOCTLs provided by the PECI driver in the OpenBMC kernel. Currently available here:

https://github.com/openbmc/linux/blob/dev-5.4/include/uapi/linux/peci-ioctl.h

peci_cmds

This repo also includes a peci_cmds command-line utility with functions that map to the libpeci APIs. It can be used to test PECI functionality across the library, driver, and hardware.