ipmi(7) ipmi(7)
NAME [Toc] [Back]
ipmi - intelligent platform management interface (IPMI) driver
SYNOPSIS [Toc] [Back]
#include <sys/ipmi.h>
DESCRIPTION [Toc] [Back]
The /dev/ipmi driver allows user processes to send IPMI messages to
the BMC (Baseboard Management Controller) System Message Interface.
The following data structures are provided in the <sys/ipmi.h> header
file for sending IPMI requests to the BMC.
ImbRequest [Toc] [Back]
The ImbRequest structure is used to specify the fields in
the IPMI request.
typedef struct {
BYTE rsSa;
BYTE cmd;
BYTE netFn;
BYTE rsLun;
BYTE dataLength;
BYTE data[1];
} ImbRequest;
rsSa Responding device Slave Address (BMC_SA).
cmd IPMI Command specified in hexadecimal.
netFn IPMI Network Function in hexadecimal.
rsLun Hexadecimal value dependent on cmd.
dataLength Length of following data field.
data Request data if any.
ImbRequestBuffer [Toc] [Back]
The ImbRequestBuffer structure is used to specify a timeout
value for the request. It also contains the IPMI request
itself.
typedef struct {
DWORD flags;
DWORD timeOut;
ImbRequest req;
} ImbRequestBuffer;
flags Currently unused. May be removed in the future.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
ipmi(7) ipmi(7)
timeOut Timeout in micro seconds.
req Variable sized ImbRequest buffer.
ImbResponseBuffer [Toc] [Back]
The ImbResponseBuffer structure contains the response from
the BMC.
typedef struct {
BYTE cCode;
BYTE data[1];
} ImbResponseBuffer;
cCode Completion code from BMC in hexadecimal.
data Response data from BMC excluding Completion
Code.
ioctl Commands
The commands used to send IPMI messages to the BMC are:
IOCTL_IMB_SEND_MESSAGE Allows a 64-bit user process to send a
message to the BMC. The arg parameter
points to an ipmi_data_t structure (defined
in the <sys/ipmi.h> header file) whose
members are as follows:
typedef struct ipmi_data {
caddr_t InBuffer;
DWORD InBufferLength;
caddr_t OutBuffer;
DWORD OutBufferLength;
DWORD * BytesReturned;
caddr_t Overlapped;
int status;
} ipmi_data_t;
IOCTL_IMB_SEND_MESSAGE_32 Allows a 32-bit user process to send a
message to the BMC. The arg parameter
points to an ipmi_data_32_t structure
(defined in the <sys/ipmi.h> header file)
whose members are as follows:
typedef struct ipmi_data_32 {
ptr32_t InBuffer;
DWORD InBufferLength;
ptr32_t OutBuffer;
DWORD OutBufferLength;
ptr32_t BytesReturned;
ptr32_t Overlapped;
int status;
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003
ipmi(7) ipmi(7)
} ipmi_data_32_t;
The fields used in these structures are as defined:
InBuffer Pointer to variable sized ImbRequestBuffer
structure.
InBufferLength Length of relavent data in InBuffer.
OutBuffer Pointer to variable sized ImbResponseBuffer
structure.
OutBufferLength Length of relavent data in OutBuffer.
BytesReturned Pointer to integer which returns output data
length.
Overlapped Currently unused.
status The status must be 0 if the operation was
successful. Otherwise, it contains a value
known internally to the driver. This field may
be obfuscated in future releases.
The return to ioctl() and status field must be zero for the operation
to succeed. If ioctl() returns 0 and status is not 0, the message may
not have been successfully sent to the BMC or the message was
successfully sent, but return data was not successfully received.
The application should check the Completion Code returned by the BMC
to furthur evaluate the status of the operation. The meaning of that
Completion Code is documented in the IPMI specifications.
RETURN VALUE [Toc] [Back]
Unless specified otherwise, upon successful completion, the IPMI
ioctl() commands return a value of 0 (zero). Otherwise, a value of
-1.
ERRORS [Toc] [Back]
[EBUSY] The caller is unable to access the BMC because too
many processes are contending for access.
[ETIMEDOUT] The caller is able to access the BMC but a timeout
occurred because either the timeOut value in
ImbRequestBuffer is too small or the BMC is busy.
[E2BIG] The caller is able to access the BMC but a timeout
occurred because either the timeOut value in
ImbRequestBuffer is too small or the BMC is busy.
Hewlett-Packard Company - 3 - HP-UX 11i Version 2: August 2003
ipmi(7) ipmi(7)
[EFAULT] The buffer pointed to by InBuffer or OutBuffer in
ipmi_data_t or ipmi_data_32_t is invalid.
[ENXIO] The IPMI driver failed to attach to a device during
initialization.
[EINVAL] Incorrect input and/or output buffer lengths.
[EIO] An internal error has occurred.
EXAMPLES [Toc] [Back]
The following segment of code sends the IPMI message Get SEL Info,
NetFn Storage, CMD 0x40. This is section 25.2 of the IPMI v1.5
Specification.
struct selinfo {
BYTE sel_version;
BYTE num_entry_ls;
BYTE num_entry_ms;
BYTE free_space_ls;
BYTE free_space_ms;
BYTE add_timestamp[4];
BYTE erase_timestamp[4];
BYTE op_support;
};
...
uint32_t bytesreturned;
ipmi_data_t ipmidata;
BYTE requestbuffer[64];
BYTE responsebuffer[64];
ImbRequestBuffer *request = requestbuffer;
ImbResponseBuffer *response = responsebuffer;
struct selinfo *selinfo;
request->flags = 0;
request->timeOut = 1000000;
request->req.rsSa = BMC_SA;
request->req.cmd = 0x40;
request->req.netFn = 0x0A;
request->req.rsLun = 0;
request->req.dataLength = 0;
ipmidata.InBuffer = request;
ipmidata.InBufferLength = sizeof(ImbRequestBuffer) - 1;
ipmidata.OutBuffer = response;
ipmidata.OutBufferLength = sizeof(responsebuffer);
ipmidata.BytesReturned = &bytesreturned;
Hewlett-Packard Company - 4 - HP-UX 11i Version 2: August 2003
ipmi(7) ipmi(7)
fd = open("/dev/ipmi",O_RDONLY);
ioctl(fd,IOCTL_IMB_SEND_MESSAGE,&ipmidata);
selinfo = response->data;
FILES [Toc] [Back]
/dev/ipmi IPMI driver file
sys/ipmi.h IPMI header file
SEE ALSO [Toc] [Back]
ioctl(2)
STANDARDS CONFORMANCE [Toc] [Back]
IPMI Interface Specification: v1.0, v1.5
Hewlett-Packard Company - 5 - HP-UX 11i Version 2: August 2003 [ Back ] |