• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #define IPMI_MAX_ADDR_SIZE 32
24 struct ipmi_addr {
25   int addr_type;
26   short channel;
27   char data[IPMI_MAX_ADDR_SIZE];
28 };
29 #define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c
30 struct ipmi_system_interface_addr {
31   int addr_type;
32   short channel;
33   unsigned char lun;
34 };
35 #define IPMI_IPMB_ADDR_TYPE 0x01
36 #define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41
37 struct ipmi_ipmb_addr {
38   int addr_type;
39   short channel;
40   unsigned char slave_addr;
41   unsigned char lun;
42 };
43 #define IPMI_IPMB_DIRECT_ADDR_TYPE 0x81
44 struct ipmi_ipmb_direct_addr {
45   int addr_type;
46   short channel;
47   unsigned char slave_addr;
48   unsigned char rs_lun;
49   unsigned char rq_lun;
50 };
51 #define IPMI_LAN_ADDR_TYPE 0x04
52 struct ipmi_lan_addr {
53   int addr_type;
54   short channel;
55   unsigned char privilege;
56   unsigned char session_handle;
57   unsigned char remote_SWID;
58   unsigned char local_SWID;
59   unsigned char lun;
60 };
61 #define IPMI_BMC_CHANNEL 0xf
62 #define IPMI_NUM_CHANNELS 0x10
63 #define IPMI_CHAN_ALL (~0)
64 struct ipmi_msg {
65   unsigned char netfn;
66   unsigned char cmd;
67   unsigned short data_len;
68   unsigned char __user * data;
69 };
70 struct kernel_ipmi_msg {
71   unsigned char netfn;
72   unsigned char cmd;
73   unsigned short data_len;
74   unsigned char * data;
75 };
76 #define IPMI_INVALID_CMD_COMPLETION_CODE 0xC1
77 #define IPMI_TIMEOUT_COMPLETION_CODE 0xC3
78 #define IPMI_UNKNOWN_ERR_COMPLETION_CODE 0xff
79 #define IPMI_RESPONSE_RECV_TYPE 1
80 #define IPMI_ASYNC_EVENT_RECV_TYPE 2
81 #define IPMI_CMD_RECV_TYPE 3
82 #define IPMI_RESPONSE_RESPONSE_TYPE 4
83 #define IPMI_OEM_RECV_TYPE 5
84 #define IPMI_MAINTENANCE_MODE_AUTO 0
85 #define IPMI_MAINTENANCE_MODE_OFF 1
86 #define IPMI_MAINTENANCE_MODE_ON 2
87 #define IPMI_IOC_MAGIC 'i'
88 struct ipmi_req {
89   unsigned char __user * addr;
90   unsigned int addr_len;
91   long msgid;
92   struct ipmi_msg msg;
93 };
94 #define IPMICTL_SEND_COMMAND _IOR(IPMI_IOC_MAGIC, 13, struct ipmi_req)
95 struct ipmi_req_settime {
96   struct ipmi_req req;
97   int retries;
98   unsigned int retry_time_ms;
99 };
100 #define IPMICTL_SEND_COMMAND_SETTIME _IOR(IPMI_IOC_MAGIC, 21, struct ipmi_req_settime)
101 struct ipmi_recv {
102   int recv_type;
103   unsigned char __user * addr;
104   unsigned int addr_len;
105   long msgid;
106   struct ipmi_msg msg;
107 };
108 #define IPMICTL_RECEIVE_MSG _IOWR(IPMI_IOC_MAGIC, 12, struct ipmi_recv)
109 #define IPMICTL_RECEIVE_MSG_TRUNC _IOWR(IPMI_IOC_MAGIC, 11, struct ipmi_recv)
110 struct ipmi_cmdspec {
111   unsigned char netfn;
112   unsigned char cmd;
113 };
114 #define IPMICTL_REGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 14, struct ipmi_cmdspec)
115 #define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, struct ipmi_cmdspec)
116 struct ipmi_cmdspec_chans {
117   unsigned int netfn;
118   unsigned int cmd;
119   unsigned int chans;
120 };
121 #define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, struct ipmi_cmdspec_chans)
122 #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, struct ipmi_cmdspec_chans)
123 #define IPMICTL_SET_GETS_EVENTS_CMD _IOR(IPMI_IOC_MAGIC, 16, int)
124 struct ipmi_channel_lun_address_set {
125   unsigned short channel;
126   unsigned char value;
127 };
128 #define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
129 #define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
130 #define IPMICTL_SET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
131 #define IPMICTL_GET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
132 #define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
133 #define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
134 #define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
135 #define IPMICTL_GET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
136 struct ipmi_timing_parms {
137   int retries;
138   unsigned int retry_time_ms;
139 };
140 #define IPMICTL_SET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 22, struct ipmi_timing_parms)
141 #define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, struct ipmi_timing_parms)
142 #define IPMICTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int)
143 #define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int)
144 #endif
145