diff options
Diffstat (limited to 'include/linux/ipmi.h')
-rw-r--r-- | include/linux/ipmi.h | 48 |
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 | */ |
359 | int ipmi_register_for_cmd(ipmi_user_t user, | 367 | int 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); | ||
362 | int ipmi_unregister_for_cmd(ipmi_user_t user, | 371 | int 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 | */ | ||
591 | struct 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 |