X hits on this document

PDF document

February 10, 2006 - page 43 / 238

1184 views

0 shares

0 downloads

0 comments

43 / 238

unsigned char

data[IPMI MAX MSG LENGTH];

_

_

_

struct ipmi addr addr; struct ipmi recv recv;

_ _

int

rv;

IPMI RESPONSE RESPONSE TYPE Responses sent by this interface get acked using one of these. This way you can tell if there was an error sending the response.

Received commands are discussed in section 3.2.5. You have to fill in the data for the driver to put the received information into. The following shows how to receive a message:

3.2. SYSTEM INTERFACES

IPMI RESPONSE RECV TYPE A response to a sent command. IPMI ASYNC EVENT RECV TYPE An asyncronous event. IPMI CMD RECV TYPE A command was recevied for the system software.

31

The recv_type field can be one of the following values:

};

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

recv.msg.data = data; recv.msg.data_len = sizeof(data); recv.addr = (unsigned char *) &addr; recv.addr_len = sizeof(addr); r v = i o c t l ( f d , I P M I C T L _ R E C E I V E _ M S G _ T R U N C , & r e c v if (rv == -1) { ) ;

if (errno == EMSGSIZE) { /* The message was truncated, handle it as such. */ ...

} } switch (recv.recv_type) { case IPMI_RESPONSE_RECV_TYPE: ... case IPMI_ASYNC_EVENT_RECV_TYPE: ... case IPMI_CMD_RECV_TYPE: ... case IPMI_RESPONSE_RESPONSE_TYPE: ...

The msgid comes in very handy for this responses, it lets you easily correlate commands and responses. It has no meaning for events. The netfn for a received message have a “one” bitwise or-ed onto the value. In IPMI, even NetFNs are always commands and odd NetFNs are always responses. For responses, the address will always be the same as the sent address. A interface will not receive events by default. You must register to receive them with the following:

int val = 1; r v = i o c t l ( f d , I P M I C T L _ S E T _ G E T S _ E V E N T S _ C M D , & v a l )

Document info
Document views1184
Page views1184
Page last viewedTue Jan 24 21:57:00 UTC 2017
Pages238
Paragraphs8090
Words85809

Comments