diff options
Diffstat (limited to 'include/linux/ipmi.h')
| -rw-r--r-- | include/linux/ipmi.h | 85 |
1 files changed, 33 insertions, 52 deletions
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index c5bd28b69aec..7ebdb4fb4e54 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
| @@ -64,7 +64,7 @@ | |||
| 64 | * applications and another for userland applications. The | 64 | * applications and another for userland applications. The |
| 65 | * capabilities are basically the same for both interface, although | 65 | * capabilities are basically the same for both interface, although |
| 66 | * the interfaces are somewhat different. The stuff in the | 66 | * the interfaces are somewhat different. The stuff in the |
| 67 | * #ifdef KERNEL below is the in-kernel interface. The userland | 67 | * #ifdef __KERNEL__ below is the in-kernel interface. The userland |
| 68 | * interface is defined later in the file. */ | 68 | * interface is defined later in the file. */ |
| 69 | 69 | ||
| 70 | 70 | ||
| @@ -75,8 +75,7 @@ | |||
| 75 | * work for sockets. | 75 | * work for sockets. |
| 76 | */ | 76 | */ |
| 77 | #define IPMI_MAX_ADDR_SIZE 32 | 77 | #define IPMI_MAX_ADDR_SIZE 32 |
| 78 | struct ipmi_addr | 78 | struct ipmi_addr { |
| 79 | { | ||
| 80 | /* Try to take these from the "Channel Medium Type" table | 79 | /* Try to take these from the "Channel Medium Type" table |
| 81 | in section 6.5 of the IPMI 1.5 manual. */ | 80 | in section 6.5 of the IPMI 1.5 manual. */ |
| 82 | int addr_type; | 81 | int addr_type; |
| @@ -90,8 +89,7 @@ struct ipmi_addr | |||
| 90 | * 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC. | 89 | * 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC. |
| 91 | */ | 90 | */ |
| 92 | #define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c | 91 | #define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c |
| 93 | struct ipmi_system_interface_addr | 92 | struct ipmi_system_interface_addr { |
| 94 | { | ||
| 95 | int addr_type; | 93 | int addr_type; |
| 96 | short channel; | 94 | short channel; |
| 97 | unsigned char lun; | 95 | unsigned char lun; |
| @@ -100,10 +98,9 @@ struct ipmi_system_interface_addr | |||
| 100 | /* An IPMB Address. */ | 98 | /* An IPMB Address. */ |
| 101 | #define IPMI_IPMB_ADDR_TYPE 0x01 | 99 | #define IPMI_IPMB_ADDR_TYPE 0x01 |
| 102 | /* Used for broadcast get device id as described in section 17.9 of the | 100 | /* Used for broadcast get device id as described in section 17.9 of the |
| 103 | IPMI 1.5 manual. */ | 101 | IPMI 1.5 manual. */ |
| 104 | #define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41 | 102 | #define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41 |
| 105 | struct ipmi_ipmb_addr | 103 | struct ipmi_ipmb_addr { |
| 106 | { | ||
| 107 | int addr_type; | 104 | int addr_type; |
| 108 | short channel; | 105 | short channel; |
| 109 | unsigned char slave_addr; | 106 | unsigned char slave_addr; |
| @@ -128,8 +125,7 @@ struct ipmi_ipmb_addr | |||
| 128 | * message is a little weird, but this is required. | 125 | * message is a little weird, but this is required. |
| 129 | */ | 126 | */ |
| 130 | #define IPMI_LAN_ADDR_TYPE 0x04 | 127 | #define IPMI_LAN_ADDR_TYPE 0x04 |
| 131 | struct ipmi_lan_addr | 128 | struct ipmi_lan_addr { |
| 132 | { | ||
| 133 | int addr_type; | 129 | int addr_type; |
| 134 | short channel; | 130 | short channel; |
| 135 | unsigned char privilege; | 131 | unsigned char privilege; |
| @@ -162,16 +158,14 @@ struct ipmi_lan_addr | |||
| 162 | * byte of data in the response (as the spec shows the messages laid | 158 | * byte of data in the response (as the spec shows the messages laid |
| 163 | * out). | 159 | * out). |
| 164 | */ | 160 | */ |
| 165 | struct ipmi_msg | 161 | struct ipmi_msg { |
| 166 | { | ||
| 167 | unsigned char netfn; | 162 | unsigned char netfn; |
| 168 | unsigned char cmd; | 163 | unsigned char cmd; |
| 169 | unsigned short data_len; | 164 | unsigned short data_len; |
| 170 | unsigned char __user *data; | 165 | unsigned char __user *data; |
| 171 | }; | 166 | }; |
| 172 | 167 | ||
| 173 | struct kernel_ipmi_msg | 168 | struct kernel_ipmi_msg { |
| 174 | { | ||
| 175 | unsigned char netfn; | 169 | unsigned char netfn; |
| 176 | unsigned char cmd; | 170 | unsigned char cmd; |
| 177 | unsigned short data_len; | 171 | unsigned short data_len; |
| @@ -239,12 +233,11 @@ typedef struct ipmi_user *ipmi_user_t; | |||
| 239 | * used after the message is delivered, so the upper layer may use the | 233 | * used after the message is delivered, so the upper layer may use the |
| 240 | * link to build a linked list, if it likes. | 234 | * link to build a linked list, if it likes. |
| 241 | */ | 235 | */ |
| 242 | struct ipmi_recv_msg | 236 | struct ipmi_recv_msg { |
| 243 | { | ||
| 244 | struct list_head link; | 237 | struct list_head link; |
| 245 | 238 | ||
| 246 | /* The type of message as defined in the "Receive Types" | 239 | /* The type of message as defined in the "Receive Types" |
| 247 | defines above. */ | 240 | defines above. */ |
| 248 | int recv_type; | 241 | int recv_type; |
| 249 | 242 | ||
| 250 | ipmi_user_t user; | 243 | ipmi_user_t user; |
| @@ -271,9 +264,8 @@ struct ipmi_recv_msg | |||
| 271 | /* Allocate and free the receive message. */ | 264 | /* Allocate and free the receive message. */ |
| 272 | void ipmi_free_recv_msg(struct ipmi_recv_msg *msg); | 265 | void ipmi_free_recv_msg(struct ipmi_recv_msg *msg); |
| 273 | 266 | ||
| 274 | struct ipmi_user_hndl | 267 | struct ipmi_user_hndl { |
| 275 | { | 268 | /* Routine type to call when a message needs to be routed to |
| 276 | /* Routine type to call when a message needs to be routed to | ||
| 277 | the upper layer. This will be called with some locks held, | 269 | the upper layer. This will be called with some locks held, |
| 278 | the only IPMI routines that can be called are ipmi_request | 270 | the only IPMI routines that can be called are ipmi_request |
| 279 | and the alloc/free operations. The handler_data is the | 271 | and the alloc/free operations. The handler_data is the |
| @@ -368,9 +360,8 @@ int ipmi_request_supply_msgs(ipmi_user_t user, | |||
| 368 | * Poll the IPMI interface for the user. This causes the IPMI code to | 360 | * Poll the IPMI interface for the user. This causes the IPMI code to |
| 369 | * do an immediate check for information from the driver and handle | 361 | * do an immediate check for information from the driver and handle |
| 370 | * anything that is immediately pending. This will not block in any | 362 | * anything that is immediately pending. This will not block in any |
| 371 | * way. This is useful if you need to implement polling from the user | 363 | * way. This is useful if you need to spin waiting for something to |
| 372 | * for things like modifying the watchdog timeout when a panic occurs | 364 | * happen in the IPMI driver. |
| 373 | * or disabling the watchdog timer on a reboot. | ||
| 374 | */ | 365 | */ |
| 375 | void ipmi_poll_interface(ipmi_user_t user); | 366 | void ipmi_poll_interface(ipmi_user_t user); |
| 376 | 367 | ||
| @@ -422,12 +413,6 @@ int ipmi_get_maintenance_mode(ipmi_user_t user); | |||
| 422 | int ipmi_set_maintenance_mode(ipmi_user_t user, int mode); | 413 | int ipmi_set_maintenance_mode(ipmi_user_t user, int mode); |
| 423 | 414 | ||
| 424 | /* | 415 | /* |
| 425 | * Allow run-to-completion mode to be set for the interface of | ||
| 426 | * a specific user. | ||
| 427 | */ | ||
| 428 | void ipmi_user_set_run_to_completion(ipmi_user_t user, int val); | ||
| 429 | |||
| 430 | /* | ||
| 431 | * When the user is created, it will not receive IPMI events by | 416 | * When the user is created, it will not receive IPMI events by |
| 432 | * default. The user must set this to TRUE to get incoming events. | 417 | * default. The user must set this to TRUE to get incoming events. |
| 433 | * The first user that sets this to TRUE will receive all events that | 418 | * The first user that sets this to TRUE will receive all events that |
| @@ -440,8 +425,7 @@ int ipmi_set_gets_events(ipmi_user_t user, int val); | |||
| 440 | * every existing interface when a new watcher is registered with | 425 | * every existing interface when a new watcher is registered with |
| 441 | * ipmi_smi_watcher_register(). | 426 | * ipmi_smi_watcher_register(). |
| 442 | */ | 427 | */ |
| 443 | struct ipmi_smi_watcher | 428 | struct ipmi_smi_watcher { |
| 444 | { | ||
| 445 | struct list_head link; | 429 | struct list_head link; |
| 446 | 430 | ||
| 447 | /* You must set the owner to the current module, if you are in | 431 | /* You must set the owner to the current module, if you are in |
| @@ -512,8 +496,7 @@ int ipmi_validate_addr(struct ipmi_addr *addr, int len); | |||
| 512 | 496 | ||
| 513 | 497 | ||
| 514 | /* Messages sent to the interface are this format. */ | 498 | /* Messages sent to the interface are this format. */ |
| 515 | struct ipmi_req | 499 | struct ipmi_req { |
| 516 | { | ||
| 517 | unsigned char __user *addr; /* Address to send the message to. */ | 500 | unsigned char __user *addr; /* Address to send the message to. */ |
| 518 | unsigned int addr_len; | 501 | unsigned int addr_len; |
| 519 | 502 | ||
| @@ -538,12 +521,11 @@ struct ipmi_req | |||
| 538 | 521 | ||
| 539 | /* Messages sent to the interface with timing parameters are this | 522 | /* Messages sent to the interface with timing parameters are this |
| 540 | format. */ | 523 | format. */ |
| 541 | struct ipmi_req_settime | 524 | struct ipmi_req_settime { |
| 542 | { | ||
| 543 | struct ipmi_req req; | 525 | struct ipmi_req req; |
| 544 | 526 | ||
| 545 | /* See ipmi_request_settime() above for details on these | 527 | /* See ipmi_request_settime() above for details on these |
| 546 | values. */ | 528 | values. */ |
| 547 | int retries; | 529 | int retries; |
| 548 | unsigned int retry_time_ms; | 530 | unsigned int retry_time_ms; |
| 549 | }; | 531 | }; |
| @@ -560,8 +542,7 @@ struct ipmi_req_settime | |||
| 560 | struct ipmi_req_settime) | 542 | struct ipmi_req_settime) |
| 561 | 543 | ||
| 562 | /* Messages received from the interface are this format. */ | 544 | /* Messages received from the interface are this format. */ |
| 563 | struct ipmi_recv | 545 | struct ipmi_recv { |
| 564 | { | ||
| 565 | int recv_type; /* Is this a command, response or an | 546 | int recv_type; /* Is this a command, response or an |
| 566 | asyncronous event. */ | 547 | asyncronous event. */ |
| 567 | 548 | ||
| @@ -607,13 +588,12 @@ struct ipmi_recv | |||
| 607 | struct ipmi_recv) | 588 | struct ipmi_recv) |
| 608 | 589 | ||
| 609 | /* Register to get commands from other entities on this interface. */ | 590 | /* Register to get commands from other entities on this interface. */ |
| 610 | struct ipmi_cmdspec | 591 | struct ipmi_cmdspec { |
| 611 | { | ||
| 612 | unsigned char netfn; | 592 | unsigned char netfn; |
| 613 | unsigned char cmd; | 593 | unsigned char cmd; |
| 614 | }; | 594 | }; |
| 615 | 595 | ||
| 616 | /* | 596 | /* |
| 617 | * Register to receive a specific command. error values: | 597 | * Register to receive a specific command. error values: |
| 618 | * - EFAULT - an address supplied was invalid. | 598 | * - EFAULT - an address supplied was invalid. |
| 619 | * - EBUSY - The netfn/cmd supplied was already in use. | 599 | * - EBUSY - The netfn/cmd supplied was already in use. |
| @@ -636,8 +616,7 @@ struct ipmi_cmdspec | |||
| 636 | * else. The chans field is a bitmask, (1 << channel) for each channel. | 616 | * else. The chans field is a bitmask, (1 << channel) for each channel. |
| 637 | * It may be IPMI_CHAN_ALL for all channels. | 617 | * It may be IPMI_CHAN_ALL for all channels. |
| 638 | */ | 618 | */ |
| 639 | struct ipmi_cmdspec_chans | 619 | struct ipmi_cmdspec_chans { |
| 640 | { | ||
| 641 | unsigned int netfn; | 620 | unsigned int netfn; |
| 642 | unsigned int cmd; | 621 | unsigned int cmd; |
| 643 | unsigned int chans; | 622 | unsigned int chans; |
| @@ -659,7 +638,7 @@ struct ipmi_cmdspec_chans | |||
| 659 | #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \ | 638 | #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \ |
| 660 | struct ipmi_cmdspec_chans) | 639 | struct ipmi_cmdspec_chans) |
| 661 | 640 | ||
| 662 | /* | 641 | /* |
| 663 | * Set whether this interface receives events. Note that the first | 642 | * Set whether this interface receives events. Note that the first |
| 664 | * user registered for events will get all pending events for the | 643 | * user registered for events will get all pending events for the |
| 665 | * interface. error values: | 644 | * interface. error values: |
| @@ -675,15 +654,18 @@ struct ipmi_cmdspec_chans | |||
| 675 | * things it takes to determine your address (if not the BMC) and set | 654 | * things it takes to determine your address (if not the BMC) and set |
| 676 | * it for everyone else. You should probably leave the LUN alone. | 655 | * it for everyone else. You should probably leave the LUN alone. |
| 677 | */ | 656 | */ |
| 678 | struct ipmi_channel_lun_address_set | 657 | struct ipmi_channel_lun_address_set { |
| 679 | { | ||
| 680 | unsigned short channel; | 658 | unsigned short channel; |
| 681 | unsigned char value; | 659 | unsigned char value; |
| 682 | }; | 660 | }; |
| 683 | #define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set) | 661 | #define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD \ |
| 684 | #define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set) | 662 | _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set) |
| 685 | #define IPMICTL_SET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set) | 663 | #define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD \ |
| 686 | #define IPMICTL_GET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set) | 664 | _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set) |
| 665 | #define IPMICTL_SET_MY_CHANNEL_LUN_CMD \ | ||
| 666 | _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set) | ||
| 667 | #define IPMICTL_GET_MY_CHANNEL_LUN_CMD \ | ||
| 668 | _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set) | ||
| 687 | /* Legacy interfaces, these only set IPMB 0. */ | 669 | /* Legacy interfaces, these only set IPMB 0. */ |
| 688 | #define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int) | 670 | #define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int) |
| 689 | #define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int) | 671 | #define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int) |
| @@ -694,8 +676,7 @@ struct ipmi_channel_lun_address_set | |||
| 694 | * Get/set the default timing values for an interface. You shouldn't | 676 | * Get/set the default timing values for an interface. You shouldn't |
| 695 | * generally mess with these. | 677 | * generally mess with these. |
| 696 | */ | 678 | */ |
| 697 | struct ipmi_timing_parms | 679 | struct ipmi_timing_parms { |
| 698 | { | ||
| 699 | int retries; | 680 | int retries; |
| 700 | unsigned int retry_time_ms; | 681 | unsigned int retry_time_ms; |
| 701 | }; | 682 | }; |
