Re: [PATCH 3/5] ipmi:ipmb: Add initial support for IPMI over IPMB

From: Randy Dunlap
Date: Mon Oct 04 2021 - 21:27:40 EST


Hi,

On 10/4/21 5:40 PM, minyard@xxxxxxx wrote:
From: Corey Minyard <cminyard@xxxxxxxxxx>

This provides access to the management controllers on an IPMB bus to a
device sitting on the IPMB bus. It also provides slave capability to
respond to received messages on the bus.

Signed-off-by: Corey Minyard <minyard@xxxxxxx>
Tested-by: Andrew Manley <andrew.manley@xxxxxxxxxxxxxxx>
Reviewed-by: Andrew Manley <andrew.manley@xxxxxxxxxxxxxxx>
---
drivers/char/ipmi/Kconfig | 9 +
drivers/char/ipmi/Makefile | 1 +
drivers/char/ipmi/ipmi_ipmb.c | 510 ++++++++++++++++++++++++++++++++++
3 files changed, 520 insertions(+)
create mode 100644 drivers/char/ipmi/ipmi_ipmb.c

diff --git a/drivers/char/ipmi/Kconfig b/drivers/char/ipmi/Kconfig
index 249b31197eea..1c92209f023b 100644
--- a/drivers/char/ipmi/Kconfig
+++ b/drivers/char/ipmi/Kconfig
@@ -75,6 +75,15 @@ config IPMI_SSIF
have a driver that must be accessed over an I2C bus instead of a
standard interface. This module requires I2C support.
+config IPMI_IPMB
+ tristate 'IPMI IPMB interface'
+ select I2C

How can this select I2C unconditionally? At this point we don't
even know if this platform has/supports I2C.

Ditto for IPMI_SSIF in the current Kconfig file, while
IPMB_DEVICE_INTERFACE depends on I2C (as it should IMO).



+ help
+ Provides a driver for a system running right on the IPMB bus.
+ It supports normal system interface messages to a BMC on the IPMB
+ bus, and it also supports direct messaging on the bus using
+ IPMB direct messages. This module requires I2C support.

<form-letter-bot>

Please follow coding-style for Kconfig files:

(from Documentation/process/coding-style.rst, section 10):

For all of the Kconfig* configuration files throughout the source tree,
the indentation is somewhat different. Lines under a ``config`` definition
are indented with one tab, while help text is indented an additional two
spaces.

+
config IPMI_POWERNV
depends on PPC_POWERNV
tristate 'POWERNV (OPAL firmware) IPMI interface'


diff --git a/drivers/char/ipmi/ipmi_ipmb.c b/drivers/char/ipmi/ipmi_ipmb.c
new file mode 100644
index 000000000000..b10a1fd9c563
--- /dev/null
+++ b/drivers/char/ipmi/ipmi_ipmb.c
@@ -0,0 +1,510 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/*
+ * Driver to talk to a remote management controller on IPMB.
+ */
+

[...]

+
+static int ipmi_ipmb_start_processing(void *send_info,

Odd spacing/formatting above.

+ struct ipmi_smi *new_intf)
+{
+ struct ipmi_ipmb_dev *iidev = send_info;
+
+ iidev->intf = new_intf;
+ iidev->ready = true;
+ return 0;
+}
+
+
+static void ipmi_ipmb_sender(void *send_info,

Ditto.

+ struct ipmi_smi_msg *msg)
+{


--
~Randy