[Panicsel-developers] RE: How about remove useless functions from BMCPANIC.patch?
Brought to you by:
arcress
|
From: Guo, M. <mi...@in...> - 2003-01-29 08:50:41
|
Hi,Andy
I found OpenIPMI has realized some functions such as insert OS
critical message to SEL, so how about add
our features(Get and Set LED when panic happened) to the IPMI?
Thanks
Guo Min
----------------------------------------------------------------------------
----------------------------------------------------------------------------
--------------------
--- linux-2.5.58/drivers/char/ipmi/ipmi_msghandler.c Wed Jan 15 17:43:16
2003
+++ linux-2.5.58-panicsel/drivers/char/ipmi/ipmi_msghandler.c Wed Jan 29
01:39:21 2003
@@ -1857,6 +1857,94 @@
intf->my_lun);
}
}
+
+static unsigned char getAlarmLED(void)
+{
+ struct ipmi_msg msg;
+ unsigned char data[8];
+ unsigned char alarm;
+ struct ipmi_system_interface_addr addr;
+ struct ipmi_smi_msg smi_msg;
+ struct ipmi_recv_msg recv_msg;
+ int rv;
+
+
+ /* Fill in an event telling that we have failed. */
+
+ addr.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
+ addr.channel = IPMI_BMC_CHANNEL;
+ addr.lun = 0;
+
+ msg.netfn = 0x06; /* Net function application. */
+ msg.cmd = 0x52; /* write and read. */
+ msg.data = data;
+ msg.data_len = 3;
+
+ data[0] = 0x03; /* private bus ID */
+ data[1] = 0x41; /* Alarm panel read. */
+ data[2] = 0x01; /* read count */
+ data[3] = 0x00; /* default set to 0 */
+
+
+
+ alarm = 0;
+
+
+ rv = ipmi_request_supply_msgs(NULL,
+ (struct ipmi_addr *) &addr,
+ 0,
+ &msg,
+ &smi_msg,
+ &recv_msg,
+ 1);
+
+ if (rv) {
+ printk(KERN_WARNING "IPMI GetAlarmLED: %d\n", rv);
+ alarm=0;
+ return alarm;
+ }else{
+ alarm=recv_msg.msg.data[3];
+ return alarm;
+ }
+} /*end getAlarmLED*/
+
+static void setAlarmLED(unsigned char alarm)
+{
+ struct ipmi_msg msg;
+ unsigned char data[8];
+ struct ipmi_system_interface_addr addr;
+ struct ipmi_smi_msg smi_msg;
+ struct ipmi_recv_msg recv_msg;
+ int rv;
+
+
+ /* Fill in an event telling that we have failed. */
+
+ addr.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
+ addr.channel = IPMI_BMC_CHANNEL;
+ addr.lun = 0;
+
+ msg.netfn = 0x06; /* Net function application. */
+ msg.cmd = 0x52; /* write and read. */
+ msg.data = data;
+ msg.data_len = 3;
+
+ data[0] = 0x03; /* private bus ID */
+ data[1] = 0x40; /* Alarm panel read. */
+ data[2] = 0; /* read count */
+ data[3] = ((alarm & 0x0D) | 0xF0); /* set critical LED on */
+
+
+ rv = ipmi_request_supply_msgs(NULL,
+ (struct ipmi_addr *) &addr,
+ 0,
+ &msg,
+ &smi_msg,
+ &recv_msg,
+ 1);
+} /*end setAlarmLED*/
+
+
#endif /* CONFIG_IPMI_PANIC_EVENT */
static int has_paniced = 0;
@@ -1867,6 +1955,7 @@
{
int i;
ipmi_smi_t intf;
+ unsigned char alarm;
if (has_paniced)
return NOTIFY_DONE;
@@ -1883,8 +1972,10 @@
#ifdef CONFIG_IPMI_PANIC_EVENT
send_panic_events();
+ alarm = getAlarmLED();
+ if (alarm != 0)
+ setAlarmLED(alarm);
#endif
-
return NOTIFY_DONE;
}
----------------------------------------------------------------------------
-------------------------------
> -----Original Message-----
> From: Cress, Andrew R
> Sent: Tuesday, January 28, 2003 9:55 PM
> To: Guo, Min
> Cc: pan...@li...
> Subject: RE: How about remove useless functions from BMCPANIC.patch?
>
>
>
> Guo Min,
>
> Yes it is a function that is no longer used, and it should be removed in
> the patch for 2.5. I'm working on a new patch for 2.5.58, and it will be
> significantly different, because it will be based on the OpenIPMI driver.
>
>
> Andy
>
> -----Original Message-----
> From: Guo, Min
> Sent: Monday, January 27, 2003 7:39 PM
> To: Cress, Andrew R
> Cc: pan...@li...
> Subject: How about remove useless functions from
> BMCPANIC.patch?
>
>
> Hi, Andrew,
>
> After I read the bmcpanic.patch, I found there are
> some functions and comments can be deleted,
> such as ReadSEL, so how about remove the code from the
> patch?
>
> If you agree, I would like to supply a clean patch
> for 2.5.58.
>
> Thanks
> Guo Min
>
|