aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/ipmi/ipmi_poweroff.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c
index 1583329ac2ec..170590153df6 100644
--- a/drivers/char/ipmi/ipmi_poweroff.c
+++ b/drivers/char/ipmi/ipmi_poweroff.c
@@ -62,6 +62,7 @@ MODULE_PARM_DESC(poweroff_control, " Set to 2 to enable power cycle instead of p
62static unsigned int mfg_id; 62static unsigned int mfg_id;
63static unsigned int prod_id; 63static unsigned int prod_id;
64static unsigned char capabilities; 64static unsigned char capabilities;
65static unsigned char ipmi_version;
65 66
66/* We use our own messages for this operation, we don't let the system 67/* We use our own messages for this operation, we don't let the system
67 allocate them, since we may be in a panic situation. The whole 68 allocate them, since we may be in a panic situation. The whole
@@ -337,6 +338,25 @@ static void ipmi_poweroff_cpi1 (ipmi_user_t user)
337} 338}
338 339
339/* 340/*
341 * ipmi_dell_chassis_detect()
342 * Dell systems with IPMI < 1.5 don't set the chassis capability bit
343 * but they can handle a chassis poweroff or powercycle command.
344 */
345
346#define DELL_IANA_MFR_ID {0xA2, 0x02, 0x00}
347static int ipmi_dell_chassis_detect (ipmi_user_t user)
348{
349 const char ipmi_version_major = ipmi_version & 0xF;
350 const char ipmi_version_minor = (ipmi_version >> 4) & 0xF;
351 const char mfr[3]=DELL_IANA_MFR_ID;
352 if (!memcmp(mfr, &mfg_id, sizeof(mfr)) &&
353 ipmi_version_major <= 1 &&
354 ipmi_version_minor < 5)
355 return 1;
356 return 0;
357}
358
359/*
340 * Standard chassis support 360 * Standard chassis support
341 */ 361 */
342 362
@@ -413,6 +433,9 @@ static struct poweroff_function poweroff_functions[] = {
413 { .platform_type = "CPI1", 433 { .platform_type = "CPI1",
414 .detect = ipmi_cpi1_detect, 434 .detect = ipmi_cpi1_detect,
415 .poweroff_func = ipmi_poweroff_cpi1 }, 435 .poweroff_func = ipmi_poweroff_cpi1 },
436 { .platform_type = "chassis",
437 .detect = ipmi_dell_chassis_detect,
438 .poweroff_func = ipmi_poweroff_chassis },
416 /* Chassis should generally be last, other things should override 439 /* Chassis should generally be last, other things should override
417 it. */ 440 it. */
418 { .platform_type = "chassis", 441 { .platform_type = "chassis",
@@ -498,6 +521,7 @@ static void ipmi_po_new_smi(int if_num)
498 prod_id = (halt_recv_msg.msg.data[10] 521 prod_id = (halt_recv_msg.msg.data[10]
499 | (halt_recv_msg.msg.data[11] << 8)); 522 | (halt_recv_msg.msg.data[11] << 8));
500 capabilities = halt_recv_msg.msg.data[6]; 523 capabilities = halt_recv_msg.msg.data[6];
524 ipmi_version = halt_recv_msg.msg.data[5];
501 525
502 526
503 /* Scan for a poweroff method */ 527 /* Scan for a poweroff method */