Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7459
b: refs/heads/master
c: 168524d
h: refs/heads/master
i:
  7457: 2c9d891
  7455: a553a0e
v: v3
  • Loading branch information
Corey Minyard authored and Linus Torvalds committed Sep 7, 2005
1 parent 0d31d42 commit d17ffc7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 56a55ec64806fb56e0cd43b0f726020b74c6689b
refs/heads/master: 168524d673f99550d75af49eb3f5d2850420eb66
24 changes: 24 additions & 0 deletions trunk/drivers/char/ipmi/ipmi_poweroff.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ MODULE_PARM_DESC(poweroff_control, " Set to 2 to enable power cycle instead of p
static unsigned int mfg_id;
static unsigned int prod_id;
static unsigned char capabilities;
static unsigned char ipmi_version;

/* We use our own messages for this operation, we don't let the system
allocate them, since we may be in a panic situation. The whole
Expand Down Expand Up @@ -336,6 +337,25 @@ static void ipmi_poweroff_cpi1 (ipmi_user_t user)
return;
}

/*
* ipmi_dell_chassis_detect()
* Dell systems with IPMI < 1.5 don't set the chassis capability bit
* but they can handle a chassis poweroff or powercycle command.
*/

#define DELL_IANA_MFR_ID {0xA2, 0x02, 0x00}
static int ipmi_dell_chassis_detect (ipmi_user_t user)
{
const char ipmi_version_major = ipmi_version & 0xF;
const char ipmi_version_minor = (ipmi_version >> 4) & 0xF;
const char mfr[3]=DELL_IANA_MFR_ID;
if (!memcmp(mfr, &mfg_id, sizeof(mfr)) &&
ipmi_version_major <= 1 &&
ipmi_version_minor < 5)
return 1;
return 0;
}

/*
* Standard chassis support
*/
Expand Down Expand Up @@ -413,6 +433,9 @@ static struct poweroff_function poweroff_functions[] = {
{ .platform_type = "CPI1",
.detect = ipmi_cpi1_detect,
.poweroff_func = ipmi_poweroff_cpi1 },
{ .platform_type = "chassis",
.detect = ipmi_dell_chassis_detect,
.poweroff_func = ipmi_poweroff_chassis },
/* Chassis should generally be last, other things should override
it. */
{ .platform_type = "chassis",
Expand Down Expand Up @@ -498,6 +521,7 @@ static void ipmi_po_new_smi(int if_num)
prod_id = (halt_recv_msg.msg.data[10]
| (halt_recv_msg.msg.data[11] << 8));
capabilities = halt_recv_msg.msg.data[6];
ipmi_version = halt_recv_msg.msg.data[5];


/* Scan for a poweroff method */
Expand Down

0 comments on commit d17ffc7

Please sign in to comment.