1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI__LINUX_IPMI_H
20 #define _UAPI__LINUX_IPMI_H
21 #include <linux/ipmi_msgdefs.h>
22 #include <linux/compiler.h>
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #define IPMI_MAX_ADDR_SIZE 32
25 struct ipmi_addr {
26  int addr_type;
27  short channel;
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29  char data[IPMI_MAX_ADDR_SIZE];
30 };
31 #define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c
32 struct ipmi_system_interface_addr {
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34  int addr_type;
35  short channel;
36  unsigned char lun;
37 };
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 #define IPMI_IPMB_ADDR_TYPE 0x01
40 #define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41
41 struct ipmi_ipmb_addr {
42  int addr_type;
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  short channel;
45  unsigned char slave_addr;
46  unsigned char lun;
47 };
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 #define IPMI_LAN_ADDR_TYPE 0x04
50 struct ipmi_lan_addr {
51  int addr_type;
52  short channel;
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54  unsigned char privilege;
55  unsigned char session_handle;
56  unsigned char remote_SWID;
57  unsigned char local_SWID;
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59  unsigned char lun;
60 };
61 #define IPMI_BMC_CHANNEL 0xf
62 #define IPMI_NUM_CHANNELS 0x10
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 #define IPMI_CHAN_ALL (~0)
65 struct ipmi_msg {
66  unsigned char netfn;
67  unsigned char cmd;
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69  unsigned short data_len;
70  unsigned char __user *data;
71 };
72 struct kernel_ipmi_msg {
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74  unsigned char netfn;
75  unsigned char cmd;
76  unsigned short data_len;
77  unsigned char *data;
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 };
80 #define IPMI_INVALID_CMD_COMPLETION_CODE 0xC1
81 #define IPMI_TIMEOUT_COMPLETION_CODE 0xC3
82 #define IPMI_UNKNOWN_ERR_COMPLETION_CODE 0xff
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 #define IPMI_RESPONSE_RECV_TYPE 1
85 #define IPMI_ASYNC_EVENT_RECV_TYPE 2
86 #define IPMI_CMD_RECV_TYPE 3
87 #define IPMI_RESPONSE_RESPONSE_TYPE 4
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 #define IPMI_OEM_RECV_TYPE 5
90 #define IPMI_MAINTENANCE_MODE_AUTO 0
91 #define IPMI_MAINTENANCE_MODE_OFF 1
92 #define IPMI_MAINTENANCE_MODE_ON 2
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 #define IPMI_IOC_MAGIC 'i'
95 struct ipmi_req {
96  unsigned char __user *addr;
97  unsigned int addr_len;
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99  long msgid;
100  struct ipmi_msg msg;
101 };
102 #define IPMICTL_SEND_COMMAND _IOR(IPMI_IOC_MAGIC, 13,   struct ipmi_req)
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 struct ipmi_req_settime {
105  struct ipmi_req req;
106  int retries;
107  unsigned int retry_time_ms;
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109 };
110 #define IPMICTL_SEND_COMMAND_SETTIME _IOR(IPMI_IOC_MAGIC, 21,   struct ipmi_req_settime)
111 struct ipmi_recv {
112  int recv_type;
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114  unsigned char __user *addr;
115  unsigned int addr_len;
116  long msgid;
117  struct ipmi_msg msg;
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 };
120 #define IPMICTL_RECEIVE_MSG _IOWR(IPMI_IOC_MAGIC, 12,   struct ipmi_recv)
121 #define IPMICTL_RECEIVE_MSG_TRUNC _IOWR(IPMI_IOC_MAGIC, 11,   struct ipmi_recv)
122 struct ipmi_cmdspec {
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124  unsigned char netfn;
125  unsigned char cmd;
126 };
127 #define IPMICTL_REGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 14,   struct ipmi_cmdspec)
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 #define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15,   struct ipmi_cmdspec)
130 struct ipmi_cmdspec_chans {
131  unsigned int netfn;
132  unsigned int cmd;
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134  unsigned int chans;
135 };
136 #define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28,   struct ipmi_cmdspec_chans)
137 #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29,   struct ipmi_cmdspec_chans)
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 #define IPMICTL_SET_GETS_EVENTS_CMD _IOR(IPMI_IOC_MAGIC, 16, int)
140 struct ipmi_channel_lun_address_set {
141  unsigned short channel;
142  unsigned char value;
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144 };
145 #define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD   _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
146 #define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD   _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
147 #define IPMICTL_SET_MY_CHANNEL_LUN_CMD   _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 #define IPMICTL_GET_MY_CHANNEL_LUN_CMD   _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
150 #define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
151 #define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
152 #define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154 #define IPMICTL_GET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
155 struct ipmi_timing_parms {
156  int retries;
157  unsigned int retry_time_ms;
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159 };
160 #define IPMICTL_SET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 22,   struct ipmi_timing_parms)
161 #define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23,   struct ipmi_timing_parms)
162 #define IPMICTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int)
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 #define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int)
165 #endif
166