[PATCH 0/1 v2 ] ipmi: Setting OS name as Linux in BMC

From: Srinivas_G_Gowda
Date: Thu Jun 28 2012 - 12:45:45 EST



>The idea here is fine, but it's probably more appropriate to do this in
>ipmi_msghandler.c, not ipmi_si_intf.c, since the latter only handles
>some interface types.
v2 patch - moving the code to ipmi_msghandler. Called soon after BMC is
registered by the driver.

There is an option in IPMI spec using which BMC can be made aware
of the OS name that it is talking to.
IPMI_Spec-IPMI2_0E4_061209 - ref - 22.14a , .Set System Info.

This patch will update the OS name as "Linux" in BMC during
IPMI Driver initialization. In the current patch declaration of
the OS name is done only for the Volatile param.


Signed-off-by: Srinivas Gowda G <Srinivas_G_Gowda@xxxxxxxx>
---
drivers/char/ipmi/ipmi_msghandler.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 2c29942..d0abb3a 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -55,8 +55,10 @@ static struct ipmi_recv_msg *ipmi_alloc_recv_msg(void);
static int ipmi_init_msghandler(void);
static void smi_recv_tasklet(unsigned long);
static void handle_new_recv_msgs(ipmi_smi_t intf);
+static void set_os_name_bmc(ipmi_smi_t intf);

static int initialized;
+static unsigned char os_name_set;

#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *proc_ipmi_root;
@@ -2568,6 +2570,11 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum,
bmc->id.manufacturer_id,
bmc->id.product_id,
bmc->id.device_id);
+ /*
+ * Set the OS in BMC as "Linux" using
+ * "Set System Info" Command
+ */
+ set_os_name_bmc(intf);
}

/*
@@ -2702,6 +2709,27 @@ get_guid(ipmi_smi_t intf)
intf->null_user_handler = NULL;
}

+/*
+ * Set the Operating System Name as "Linux" in BMC
+ * using "Set System Info" command.
+ * Only setting Volatile variable - Parameter 4
+ */
+static void
+set_os_name_bmc(ipmi_smi_t intf)
+{
+ int rv;
+
+ intf->null_user_handler = set_os_name_handler;
+ rv = send_set_os_name_cmd(intf);
+ if (rv)
+ printk(KERN_WARNING PFX
+ "Send Failed: Set_System_Info - OS name Linux\n");
+
+ os_name_set = 0;
+ wait_event(intf->waitq, os_name_set == 1);
+ intf->null_user_handler = NULL;
+}
+
static int
send_channel_info_cmd(ipmi_smi_t intf, int chan)
{
--
1.7.1


Thanks,
G--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/