X hits on this document

PDF document

February 10, 2006 - page 94 / 238

936 views

0 shares

0 downloads

0 comments

94 / 238

82

CHAPTER 4. THE MC

if (rv) h a n d l e _ e r r o r ( ) ;

}

This is relatively simple to do, but you will not be able to know immediately when new MCs are added to the system. To know that, you must register a callback function as follows:

static void h a n d l e _ m c ( e n u m i p m i _ u p d a t e _ e o p , i p m i _ d o m a i n _ t * d o m a i n , i p m i _ m c _ t * void *cb_data) m c ,

{

my_data_t *my_data = cb_data; /* Process the MC here */

}

void h a n d l e _ n e w _ d o m a i n ( i p m i _ d o m a i n _ t * d o m a i n , m y _ d a t a _ t * m y _ d { int rv; a t a ) r v = i p m i _ d o m a i n _ a d d _ m c _ u p d a t e d _ h a n d l e r ( d o m a i n , h a n d l e _ m c , m y if (rv) _ d a t a ) ; h a n d l e _ e r r o r ( ) ;

}

You should call the function to add an MC updated handler when the domain is reported up (or even before); that way you will not miss any MCs.

4.1.2

MC

Active

An MC may be referenced by another part of they system, but may not be present. For instance, it may be on a plug-in card. An MC that is not present is called “inactive”, an MC that is present is called “active”. OpenIPMI automatically detects whether MCs are active or inactive.

The ipmi_mc_is_active function is used to tell if an MC is active. As wall, callback handlers can be registered with ipmi_mc_add_active_handler to know immediately when an MC is set active or inactive.

4.1.3

MC

Information

OpenIPMI will extract information about the MC from the Get Device ID command; you can fetch this with functions. The functions are almost all of the form:

int ipmi_mc_xxx(ipmi_mc_t *mc)

The fields available (replace “xxx” with these in the previous definition) are:

provides device sdrs

Returns true if the MC has device SDRs, false if not.

Document info
Document views936
Page views936
Page last viewedSun Dec 11 05:07:23 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments