diff options
author | Corey Minyard <minyard@acm.org> | 2006-12-06 23:41:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:47 -0500 |
commit | b9675136e2ad95156fb93be6155f17590bb26fd7 (patch) | |
tree | 009bff8e0074774317b7f3921ed85122cf15bba9 /include/linux/ipmi.h | |
parent | b2c03941b50944a268ee4d5823872f220809a3ba (diff) |
[PATCH] IPMI: Add maintenance mode
Some commands and operations on a BMC can cause the BMC to "go away" for a
while. This can cause the automatic flag processing and other things of that
nature to timeout and generate annoying logs, or possibly cause other bad
things to happen when in firmware update mode.
Add detection of those commands (cold reset, warm reset, and any firmware
command) and turns off automatic processing for 30 seconds. It also add a
manual override either way.
Signed-off-by: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/ipmi.h')
-rw-r--r-- | include/linux/ipmi.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 796ca009fd4..7a9db390c56 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -208,6 +208,15 @@ struct kernel_ipmi_msg | |||
208 | code as the first byte of the incoming data, unlike a response. */ | 208 | code as the first byte of the incoming data, unlike a response. */ |
209 | 209 | ||
210 | 210 | ||
211 | /* | ||
212 | * Modes for ipmi_set_maint_mode() and the userland IOCTL. The AUTO | ||
213 | * setting is the default and means it will be set on certain | ||
214 | * commands. Hard setting it on and off will override automatic | ||
215 | * operation. | ||
216 | */ | ||
217 | #define IPMI_MAINTENANCE_MODE_AUTO 0 | ||
218 | #define IPMI_MAINTENANCE_MODE_OFF 1 | ||
219 | #define IPMI_MAINTENANCE_MODE_ON 2 | ||
211 | 220 | ||
212 | #ifdef __KERNEL__ | 221 | #ifdef __KERNEL__ |
213 | 222 | ||
@@ -374,6 +383,35 @@ int ipmi_unregister_for_cmd(ipmi_user_t user, | |||
374 | unsigned int chans); | 383 | unsigned int chans); |
375 | 384 | ||
376 | /* | 385 | /* |
386 | * Go into a mode where the driver will not autonomously attempt to do | ||
387 | * things with the interface. It will still respond to attentions and | ||
388 | * interrupts, and it will expect that commands will complete. It | ||
389 | * will not automatcially check for flags, events, or things of that | ||
390 | * nature. | ||
391 | * | ||
392 | * This is primarily used for firmware upgrades. The idea is that | ||
393 | * when you go into firmware upgrade mode, you do this operation | ||
394 | * and the driver will not attempt to do anything but what you tell | ||
395 | * it or what the BMC asks for. | ||
396 | * | ||
397 | * Note that if you send a command that resets the BMC, the driver | ||
398 | * will still expect a response from that command. So the BMC should | ||
399 | * reset itself *after* the response is sent. Resetting before the | ||
400 | * response is just silly. | ||
401 | * | ||
402 | * If in auto maintenance mode, the driver will automatically go into | ||
403 | * maintenance mode for 30 seconds if it sees a cold reset, a warm | ||
404 | * reset, or a firmware NetFN. This means that code that uses only | ||
405 | * firmware NetFN commands to do upgrades will work automatically | ||
406 | * without change, assuming it sends a message every 30 seconds or | ||
407 | * less. | ||
408 | * | ||
409 | * See the IPMI_MAINTENANCE_MODE_xxx defines for what the mode means. | ||
410 | */ | ||
411 | int ipmi_get_maintenance_mode(ipmi_user_t user); | ||
412 | int ipmi_set_maintenance_mode(ipmi_user_t user, int mode); | ||
413 | |||
414 | /* | ||
377 | * Allow run-to-completion mode to be set for the interface of | 415 | * Allow run-to-completion mode to be set for the interface of |
378 | * a specific user. | 416 | * a specific user. |
379 | */ | 417 | */ |
@@ -656,4 +694,11 @@ struct ipmi_timing_parms | |||
656 | #define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, \ | 694 | #define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, \ |
657 | struct ipmi_timing_parms) | 695 | struct ipmi_timing_parms) |
658 | 696 | ||
697 | /* | ||
698 | * Set the maintenance mode. See ipmi_set_maintenance_mode() above | ||
699 | * for a description of what this does. | ||
700 | */ | ||
701 | #define IPMICTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int) | ||
702 | #define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int) | ||
703 | |||
659 | #endif /* __LINUX_IPMI_H */ | 704 | #endif /* __LINUX_IPMI_H */ |