xref: /aosp_15_r20/prebuilts/build-tools/sysroots/x86_64-unknown-linux-musl/include/linux/ipmi.h (revision cda5da8d549138a6648c5ee6d7a49cf8f4a657be)
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _UAPI__LINUX_IPMI_H
8 #define _UAPI__LINUX_IPMI_H
9 #include <linux/ipmi_msgdefs.h>
10 #include <linux/compiler.h>
11 #define IPMI_MAX_ADDR_SIZE 32
12 struct ipmi_addr {
13   int addr_type;
14   short channel;
15   char data[IPMI_MAX_ADDR_SIZE];
16 };
17 #define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c
18 struct ipmi_system_interface_addr {
19   int addr_type;
20   short channel;
21   unsigned char lun;
22 };
23 #define IPMI_IPMB_ADDR_TYPE 0x01
24 #define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41
25 struct ipmi_ipmb_addr {
26   int addr_type;
27   short channel;
28   unsigned char slave_addr;
29   unsigned char lun;
30 };
31 #define IPMI_IPMB_DIRECT_ADDR_TYPE 0x81
32 struct ipmi_ipmb_direct_addr {
33   int addr_type;
34   short channel;
35   unsigned char slave_addr;
36   unsigned char rs_lun;
37   unsigned char rq_lun;
38 };
39 #define IPMI_LAN_ADDR_TYPE 0x04
40 struct ipmi_lan_addr {
41   int addr_type;
42   short channel;
43   unsigned char privilege;
44   unsigned char session_handle;
45   unsigned char remote_SWID;
46   unsigned char local_SWID;
47   unsigned char lun;
48 };
49 #define IPMI_BMC_CHANNEL 0xf
50 #define IPMI_NUM_CHANNELS 0x10
51 #define IPMI_CHAN_ALL (~0)
52 struct ipmi_msg {
53   unsigned char netfn;
54   unsigned char cmd;
55   unsigned short data_len;
56   unsigned char  * data;
57 };
58 struct kernel_ipmi_msg {
59   unsigned char netfn;
60   unsigned char cmd;
61   unsigned short data_len;
62   unsigned char * data;
63 };
64 #define IPMI_INVALID_CMD_COMPLETION_CODE 0xC1
65 #define IPMI_TIMEOUT_COMPLETION_CODE 0xC3
66 #define IPMI_UNKNOWN_ERR_COMPLETION_CODE 0xff
67 #define IPMI_RESPONSE_RECV_TYPE 1
68 #define IPMI_ASYNC_EVENT_RECV_TYPE 2
69 #define IPMI_CMD_RECV_TYPE 3
70 #define IPMI_RESPONSE_RESPONSE_TYPE 4
71 #define IPMI_OEM_RECV_TYPE 5
72 #define IPMI_MAINTENANCE_MODE_AUTO 0
73 #define IPMI_MAINTENANCE_MODE_OFF 1
74 #define IPMI_MAINTENANCE_MODE_ON 2
75 #define IPMI_IOC_MAGIC 'i'
76 struct ipmi_req {
77   unsigned char  * addr;
78   unsigned int addr_len;
79   long msgid;
80   struct ipmi_msg msg;
81 };
82 #define IPMICTL_SEND_COMMAND _IOR(IPMI_IOC_MAGIC, 13, struct ipmi_req)
83 struct ipmi_req_settime {
84   struct ipmi_req req;
85   int retries;
86   unsigned int retry_time_ms;
87 };
88 #define IPMICTL_SEND_COMMAND_SETTIME _IOR(IPMI_IOC_MAGIC, 21, struct ipmi_req_settime)
89 struct ipmi_recv {
90   int recv_type;
91   unsigned char  * addr;
92   unsigned int addr_len;
93   long msgid;
94   struct ipmi_msg msg;
95 };
96 #define IPMICTL_RECEIVE_MSG _IOWR(IPMI_IOC_MAGIC, 12, struct ipmi_recv)
97 #define IPMICTL_RECEIVE_MSG_TRUNC _IOWR(IPMI_IOC_MAGIC, 11, struct ipmi_recv)
98 struct ipmi_cmdspec {
99   unsigned char netfn;
100   unsigned char cmd;
101 };
102 #define IPMICTL_REGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 14, struct ipmi_cmdspec)
103 #define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, struct ipmi_cmdspec)
104 struct ipmi_cmdspec_chans {
105   unsigned int netfn;
106   unsigned int cmd;
107   unsigned int chans;
108 };
109 #define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, struct ipmi_cmdspec_chans)
110 #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, struct ipmi_cmdspec_chans)
111 #define IPMICTL_SET_GETS_EVENTS_CMD _IOR(IPMI_IOC_MAGIC, 16, int)
112 struct ipmi_channel_lun_address_set {
113   unsigned short channel;
114   unsigned char value;
115 };
116 #define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
117 #define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
118 #define IPMICTL_SET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
119 #define IPMICTL_GET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
120 #define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
121 #define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
122 #define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
123 #define IPMICTL_GET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
124 struct ipmi_timing_parms {
125   int retries;
126   unsigned int retry_time_ms;
127 };
128 #define IPMICTL_SET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 22, struct ipmi_timing_parms)
129 #define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, struct ipmi_timing_parms)
130 #define IPMICTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int)
131 #define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int)
132 #endif
133