aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCorey Minyard <minyard@acm.org>2006-10-01 02:27:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:23 -0400
commitc69c31270c35a6b8421a8e4ba81de1247ac6df95 (patch)
tree5f46902faa683f32a69adbe53c8ec3ca4ed19466 /include
parent54f67f631dfc25ca7a8b19200e34013abc974337 (diff)
[PATCH] IPMI: per-channel command registration
This patch adds the ability to register for a command per-channel in the IPMI driver. If your BMC supports multiple channels, incoming messages can be useful to have the ability to register to receive commands on a specific channel instead the current behaviour of all channels. Signed-off-by: David Barksdale <amatus@ocgnet.org> 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')
-rw-r--r--include/linux/ipmi.h48
1 files changed, 44 insertions, 4 deletions
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index d09fbeabf1dc..796ca009fd46 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -148,6 +148,13 @@ struct ipmi_lan_addr
148#define IPMI_BMC_CHANNEL 0xf 148#define IPMI_BMC_CHANNEL 0xf
149#define IPMI_NUM_CHANNELS 0x10 149#define IPMI_NUM_CHANNELS 0x10
150 150
151/*
152 * Used to signify an "all channel" bitmask. This is more than the
153 * actual number of channels because this is used in userland and
154 * will cover us if the number of channels is extended.
155 */
156#define IPMI_CHAN_ALL (~0)
157
151 158
152/* 159/*
153 * A raw IPMI message without any addressing. This covers both 160 * A raw IPMI message without any addressing. This covers both
@@ -350,18 +357,21 @@ int ipmi_request_supply_msgs(ipmi_user_t user,
350 357
351/* 358/*
352 * When commands come in to the SMS, the user can register to receive 359 * When commands come in to the SMS, the user can register to receive
353 * them. Only one user can be listening on a specific netfn/cmd pair 360 * them. Only one user can be listening on a specific netfn/cmd/chan tuple
354 * at a time, you will get an EBUSY error if the command is already 361 * at a time, you will get an EBUSY error if the command is already
355 * registered. If a command is received that does not have a user 362 * registered. If a command is received that does not have a user
356 * registered, the driver will automatically return the proper 363 * registered, the driver will automatically return the proper
357 * error. 364 * error. Channels are specified as a bitfield, use IPMI_CHAN_ALL to
365 * mean all channels.
358 */ 366 */
359int ipmi_register_for_cmd(ipmi_user_t user, 367int ipmi_register_for_cmd(ipmi_user_t user,
360 unsigned char netfn, 368 unsigned char netfn,
361 unsigned char cmd); 369 unsigned char cmd,
370 unsigned int chans);
362int ipmi_unregister_for_cmd(ipmi_user_t user, 371int ipmi_unregister_for_cmd(ipmi_user_t user,
363 unsigned char netfn, 372 unsigned char netfn,
364 unsigned char cmd); 373 unsigned char cmd,
374 unsigned int chans);
365 375
366/* 376/*
367 * Allow run-to-completion mode to be set for the interface of 377 * Allow run-to-completion mode to be set for the interface of
@@ -571,6 +581,36 @@ struct ipmi_cmdspec
571#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \ 581#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \
572 struct ipmi_cmdspec) 582 struct ipmi_cmdspec)
573 583
584/*
585 * Register to get commands from other entities on specific channels.
586 * This way, you can only listen on specific channels, or have messages
587 * from some channels go to one place and other channels to someplace
588 * else. The chans field is a bitmask, (1 << channel) for each channel.
589 * It may be IPMI_CHAN_ALL for all channels.
590 */
591struct ipmi_cmdspec_chans
592{
593 unsigned int netfn;
594 unsigned int cmd;
595 unsigned int chans;
596};
597
598/*
599 * Register to receive a specific command on specific channels. error values:
600 * - EFAULT - an address supplied was invalid.
601 * - EBUSY - One of the netfn/cmd/chans supplied was already in use.
602 * - ENOMEM - could not allocate memory for the entry.
603 */
604#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \
605 struct ipmi_cmdspec_chans)
606/*
607 * Unregister some netfn/cmd/chans. error values:
608 * - EFAULT - an address supplied was invalid.
609 * - ENOENT - None of the netfn/cmd/chans were found registered for this user.
610 */
611#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \
612 struct ipmi_cmdspec_chans)
613
574/* 614/*
575 * Set whether this interface receives events. Note that the first 615 * Set whether this interface receives events. Note that the first
576 * user registered for events will get all pending events for the 616 * user registered for events will get all pending events for the