X hits on this document

PDF document

February 10, 2006 - page 41 / 238

626 views

0 shares

0 downloads

0 comments

41 / 238

unsigned char

netfn;

unsigned char

cmd;

unsigned

short

data_len;

unsigned

char

*data;

};

29

3.2. SYSTEM INTERFACES

struct ipmi_msg {

The netfn describes Network FuNction (NetFN) of the class of message being sent. IPMI messages are grouped into different classes by function. The cmd is the command within the class. Chapter 5 discusses this is more detail. The data and data_len fields are the message contents. This structure is used in both sent and received messages.

Sending Commands To send a command, use the following:

rv = ioctl(fd, IPMICTL_SEND_COMMAND, &req);

The req structure has the following format:

struct ipmi_req {

unsigned char

*addr;

unsigned int

addr_len;

long

msgid;

s t r u c t i p m i _ m s g m s g ;

};

The addr and addr_len fields describe the destination address of the management controller to receive message. The msg field itself gives the message to send. The msgid is a field for the user; the user may put any value they want in this field. When the response comes back for the command, it will contain the message id. Since it is a long value, it can be used to hold a pointer value.

The driver guarantees that the user will receive a response for every message that is successfully sent. If the message times out or is undeliverable, an error resonse will be generated and returned.

The following code fragment shows how to send a message to the local management controller, in this case a command to read the value of a sensor:

struct ipmi_req

req;

unsigned char

data[1];

s t r u c t i p m i _ s y s t e m _ i n t e r f a c e _ a d d r s i ;

/* Format the address. */ s i . a d d r _ t y p e = I P M I _ S Y S T E M _ I N T E R F A C E _ A D D R _ T Y P si.channel = IPMI_BMC_CHANNEL; si.lun = 0; E ;

Document info
Document views626
Page views626
Page last viewedThu Dec 08 02:09:28 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments