~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/ipmi.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/uapi/linux/ipmi.h (Version linux-6.12-rc7) and /include/uapi/linux/ipmi.h (Version linux-5.13.19)


  1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linu      1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2 /*                                                  2 /*
  3  * ipmi.h                                           3  * ipmi.h
  4  *                                                  4  *
  5  * MontaVista IPMI interface                        5  * MontaVista IPMI interface
  6  *                                                  6  *
  7  * Author: MontaVista Software, Inc.                7  * Author: MontaVista Software, Inc.
  8  *         Corey Minyard <minyard@mvista.com>       8  *         Corey Minyard <minyard@mvista.com>
  9  *         source@mvista.com                        9  *         source@mvista.com
 10  *                                                 10  *
 11  * Copyright 2002 MontaVista Software Inc.         11  * Copyright 2002 MontaVista Software Inc.
 12  *                                                 12  *
 13  */                                                13  */
 14                                                    14 
 15 #ifndef _UAPI__LINUX_IPMI_H                        15 #ifndef _UAPI__LINUX_IPMI_H
 16 #define _UAPI__LINUX_IPMI_H                        16 #define _UAPI__LINUX_IPMI_H
 17                                                    17 
 18 #include <linux/ipmi_msgdefs.h>                    18 #include <linux/ipmi_msgdefs.h>
 19 #include <linux/compiler.h>                        19 #include <linux/compiler.h>
 20                                                    20 
 21 /*                                                 21 /*
 22  * This file describes an interface to an IPMI     22  * This file describes an interface to an IPMI driver.  You have to
 23  * have a fairly good understanding of IPMI to     23  * have a fairly good understanding of IPMI to use this, so go read
 24  * the specs first before actually trying to d     24  * the specs first before actually trying to do anything.
 25  *                                                 25  *
 26  * With that said, this driver provides a mult     26  * With that said, this driver provides a multi-user interface to the
 27  * IPMI driver, and it allows multiple IPMI ph     27  * IPMI driver, and it allows multiple IPMI physical interfaces below
 28  * the driver.  The physical interfaces bind a     28  * the driver.  The physical interfaces bind as a lower layer on the
 29  * driver.  They appear as interfaces to the a     29  * driver.  They appear as interfaces to the application using this
 30  * interface.                                      30  * interface.
 31  *                                                 31  *
 32  * Multi-user means that multiple applications     32  * Multi-user means that multiple applications may use the driver,
 33  * send commands, receive responses, etc.  The     33  * send commands, receive responses, etc.  The driver keeps track of
 34  * commands the user sends and tracks the resp     34  * commands the user sends and tracks the responses.  The responses
 35  * will go back to the application that send t     35  * will go back to the application that send the command.  If the
 36  * response doesn't come back in time, the dri     36  * response doesn't come back in time, the driver will return a
 37  * timeout error response to the application.      37  * timeout error response to the application.  Asynchronous events
 38  * from the BMC event queue will go to all use     38  * from the BMC event queue will go to all users bound to the driver.
 39  * The incoming event queue in the BMC will au     39  * The incoming event queue in the BMC will automatically be flushed
 40  * if it becomes full and it is queried once a     40  * if it becomes full and it is queried once a second to see if
 41  * anything is in it.  Incoming commands to th     41  * anything is in it.  Incoming commands to the driver will get
 42  * delivered as commands.                          42  * delivered as commands.
 43  */                                                43  */
 44                                                    44 
 45 /*                                                 45 /*
 46  * This is an overlay for all the address type     46  * This is an overlay for all the address types, so it's easy to
 47  * determine the actual address type.  This is     47  * determine the actual address type.  This is kind of like addresses
 48  * work for sockets.                               48  * work for sockets.
 49  */                                                49  */
 50 #define IPMI_MAX_ADDR_SIZE 32                      50 #define IPMI_MAX_ADDR_SIZE 32
 51 struct ipmi_addr {                                 51 struct ipmi_addr {
 52          /* Try to take these from the "Channe     52          /* Try to take these from the "Channel Medium Type" table
 53             in section 6.5 of the IPMI 1.5 man     53             in section 6.5 of the IPMI 1.5 manual. */
 54         int   addr_type;                           54         int   addr_type;
 55         short channel;                             55         short channel;
 56         char  data[IPMI_MAX_ADDR_SIZE];            56         char  data[IPMI_MAX_ADDR_SIZE];
 57 };                                                 57 };
 58                                                    58 
 59 /*                                                 59 /*
 60  * When the address is not used, the type will     60  * When the address is not used, the type will be set to this value.
 61  * The channel is the BMC's channel number for     61  * The channel is the BMC's channel number for the channel (usually
 62  * 0), or IPMC_BMC_CHANNEL if communicating di     62  * 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC.
 63  */                                                63  */
 64 #define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c       64 #define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c
 65 struct ipmi_system_interface_addr {                65 struct ipmi_system_interface_addr {
 66         int           addr_type;                   66         int           addr_type;
 67         short         channel;                     67         short         channel;
 68         unsigned char lun;                         68         unsigned char lun;
 69 };                                                 69 };
 70                                                    70 
 71 /* An IPMB Address. */                             71 /* An IPMB Address. */
 72 #define IPMI_IPMB_ADDR_TYPE             0x01       72 #define IPMI_IPMB_ADDR_TYPE             0x01
 73 /* Used for broadcast get device id as describ     73 /* Used for broadcast get device id as described in section 17.9 of the
 74    IPMI 1.5 manual. */                             74    IPMI 1.5 manual. */
 75 #define IPMI_IPMB_BROADCAST_ADDR_TYPE   0x41       75 #define IPMI_IPMB_BROADCAST_ADDR_TYPE   0x41
 76 struct ipmi_ipmb_addr {                            76 struct ipmi_ipmb_addr {
 77         int           addr_type;                   77         int           addr_type;
 78         short         channel;                     78         short         channel;
 79         unsigned char slave_addr;                  79         unsigned char slave_addr;
 80         unsigned char lun;                         80         unsigned char lun;
 81 };                                                 81 };
 82                                                    82 
 83 /*                                                 83 /*
 84  * Used for messages received directly from an << 
 85  * through a MC.  This is for systems that sit << 
 86  * they can receive commands and respond to th << 
 87  */                                            << 
 88 #define IPMI_IPMB_DIRECT_ADDR_TYPE      0x81   << 
 89 struct ipmi_ipmb_direct_addr {                 << 
 90         int           addr_type;               << 
 91         short         channel;                 << 
 92         unsigned char slave_addr;              << 
 93         unsigned char rs_lun;                  << 
 94         unsigned char rq_lun;                  << 
 95 };                                             << 
 96                                                << 
 97 /*                                             << 
 98  * A LAN Address.  This is an address to/from      84  * A LAN Address.  This is an address to/from a LAN interface bridged
 99  * by the BMC, not an address actually out on      85  * by the BMC, not an address actually out on the LAN.
100  *                                                 86  *
101  * A conscious decision was made here to devia     87  * A conscious decision was made here to deviate slightly from the IPMI
102  * spec.  We do not use rqSWID and rsSWID like     88  * spec.  We do not use rqSWID and rsSWID like it shows in the
103  * message.  Instead, we use remote_SWID and l     89  * message.  Instead, we use remote_SWID and local_SWID.  This means
104  * that any message (a request or response) fr     90  * that any message (a request or response) from another device will
105  * always have exactly the same address.  If y     91  * always have exactly the same address.  If you didn't do this,
106  * requests and responses from the same device     92  * requests and responses from the same device would have different
107  * addresses, and that's not too cool.             93  * addresses, and that's not too cool.
108  *                                                 94  *
109  * In this address, the remote_SWID is always      95  * In this address, the remote_SWID is always the SWID the remote
110  * message came from, or the SWID we are sendi     96  * message came from, or the SWID we are sending the message to.
111  * local_SWID is always our SWID.  Note that h     97  * local_SWID is always our SWID.  Note that having our SWID in the
112  * message is a little weird, but this is requ     98  * message is a little weird, but this is required.
113  */                                                99  */
114 #define IPMI_LAN_ADDR_TYPE              0x04      100 #define IPMI_LAN_ADDR_TYPE              0x04
115 struct ipmi_lan_addr {                            101 struct ipmi_lan_addr {
116         int           addr_type;                  102         int           addr_type;
117         short         channel;                    103         short         channel;
118         unsigned char privilege;                  104         unsigned char privilege;
119         unsigned char session_handle;             105         unsigned char session_handle;
120         unsigned char remote_SWID;                106         unsigned char remote_SWID;
121         unsigned char local_SWID;                 107         unsigned char local_SWID;
122         unsigned char lun;                        108         unsigned char lun;
123 };                                                109 };
124                                                   110 
125                                                   111 
126 /*                                                112 /*
127  * Channel for talking directly with the BMC.     113  * Channel for talking directly with the BMC.  When using this
128  * channel, This is for the system interface a    114  * channel, This is for the system interface address type only.  FIXME
129  * - is this right, or should we use -1?          115  * - is this right, or should we use -1?
130  */                                               116  */
131 #define IPMI_BMC_CHANNEL  0xf                     117 #define IPMI_BMC_CHANNEL  0xf
132 #define IPMI_NUM_CHANNELS 0x10                    118 #define IPMI_NUM_CHANNELS 0x10
133                                                   119 
134 /*                                                120 /*
135  * Used to signify an "all channel" bitmask.      121  * Used to signify an "all channel" bitmask.  This is more than the
136  * actual number of channels because this is u    122  * actual number of channels because this is used in userland and
137  * will cover us if the number of channels is     123  * will cover us if the number of channels is extended.
138  */                                               124  */
139 #define IPMI_CHAN_ALL     (~0)                    125 #define IPMI_CHAN_ALL     (~0)
140                                                   126 
141                                                   127 
142 /*                                                128 /*
143  * A raw IPMI message without any addressing.     129  * A raw IPMI message without any addressing.  This covers both
144  * commands and responses.  The completion cod    130  * commands and responses.  The completion code is always the first
145  * byte of data in the response (as the spec s    131  * byte of data in the response (as the spec shows the messages laid
146  * out).                                          132  * out).
147  */                                               133  */
148 struct ipmi_msg {                                 134 struct ipmi_msg {
149         unsigned char  netfn;                     135         unsigned char  netfn;
150         unsigned char  cmd;                       136         unsigned char  cmd;
151         unsigned short data_len;                  137         unsigned short data_len;
152         unsigned char  __user *data;              138         unsigned char  __user *data;
153 };                                                139 };
154                                                   140 
155 struct kernel_ipmi_msg {                          141 struct kernel_ipmi_msg {
156         unsigned char  netfn;                     142         unsigned char  netfn;
157         unsigned char  cmd;                       143         unsigned char  cmd;
158         unsigned short data_len;                  144         unsigned short data_len;
159         unsigned char  *data;                     145         unsigned char  *data;
160 };                                                146 };
161                                                   147 
162 /*                                                148 /*
163  * Various defines that are useful for IPMI ap    149  * Various defines that are useful for IPMI applications.
164  */                                               150  */
165 #define IPMI_INVALID_CMD_COMPLETION_CODE          151 #define IPMI_INVALID_CMD_COMPLETION_CODE        0xC1
166 #define IPMI_TIMEOUT_COMPLETION_CODE              152 #define IPMI_TIMEOUT_COMPLETION_CODE            0xC3
167 #define IPMI_UNKNOWN_ERR_COMPLETION_CODE          153 #define IPMI_UNKNOWN_ERR_COMPLETION_CODE        0xff
168                                                   154 
169                                                   155 
170 /*                                                156 /*
171  * Receive types for messages coming from the     157  * Receive types for messages coming from the receive interface.  This
172  * is used for the receive in-kernel interface    158  * is used for the receive in-kernel interface and in the receive
173  * IOCTL.                                         159  * IOCTL.
174  *                                                160  *
175  * The "IPMI_RESPONSE_RESPONSE_TYPE" is a litt !! 161  * The "IPMI_RESPONSE_RESPNOSE_TYPE" is a little strange sounding, but
176  * it allows you to get the message results wh    162  * it allows you to get the message results when you send a response
177  * message.                                       163  * message.
178  */                                               164  */
179 #define IPMI_RESPONSE_RECV_TYPE         1 /* A    165 #define IPMI_RESPONSE_RECV_TYPE         1 /* A response to a command */
180 #define IPMI_ASYNC_EVENT_RECV_TYPE      2 /* S    166 #define IPMI_ASYNC_EVENT_RECV_TYPE      2 /* Something from the event queue */
181 #define IPMI_CMD_RECV_TYPE              3 /* A    167 #define IPMI_CMD_RECV_TYPE              3 /* A command from somewhere else */
182 #define IPMI_RESPONSE_RESPONSE_TYPE     4 /* T    168 #define IPMI_RESPONSE_RESPONSE_TYPE     4 /* The response for
183                                                   169                                               a sent response, giving any
184                                                   170                                               error status for sending the
185                                                   171                                               response.  When you send a
186                                                   172                                               response message, this will
187                                                   173                                               be returned. */
188 #define IPMI_OEM_RECV_TYPE              5 /* T    174 #define IPMI_OEM_RECV_TYPE              5 /* The response for OEM Channels */
189                                                   175 
190 /* Note that async events and received command    176 /* Note that async events and received commands do not have a completion
191    code as the first byte of the incoming data    177    code as the first byte of the incoming data, unlike a response. */
192                                                   178 
193                                                   179 
194 /*                                                180 /*
195  * Modes for ipmi_set_maint_mode() and the use    181  * Modes for ipmi_set_maint_mode() and the userland IOCTL.  The AUTO
196  * setting is the default and means it will be    182  * setting is the default and means it will be set on certain
197  * commands.  Hard setting it on and off will     183  * commands.  Hard setting it on and off will override automatic
198  * operation.                                     184  * operation.
199  */                                               185  */
200 #define IPMI_MAINTENANCE_MODE_AUTO      0         186 #define IPMI_MAINTENANCE_MODE_AUTO      0
201 #define IPMI_MAINTENANCE_MODE_OFF       1         187 #define IPMI_MAINTENANCE_MODE_OFF       1
202 #define IPMI_MAINTENANCE_MODE_ON        2         188 #define IPMI_MAINTENANCE_MODE_ON        2
203                                                   189 
204                                                   190 
205                                                   191 
206 /*                                                192 /*
207  * The userland interface                         193  * The userland interface
208  */                                               194  */
209                                                   195 
210 /*                                                196 /*
211  * The userland interface for the IPMI driver     197  * The userland interface for the IPMI driver is a standard character
212  * device, with each instance of an interface     198  * device, with each instance of an interface registered as a minor
213  * number under the major character device.       199  * number under the major character device.
214  *                                                200  *
215  * The read and write calls do not work, to ge    201  * The read and write calls do not work, to get messages in and out
216  * requires ioctl calls because of the complex    202  * requires ioctl calls because of the complexity of the data.  select
217  * and poll do work, so you can wait for input    203  * and poll do work, so you can wait for input using the file
218  * descriptor, you just can use read to get it    204  * descriptor, you just can use read to get it.
219  *                                                205  *
220  * In general, you send a command down to the     206  * In general, you send a command down to the interface and receive
221  * responses back.  You can use the msgid valu    207  * responses back.  You can use the msgid value to correlate commands
222  * and responses, the driver will take care of    208  * and responses, the driver will take care of figuring out which
223  * incoming messages are for which command and    209  * incoming messages are for which command and find the proper msgid
224  * value to report.  You will only receive rep    210  * value to report.  You will only receive reponses for commands you
225  * send.  Asynchronous events, however, go to     211  * send.  Asynchronous events, however, go to all open users, so you
226  * must be ready to handle these (or ignore th    212  * must be ready to handle these (or ignore them if you don't care).
227  *                                                213  *
228  * The address type depends upon the channel t    214  * The address type depends upon the channel type.  When talking
229  * directly to the BMC (IPMC_BMC_CHANNEL), the    215  * directly to the BMC (IPMC_BMC_CHANNEL), the address is ignored
230  * (IPMI_UNUSED_ADDR_TYPE).  When talking to a    216  * (IPMI_UNUSED_ADDR_TYPE).  When talking to an IPMB channel, you must
231  * supply a valid IPMB address with the addr_t    217  * supply a valid IPMB address with the addr_type set properly.
232  *                                                218  *
233  * When talking to normal channels, the driver    219  * When talking to normal channels, the driver takes care of the
234  * details of formatting and sending messages     220  * details of formatting and sending messages on that channel.  You do
235  * not, for instance, have to format a send co    221  * not, for instance, have to format a send command, you just send
236  * whatever command you want to the channel, t    222  * whatever command you want to the channel, the driver will create
237  * the send command, automatically issue recei    223  * the send command, automatically issue receive command and get even
238  * commands, and pass those up to the proper u    224  * commands, and pass those up to the proper user.
239  */                                               225  */
240                                                   226 
241                                                   227 
242 /* The magic IOCTL value for this interface. *    228 /* The magic IOCTL value for this interface. */
243 #define IPMI_IOC_MAGIC 'i'                        229 #define IPMI_IOC_MAGIC 'i'
244                                                   230 
245                                                   231 
246 /* Messages sent to the interface are this for    232 /* Messages sent to the interface are this format. */
247 struct ipmi_req {                                 233 struct ipmi_req {
248         unsigned char __user *addr; /* Address    234         unsigned char __user *addr; /* Address to send the message to. */
249         unsigned int  addr_len;                   235         unsigned int  addr_len;
250                                                   236 
251         long    msgid; /* The sequence number     237         long    msgid; /* The sequence number for the message.  This
252                           exact value will be     238                           exact value will be reported back in the
253                           response to this req    239                           response to this request if it is a command.
254                           If it is a response,    240                           If it is a response, this will be used as
255                           the sequence value f    241                           the sequence value for the response.  */
256                                                   242 
257         struct ipmi_msg msg;                      243         struct ipmi_msg msg;
258 };                                                244 };
259 /*                                                245 /*
260  * Send a message to the interfaces.  error va    246  * Send a message to the interfaces.  error values are:
261  *   - EFAULT - an address supplied was invali    247  *   - EFAULT - an address supplied was invalid.
262  *   - EINVAL - The address supplied was not v    248  *   - EINVAL - The address supplied was not valid, or the command
263  *              was not allowed.                  249  *              was not allowed.
264  *   - EMSGSIZE - The message to was too large    250  *   - EMSGSIZE - The message to was too large.
265  *   - ENOMEM - Buffers could not be allocated    251  *   - ENOMEM - Buffers could not be allocated for the command.
266  */                                               252  */
267 #define IPMICTL_SEND_COMMAND            _IOR(I    253 #define IPMICTL_SEND_COMMAND            _IOR(IPMI_IOC_MAGIC, 13,        \
268                                              s    254                                              struct ipmi_req)
269                                                   255 
270 /* Messages sent to the interface with timing     256 /* Messages sent to the interface with timing parameters are this
271    format. */                                     257    format. */
272 struct ipmi_req_settime {                         258 struct ipmi_req_settime {
273         struct ipmi_req req;                      259         struct ipmi_req req;
274                                                   260 
275         /* See ipmi_request_settime() above fo    261         /* See ipmi_request_settime() above for details on these
276            values. */                             262            values. */
277         int          retries;                     263         int          retries;
278         unsigned int retry_time_ms;               264         unsigned int retry_time_ms;
279 };                                                265 };
280 /*                                                266 /*
281  * Send a message to the interfaces with timin    267  * Send a message to the interfaces with timing parameters.  error values
282  * are:                                           268  * are:
283  *   - EFAULT - an address supplied was invali    269  *   - EFAULT - an address supplied was invalid.
284  *   - EINVAL - The address supplied was not v    270  *   - EINVAL - The address supplied was not valid, or the command
285  *              was not allowed.                  271  *              was not allowed.
286  *   - EMSGSIZE - The message to was too large    272  *   - EMSGSIZE - The message to was too large.
287  *   - ENOMEM - Buffers could not be allocated    273  *   - ENOMEM - Buffers could not be allocated for the command.
288  */                                               274  */
289 #define IPMICTL_SEND_COMMAND_SETTIME    _IOR(I    275 #define IPMICTL_SEND_COMMAND_SETTIME    _IOR(IPMI_IOC_MAGIC, 21,        \
290                                              s    276                                              struct ipmi_req_settime)
291                                                   277 
292 /* Messages received from the interface are th    278 /* Messages received from the interface are this format. */
293 struct ipmi_recv {                                279 struct ipmi_recv {
294         int     recv_type; /* Is this a comman    280         int     recv_type; /* Is this a command, response or an
295                               asyncronous even    281                               asyncronous event. */
296                                                   282 
297         unsigned char __user *addr;    /* Addr    283         unsigned char __user *addr;    /* Address the message was from is put
298                                    here.  The     284                                    here.  The caller must supply the
299                                    memory. */     285                                    memory. */
300         unsigned int  addr_len; /* The size of    286         unsigned int  addr_len; /* The size of the address buffer.
301                                    The caller     287                                    The caller supplies the full buffer
302                                    length, thi    288                                    length, this value is updated to
303                                    the actual     289                                    the actual message length when the
304                                    message is     290                                    message is received. */
305                                                   291 
306         long    msgid; /* The sequence number     292         long    msgid; /* The sequence number specified in the request
307                           if this is a respons    293                           if this is a response.  If this is a command,
308                           this will be the seq    294                           this will be the sequence number from the
309                           command. */             295                           command. */
310                                                   296 
311         struct ipmi_msg msg; /* The data field    297         struct ipmi_msg msg; /* The data field must point to a buffer.
312                                 The data_size     298                                 The data_size field must be set to the
313                                 size of the me    299                                 size of the message buffer.  The
314                                 caller supplie    300                                 caller supplies the full buffer
315                                 length, this v    301                                 length, this value is updated to the
316                                 actual message    302                                 actual message length when the message
317                                 is received. *    303                                 is received. */
318 };                                                304 };
319                                                   305 
320 /*                                                306 /*
321  * Receive a message.  error values:              307  * Receive a message.  error values:
322  *  - EAGAIN - no messages in the queue.          308  *  - EAGAIN - no messages in the queue.
323  *  - EFAULT - an address supplied was invalid    309  *  - EFAULT - an address supplied was invalid.
324  *  - EINVAL - The address supplied was not va    310  *  - EINVAL - The address supplied was not valid.
325  *  - EMSGSIZE - The message to was too large     311  *  - EMSGSIZE - The message to was too large to fit into the message buffer,
326  *               the message will be left in t    312  *               the message will be left in the buffer. */
327 #define IPMICTL_RECEIVE_MSG             _IOWR(    313 #define IPMICTL_RECEIVE_MSG             _IOWR(IPMI_IOC_MAGIC, 12,       \
328                                                   314                                               struct ipmi_recv)
329                                                   315 
330 /*                                                316 /*
331  * Like RECEIVE_MSG, but if the message won't     317  * Like RECEIVE_MSG, but if the message won't fit in the buffer, it
332  * will truncate the contents instead of leavi    318  * will truncate the contents instead of leaving the data in the
333  * buffer.                                        319  * buffer.
334  */                                               320  */
335 #define IPMICTL_RECEIVE_MSG_TRUNC       _IOWR(    321 #define IPMICTL_RECEIVE_MSG_TRUNC       _IOWR(IPMI_IOC_MAGIC, 11,       \
336                                                   322                                               struct ipmi_recv)
337                                                   323 
338 /* Register to get commands from other entitie    324 /* Register to get commands from other entities on this interface. */
339 struct ipmi_cmdspec {                             325 struct ipmi_cmdspec {
340         unsigned char netfn;                      326         unsigned char netfn;
341         unsigned char cmd;                        327         unsigned char cmd;
342 };                                                328 };
343                                                   329 
344 /*                                                330 /*
345  * Register to receive a specific command.  er    331  * Register to receive a specific command.  error values:
346  *   - EFAULT - an address supplied was invali    332  *   - EFAULT - an address supplied was invalid.
347  *   - EBUSY - The netfn/cmd supplied was alre    333  *   - EBUSY - The netfn/cmd supplied was already in use.
348  *   - ENOMEM - could not allocate memory for     334  *   - ENOMEM - could not allocate memory for the entry.
349  */                                               335  */
350 #define IPMICTL_REGISTER_FOR_CMD        _IOR(I    336 #define IPMICTL_REGISTER_FOR_CMD        _IOR(IPMI_IOC_MAGIC, 14,        \
351                                              s    337                                              struct ipmi_cmdspec)
352 /*                                                338 /*
353  * Unregister a registered command.  error val    339  * Unregister a registered command.  error values:
354  *  - EFAULT - an address supplied was invalid    340  *  - EFAULT - an address supplied was invalid.
355  *  - ENOENT - The netfn/cmd was not found reg    341  *  - ENOENT - The netfn/cmd was not found registered for this user.
356  */                                               342  */
357 #define IPMICTL_UNREGISTER_FOR_CMD      _IOR(I    343 #define IPMICTL_UNREGISTER_FOR_CMD      _IOR(IPMI_IOC_MAGIC, 15,        \
358                                              s    344                                              struct ipmi_cmdspec)
359                                                   345 
360 /*                                                346 /*
361  * Register to get commands from other entitie    347  * Register to get commands from other entities on specific channels.
362  * This way, you can only listen on specific c    348  * This way, you can only listen on specific channels, or have messages
363  * from some channels go to one place and othe    349  * from some channels go to one place and other channels to someplace
364  * else.  The chans field is a bitmask, (1 <<     350  * else.  The chans field is a bitmask, (1 << channel) for each channel.
365  * It may be IPMI_CHAN_ALL for all channels.      351  * It may be IPMI_CHAN_ALL for all channels.
366  */                                               352  */
367 struct ipmi_cmdspec_chans {                       353 struct ipmi_cmdspec_chans {
368         unsigned int netfn;                       354         unsigned int netfn;
369         unsigned int cmd;                         355         unsigned int cmd;
370         unsigned int chans;                       356         unsigned int chans;
371 };                                                357 };
372                                                   358 
373 /*                                                359 /*
374  * Register to receive a specific command on s    360  * Register to receive a specific command on specific channels.  error values:
375  *   - EFAULT - an address supplied was invali    361  *   - EFAULT - an address supplied was invalid.
376  *   - EBUSY - One of the netfn/cmd/chans supp    362  *   - EBUSY - One of the netfn/cmd/chans supplied was already in use.
377  *   - ENOMEM - could not allocate memory for     363  *   - ENOMEM - could not allocate memory for the entry.
378  */                                               364  */
379 #define IPMICTL_REGISTER_FOR_CMD_CHANS  _IOR(I    365 #define IPMICTL_REGISTER_FOR_CMD_CHANS  _IOR(IPMI_IOC_MAGIC, 28,        \
380                                              s    366                                              struct ipmi_cmdspec_chans)
381 /*                                                367 /*
382  * Unregister some netfn/cmd/chans.  error val    368  * Unregister some netfn/cmd/chans.  error values:
383  *  - EFAULT - an address supplied was invalid    369  *  - EFAULT - an address supplied was invalid.
384  *  - ENOENT - None of the netfn/cmd/chans wer    370  *  - ENOENT - None of the netfn/cmd/chans were found registered for this user.
385  */                                               371  */
386 #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(    372 #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29,       \
387                                              s    373                                              struct ipmi_cmdspec_chans)
388                                                   374 
389 /*                                                375 /*
390  * Set whether this interface receives events.    376  * Set whether this interface receives events.  Note that the first
391  * user registered for events will get all pen    377  * user registered for events will get all pending events for the
392  * interface.  error values:                      378  * interface.  error values:
393  *  - EFAULT - an address supplied was invalid    379  *  - EFAULT - an address supplied was invalid.
394  */                                               380  */
395 #define IPMICTL_SET_GETS_EVENTS_CMD     _IOR(I    381 #define IPMICTL_SET_GETS_EVENTS_CMD     _IOR(IPMI_IOC_MAGIC, 16, int)
396                                                   382 
397 /*                                                383 /*
398  * Set and get the slave address and LUN that     384  * Set and get the slave address and LUN that we will use for our
399  * source messages.  Note that this affects th    385  * source messages.  Note that this affects the interface, not just
400  * this user, so it will affect all users of t    386  * this user, so it will affect all users of this interface.  This is
401  * so some initialization code can come in and    387  * so some initialization code can come in and do the OEM-specific
402  * things it takes to determine your address (    388  * things it takes to determine your address (if not the BMC) and set
403  * it for everyone else.  You should probably     389  * it for everyone else.  You should probably leave the LUN alone.
404  */                                               390  */
405 struct ipmi_channel_lun_address_set {             391 struct ipmi_channel_lun_address_set {
406         unsigned short channel;                   392         unsigned short channel;
407         unsigned char  value;                     393         unsigned char  value;
408 };                                                394 };
409 #define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD \      395 #define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD \
410         _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_c    396         _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
411 #define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD \      397 #define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD \
412         _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_c    398         _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
413 #define IPMICTL_SET_MY_CHANNEL_LUN_CMD \          399 #define IPMICTL_SET_MY_CHANNEL_LUN_CMD \
414         _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_c    400         _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
415 #define IPMICTL_GET_MY_CHANNEL_LUN_CMD \          401 #define IPMICTL_GET_MY_CHANNEL_LUN_CMD \
416         _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_c    402         _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
417 /* Legacy interfaces, these only set IPMB 0. *    403 /* Legacy interfaces, these only set IPMB 0. */
418 #define IPMICTL_SET_MY_ADDRESS_CMD      _IOR(I    404 #define IPMICTL_SET_MY_ADDRESS_CMD      _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
419 #define IPMICTL_GET_MY_ADDRESS_CMD      _IOR(I    405 #define IPMICTL_GET_MY_ADDRESS_CMD      _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
420 #define IPMICTL_SET_MY_LUN_CMD          _IOR(I    406 #define IPMICTL_SET_MY_LUN_CMD          _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
421 #define IPMICTL_GET_MY_LUN_CMD          _IOR(I    407 #define IPMICTL_GET_MY_LUN_CMD          _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
422                                                   408 
423 /*                                                409 /*
424  * Get/set the default timing values for an in    410  * Get/set the default timing values for an interface.  You shouldn't
425  * generally mess with these.                     411  * generally mess with these.
426  */                                               412  */
427 struct ipmi_timing_parms {                        413 struct ipmi_timing_parms {
428         int          retries;                     414         int          retries;
429         unsigned int retry_time_ms;               415         unsigned int retry_time_ms;
430 };                                                416 };
431 #define IPMICTL_SET_TIMING_PARMS_CMD    _IOR(I    417 #define IPMICTL_SET_TIMING_PARMS_CMD    _IOR(IPMI_IOC_MAGIC, 22, \
432                                              s    418                                              struct ipmi_timing_parms)
433 #define IPMICTL_GET_TIMING_PARMS_CMD    _IOR(I    419 #define IPMICTL_GET_TIMING_PARMS_CMD    _IOR(IPMI_IOC_MAGIC, 23, \
434                                              s    420                                              struct ipmi_timing_parms)
435                                                   421 
436 /*                                                422 /*
437  * Set the maintenance mode.  See ipmi_set_mai    423  * Set the maintenance mode.  See ipmi_set_maintenance_mode() above
438  * for a description of what this does.           424  * for a description of what this does.
439  */                                               425  */
440 #define IPMICTL_GET_MAINTENANCE_MODE_CMD          426 #define IPMICTL_GET_MAINTENANCE_MODE_CMD        _IOR(IPMI_IOC_MAGIC, 30, int)
441 #define IPMICTL_SET_MAINTENANCE_MODE_CMD          427 #define IPMICTL_SET_MAINTENANCE_MODE_CMD        _IOW(IPMI_IOC_MAGIC, 31, int)
442                                                   428 
443 #endif /* _UAPI__LINUX_IPMI_H */                  429 #endif /* _UAPI__LINUX_IPMI_H */
444                                                   430 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php