Main Page | Class List | Directories | File List | Class Members | File Members

ipmi_pef.h

Go to the documentation of this file.
00001 /*
00002  * ipmi_pef.h
00003  *
00004  * OpenIPMI interface for dealing with platform event filters
00005  *
00006  * Author: Intel Corporation
00007  *         Jeff Zheng <Jeff.Zheng@intel.com>
00008  *
00009  * Mostly rewritten by: MontaVista Software, Inc.
00010  *                      Corey Minyard <minyard@mvista.com>
00011  *                      source@mvista.com
00012  *
00013  *  This program is free software; you can redistribute it and/or
00014  *  modify it under the terms of the GNU Lesser General Public License
00015  *  as published by the Free Software Foundation; either version 2 of
00016  *  the License, or (at your option) any later version.
00017  *
00018  *
00019  *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
00020  *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00021  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00022  *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00023  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00024  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00025  *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00026  *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
00027  *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00028  *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029  *
00030  *  You should have received a copy of the GNU Lesser General Public
00031  *  License along with this program; if not, write to the Free
00032  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00033  */
00034 
00035 #ifndef _IPMI_PEF_H
00036 #define _IPMI_PEF_H
00037 
00038 #include <OpenIPMI/ipmi_types.h>
00039 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00044 /* The abstract type for pef.  Note that if you use this directly, you
00045    must understand about PEF locking.  If you want easier access to
00046    the configuration, see the ipmi_pef_config_t type later in this
00047    file. */
00048 typedef struct ipmi_pef_s ipmi_pef_t;
00049 
00050 
00051 /* Generic callback used to tell when a PEF operation is done. */
00052 typedef void (*ipmi_pef_done_cb)(ipmi_pef_t *pef,
00053                                  int        err,
00054                                  void       *cb_data);
00055 
00056 /* Generic callback for iterating. */
00057 typedef void (*ipmi_pef_ptr_cb)(ipmi_pef_t *pef,
00058                                 void       *cb_data);
00059 
00060 /* Allocate a PEF.  The PEF will not be usable (it can only be
00061    destroyed) until the done callback is called. */
00062 int ipmi_pef_alloc(ipmi_mc_t        *mc,
00063                    ipmi_pef_done_cb done,
00064                    void             *cb_data,
00065                    ipmi_pef_t       **new_pef);
00066 
00067 /* Destroy a PEF. */
00068 int ipmi_pef_destroy(ipmi_pef_t       *pef,
00069                      ipmi_pef_done_cb handler,
00070                      void             *cb_data);
00071 
00072 /* Used to track references to a pef.  You can use this instead of
00073    ipmi_pef_destroy, but use of the destroy function is
00074    recommended.  This is primarily here to help reference-tracking
00075    garbage collection systems like what is in Perl to be able to
00076    automatically destroy pefs when they are done. */
00077 void ipmi_pef_ref(ipmi_pef_t *pef);
00078 void ipmi_pef_deref(ipmi_pef_t *pef);
00079 
00080 void ipmi_pef_iterate_pefs(ipmi_domain_t   *domain,
00081                            ipmi_pef_ptr_cb handler,
00082                            void            *cb_data);
00083 
00084 /* Fetch a parameter value from the PEF.  The "set" and "block"
00085    parameters are the set selector and block selectors.  If those are
00086    not relevant for the given parm, then set them to zero.  On the
00087    return data, the parameter version is the first byte, followed by
00088    the data. */
00089 typedef void (*ipmi_pef_get_cb)(ipmi_pef_t    *pef,
00090                                 int           err,
00091                                 unsigned char *data,
00092                                 unsigned int  data_len,
00093                                 void          *cb_data);
00094 int ipmi_pef_get_parm(ipmi_pef_t      *pef,
00095                       unsigned int    parm,
00096                       unsigned int    set,
00097                       unsigned int    block,
00098                       ipmi_pef_get_cb done,
00099                       void            *cb_data);
00100 
00101 /* Set the parameter value in the PEF to the given data. */
00102 int ipmi_pef_set_parm(ipmi_pef_t       *pef,
00103                       unsigned int     parm,
00104                       unsigned char    *data,
00105                       unsigned int     data_len,
00106                       ipmi_pef_done_cb done,
00107                       void             *cb_data);
00108 
00109 /* Returns if the MC has a valid working PEF. */
00110 int ipmi_pef_valid(ipmi_pef_t *pef);
00111 
00112 /* Information fetched from the PEF capabilities. */
00113 int ipmi_pef_supports_diagnostic_interrupt(ipmi_pef_t *pef);
00114 int ipmi_pef_supports_oem_action(ipmi_pef_t *pef);
00115 int ipmi_pef_supports_power_cycle(ipmi_pef_t *pef);
00116 int ipmi_pef_supports_reset(ipmi_pef_t *pef);
00117 int ipmi_pef_supports_power_down(ipmi_pef_t *pef);
00118 int ipmi_pef_supports_alert(ipmi_pef_t *pef);
00119 
00120 unsigned int ipmi_pef_major_version(ipmi_pef_t *pef);
00121 unsigned int ipmi_pef_minor_version(ipmi_pef_t *pef);
00122 
00123 unsigned int num_event_filter_table_entries(ipmi_pef_t *pef);
00124 
00125 /* Return the MC this PEF uses. */
00126 ipmi_mcid_t ipmi_pef_get_mc(ipmi_pef_t *pef);
00127 #define IPMI_PEF_NAME_LEN 64
00128 int ipmi_pef_get_name(ipmi_pef_t *pef, char *name, int length);
00129 
00130 /* Standard entries in the PEF configuration. */
00131 
00132 #define IPMI_PEFPARM_SET_IN_PROGRESS            0
00133 #define IPMI_PEFPARM_CONTROL                    1
00134 #define IPMI_PEFPARM_ACTION_GLOBAL_CONTROL      2
00135 #define IPMI_PEFPARM_STARTUP_DELAY              3
00136 #define IPMI_PEFPARM_ALERT_STARTUP_DELAY        4
00137 #define IPMI_PEFPARM_NUM_EVENT_FILTERS          5
00138 #define IPMI_PEFPARM_EVENT_FILTER_TABLE         6
00139 #define IPMI_PEFPARM_EVENT_FILTER_TABLE_DATA1   7
00140 #define IPMI_PEFPARM_NUM_ALERT_POLICIES         8
00141 #define IPMI_PEFPARM_ALERT_POLICY_TABLE         9
00142 #define IPMI_PEFPARM_SYSTEM_GUID                10
00143 #define IPMI_PEFPARM_NUM_ALERT_STRINGS          11
00144 #define IPMI_PEFPARM_ALERT_STRING_KEY           12
00145 #define IPMI_PEFPARM_ALERT_STRING               13
00146 
00147 
00148 /*
00149  * *** NOTE *** READ THIS BEFORE USING THE CONFIG STUFF BELOW
00150  *
00151  * The configuration working below is strongly tied to locking of the
00152  * PEF.  If you successfully get a configuration (no error), then the
00153  * PEF *will* be locked, and you hold the lock.  You must call either
00154  * ipmi_pef_set_config() or ipmi_pef_clear_lock() to clean up the
00155  * lock.
00156  *
00157  * This allows you to do a read-modify-write operation and blocking
00158  * other operations on the PEF while you are doing this.
00159  */
00160 
00161 /* A full PEF configuration. */
00162 typedef struct ipmi_pef_config_s ipmi_pef_config_t;
00163 
00164 /* Get the full PEF configuration and lock the PEF.  Note that if the
00165    PEF is locked by another, you will get an EAGAIN error in the
00166    callback.  You can retry the operation, or if you are sure that it
00167    is free, you can call ipmi_pef_clear_lock() before retrying.   Note
00168    that the config in the callback *must* be freed by you.*/
00169 typedef void (*ipmi_pef_get_config_cb)(ipmi_pef_t        *pef,
00170                                        int               err,
00171                                        ipmi_pef_config_t *config,
00172                                        void              *cb_data);
00173 int ipmi_pef_get_config(ipmi_pef_t             *pef,
00174                         ipmi_pef_get_config_cb done,
00175                         void                   *cb_data);
00176 
00177 /* Set the full PEF configuration.  The config *MUST* be locked and
00178    the pef must match the PEF that it was fetched with.  Note that a
00179    copy is made of the configuration, so you are free to do whatever
00180    you like with it after this.  Note that this unlocks the config, so
00181    it cannot be used for future set operations. */
00182 int ipmi_pef_set_config(ipmi_pef_t        *pef,
00183                         ipmi_pef_config_t *pefc,
00184                         ipmi_pef_done_cb  done,
00185                         void              *cb_data);
00186 
00187 /* Clear the lock on a PEF.  If the PEF config is non-NULL, then it's
00188    lock is also cleared. */
00189 int ipmi_pef_clear_lock(ipmi_pef_t        *pef,
00190                         ipmi_pef_config_t *pefc,
00191                         ipmi_pef_done_cb  done,
00192                         void              *cb_data);
00193 
00194 /* Free a PEF configuration. */
00195 void ipmi_pef_free_config(ipmi_pef_config_t *config);
00196 
00197 /* This interface lets you fetch and set the data values by parm
00198    num. Note that the parm nums *DO NOT* correspond to the
00199    IPMI_PEFPARM_xxx values above. */
00200 
00201 enum ipmi_pefconf_val_type_e { IPMI_PEFCONFIG_INT, IPMI_PEFCONFIG_BOOL,
00202                                IPMI_PEFCONFIG_DATA, IPMI_PEFCONFIG_STR };
00203 /* When getting the value, the valtype will be set to int or data.  If
00204    it is int or bool, the value is returned in ival and the dval is
00205    not used.  If it is data, the data will be returned in an allocated
00206    array in dval and the length set in dval_len.  The data must be
00207    freed with ipmi_pefconfig_data_free().  The is used for some data
00208    items (the priv level for authentication type, the destination for
00209    alerts and destination addresses); for other items it is ignored.
00210    The index should point to the value to fetch (starting at zero), it
00211    will be updated to the next value or -1 if no more are left.  The
00212    index will be unchanged if the parm does not support an index.
00213 
00214    The string name is returned in the name field, if it is not NULL.
00215 
00216    Note that when fetching a value, if the passed in pointer is NULL
00217    the data will not be filled in (except for index, which must always
00218    be present).  That lets you get the value type without getting the
00219    data, for instance. */
00220 int ipmi_pefconfig_get_val(ipmi_pef_config_t *pefc,
00221                            unsigned int      parm,
00222                            const char        **name,
00223                            int               *index,
00224                            enum ipmi_pefconf_val_type_e *valtype,
00225                            unsigned int      *ival,
00226                            unsigned char     **dval,
00227                            unsigned int      *dval_len);
00228   /* Set a value in the pef config.  You must know ahead of time the
00229      actual value type and set the proper one. */
00230 int ipmi_pefconfig_set_val(ipmi_pef_config_t *pefc,
00231                            unsigned int      parm,
00232                            int               index,
00233                            unsigned int      ival,
00234                            unsigned char     *dval,
00235                            unsigned int      dval_len);
00236 /* If the value is an integer, this can be used to determine if it is
00237    an enumeration and what the values are.  If the parm is not an
00238    enumeration, this will return ENOSYS for the parm.  Otherwise, if
00239    you pass in zero, you will get either the first enumeration value,
00240    or EINVAL if zero is not a valid enumeration, but there are others.
00241    If this returns EINVAL or 0, nval will be set to the next valid
00242    enumeration value, or -1 if val is the last or past the last
00243    enumeration value.  If this returns 0, val will be set to the
00244    string value for the enumeration. */
00245 int ipmi_pefconfig_enum_val(unsigned int parm, int val, int *nval,
00246                             const char **sval);
00247 /* Sometimes array indexes may be enumerations.  This allows the user
00248    to detect if a specific parm's array index is an enumeration, and
00249    to get the enumeration values.  */
00250 int ipmi_pefconfig_enum_idx(unsigned int parm, int idx, const char **sval);
00251 /* Free data from ipmi_pefconfig_get_val(). */
00252 void ipmi_pefconfig_data_free(void *data);
00253 /* Convert a string to a pefconfig parm number.  Returns -1 if the
00254    string is invalid. */
00255 unsigned int ipmi_pefconfig_str_to_parm(char *name);
00256 /* Convert the parm to a string name. */
00257 const char *ipmi_pefconfig_parm_to_str(unsigned int parm);
00258 /* Get the type of a specific parm. */
00259 int ipmi_pefconfig_parm_to_type(unsigned int                 parm,
00260                                 enum ipmi_pefconf_val_type_e *valtype);
00261 
00262 
00263 /*
00264  * Main configuration items for the PEF.
00265  */
00266 unsigned int
00267 ipmi_pefconfig_get_alert_startup_delay_enabled(ipmi_pef_config_t *pefc);
00268 int ipmi_pefconfig_set_alert_startup_delay_enabled(ipmi_pef_config_t *pefc,
00269                                                    unsigned int val);
00270 unsigned int ipmi_pefconfig_get_startup_delay_enabled(ipmi_pef_config_t *pefc);
00271 int ipmi_pefconfig_set_startup_delay_enabled(ipmi_pef_config_t *pefc,
00272                                              unsigned int val);
00273 unsigned int ipmi_pefconfig_get_event_messages_enabled(ipmi_pef_config_t *pefc);
00274 int ipmi_pefconfig_set_event_messages_enabled(ipmi_pef_config_t *pefc,
00275                                               unsigned int val);
00276 unsigned int ipmi_pefconfig_get_pef_enabled(ipmi_pef_config_t *pefc);
00277 int ipmi_pefconfig_set_pef_enabled(ipmi_pef_config_t *pefc, unsigned int val);
00278 unsigned int
00279 ipmi_pefconfig_get_diagnostic_interrupt_enabled(ipmi_pef_config_t *pefc);
00280 int ipmi_pefconfig_set_diagnostic_interrupt_enabled(ipmi_pef_config_t *pefc,
00281                                                     unsigned int val);
00282 unsigned int ipmi_pefconfig_get_oem_action_enabled(ipmi_pef_config_t *pefc);
00283 int ipmi_pefconfig_set_oem_action_enabled(ipmi_pef_config_t *pefc,
00284                                           unsigned int val);
00285 unsigned int ipmi_pefconfig_get_power_cycle_enabled(ipmi_pef_config_t *pefc);
00286 int ipmi_pefconfig_set_power_cycle_enabled(ipmi_pef_config_t *pefc,
00287                                            unsigned int val);
00288 unsigned int ipmi_pefconfig_get_reset_enabled(ipmi_pef_config_t *pefc);
00289 int ipmi_pefconfig_set_reset_enabled(ipmi_pef_config_t *pefc, unsigned int val);
00290 unsigned int ipmi_pefconfig_get_power_down_enabled(ipmi_pef_config_t *pefc);
00291 int ipmi_pefconfig_set_power_down_enabled(ipmi_pef_config_t *pefc,
00292                                           unsigned int val);
00293 unsigned int ipmi_pefconfig_get_alert_enabled(ipmi_pef_config_t *pefc);
00294 int ipmi_pefconfig_set_alert_enabled(ipmi_pef_config_t *pefc, unsigned int val);
00295 int ipmi_pefconfig_get_startup_delay(ipmi_pef_config_t *pefc,
00296                                      unsigned int *val);
00297 int ipmi_pefconfig_set_startup_delay(ipmi_pef_config_t *pefc,
00298                                      unsigned int val);
00299 int ipmi_pefconfig_get_alert_startup_delay(ipmi_pef_config_t *pefc,
00300                                            unsigned int *val);
00301 int ipmi_pefconfig_set_alert_startup_delay(ipmi_pef_config_t *pefc,
00302                                            unsigned int val);
00303 
00304 unsigned int ipmi_pefconfig_get_guid_enabled(ipmi_pef_config_t *pefc);
00305 int ipmi_pefconfig_set_guid_enabled(ipmi_pef_config_t *pefc,
00306                                     unsigned int      val);
00307 int ipmi_pefconfig_get_guid_val(ipmi_pef_config_t *pefc,
00308                                 unsigned char     *data,
00309                                 unsigned int      *data_len);
00310 int ipmi_pefconfig_set_guid_val(ipmi_pef_config_t *pefc,
00311                                 unsigned char     *data,
00312                                 unsigned int      data_len);
00313 
00314 /*
00315  * The following is for the event filter table entries.
00316  *
00317  * NOTE! The event filter table in IPMI is one-based (entry zero is not
00318  * used, entry 1 is the first entry).  This might make Ada programmers
00319  * happy, but to make it so C programmers are not confused, this
00320  * implementation converts it to be zero-based (entry zero *is* the
00321  * first entry)
00322  */
00323 unsigned int ipmi_pefconfig_get_num_event_filters(ipmi_pef_config_t *pefc);
00324 int ipmi_pefconfig_get_enable_filter(ipmi_pef_config_t *pefc,
00325                                      unsigned int      sel,
00326                                      unsigned int      *val);
00327 int ipmi_pefconfig_set_enable_filter(ipmi_pef_config_t *pefc,
00328                                      unsigned int      sel,
00329                                      unsigned int      val);
00330 
00331 /* PEF Filter types */
00332 #define IPMI_PEFPARM_EFT_FILTER_CONFIG_MANUFACTURE_CONFIG 2
00333 #define IPMI_PEFPARM_EFT_FILTER_CONFIG_SOFTWARE_CONFIG 0
00334 
00335 int ipmi_pefconfig_get_filter_type(ipmi_pef_config_t *pefc,
00336                                    unsigned int      sel,
00337                                    unsigned int      *val);
00338 int ipmi_pefconfig_set_filter_type(ipmi_pef_config_t *pefc,
00339                                    unsigned int      sel,
00340                                    unsigned int      val);
00341 
00342 int ipmi_pefconfig_get_diagnostic_interrupt(ipmi_pef_config_t *pefc,
00343                                             unsigned int      sel,
00344                                             unsigned int      *val);
00345 int ipmi_pefconfig_set_diagnostic_interrupt(ipmi_pef_config_t *pefc,
00346                                             unsigned int      sel,
00347                                             unsigned int      val);
00348 
00349 int ipmi_pefconfig_get_oem_action(ipmi_pef_config_t *pefc,
00350                                   unsigned int      sel,
00351                                   unsigned int      *val);
00352 int ipmi_pefconfig_set_oem_action(ipmi_pef_config_t *pefc,
00353                                   unsigned int      sel,
00354                                   unsigned int      val);
00355 
00356 int ipmi_pefconfig_get_power_cycle(ipmi_pef_config_t *pefc,
00357                                    unsigned int      sel,
00358                                    unsigned int      *val);
00359 int ipmi_pefconfig_set_power_cycle(ipmi_pef_config_t *pefc,
00360                                    unsigned int      sel,
00361                                    unsigned int      val);
00362 
00363 int ipmi_pefconfig_get_reset(ipmi_pef_config_t *pefc,
00364                              unsigned int      sel,
00365                              unsigned int      *val);
00366 int ipmi_pefconfig_set_reset(ipmi_pef_config_t *pefc,
00367                              unsigned int      sel,
00368                              unsigned int      val);
00369 
00370 int ipmi_pefconfig_get_power_down(ipmi_pef_config_t *pefc,
00371                                   unsigned int      sel,
00372                                   unsigned int      *val);
00373 int ipmi_pefconfig_set_power_down(ipmi_pef_config_t *pefc,
00374                                   unsigned int      sel,
00375                                   unsigned int      val);
00376 
00377 int ipmi_pefconfig_get_alert(ipmi_pef_config_t *pefc,
00378                              unsigned int      sel,
00379                              unsigned int      *val);
00380 int ipmi_pefconfig_set_alert(ipmi_pef_config_t *pefc,
00381                              unsigned int      sel,
00382                              unsigned int      val);
00383 
00384 int ipmi_pefconfig_get_alert_policy_number(ipmi_pef_config_t *pefc,
00385                                            unsigned int      sel,
00386                                            unsigned int      *val);
00387 int ipmi_pefconfig_set_alert_policy_number(ipmi_pef_config_t *pefc,
00388                                            unsigned int      sel,
00389                                            unsigned int      val);
00390 
00391 /* PEF event severities */
00392 #define IPMI_PEFPARM_EVENT_SEVERITY_UNSPECIFIED         0x00
00393 #define IPMI_PEFPARM_EVENT_SEVERITY_MONITOR             0x01
00394 #define IPMI_PEFPARM_EVENT_SEVERITY_INFORMATION         0x02
00395 #define IPMI_PEFPARM_EVENT_SEVERITY_OK                  0x04
00396 #define IPMI_PEFPARM_EVENT_SEVERITY_NON_CRITICAL        0x08
00397 #define IPMI_PEFPARM_EVENT_SEVERITY_CRITICAL            0x10
00398 #define IPMI_PEFPARM_EVENT_SEVERITY_NON_RECOVERABLE     0x20
00399 int ipmi_pefconfig_get_event_severity(ipmi_pef_config_t *pefc,
00400                                       unsigned int      sel,
00401                                       unsigned int      *val);
00402 int ipmi_pefconfig_set_event_severity(ipmi_pef_config_t *pefc,
00403                                       unsigned int      sel,
00404                                       unsigned int      val);
00405 
00406 int ipmi_pefconfig_get_generator_id_addr(ipmi_pef_config_t *pefc,
00407                                          unsigned int      sel,
00408                                          unsigned int      *val);
00409 int ipmi_pefconfig_set_generator_id_addr(ipmi_pef_config_t *pefc,
00410                                          unsigned int      sel,
00411                                          unsigned int      val);
00412 
00413 int ipmi_pefconfig_get_generator_id_channel_lun(ipmi_pef_config_t *pefc,
00414                                                 unsigned int      sel,
00415                                                 unsigned int      *val);
00416 int ipmi_pefconfig_set_generator_id_channel_lun(ipmi_pef_config_t *pefc,
00417                                                 unsigned int      sel,
00418                                                 unsigned int      val);
00419 
00420 int ipmi_pefconfig_get_sensor_type(ipmi_pef_config_t *pefc,
00421                                    unsigned int      sel,
00422                                    unsigned int      *val);
00423 int ipmi_pefconfig_set_sensor_type(ipmi_pef_config_t *pefc,
00424                                    unsigned int      sel,
00425                                    unsigned int      val);
00426 
00427 int ipmi_pefconfig_get_sensor_number(ipmi_pef_config_t *pefc,
00428                                      unsigned int      sel,
00429                                      unsigned int      *val);
00430 int ipmi_pefconfig_set_sensor_number(ipmi_pef_config_t *pefc,
00431                                      unsigned int      sel,
00432                                      unsigned int      val);
00433 
00434 int ipmi_pefconfig_get_event_trigger(ipmi_pef_config_t *pefc,
00435                                      unsigned int      sel,
00436                                      unsigned int      *val);
00437 int ipmi_pefconfig_set_event_trigger(ipmi_pef_config_t *pefc,
00438                                      unsigned int      sel,
00439                                      unsigned int      val);
00440 
00441 int ipmi_pefconfig_get_data1_offset_mask(ipmi_pef_config_t *pefc,
00442                                          unsigned int      sel,
00443                                          unsigned int      *val);
00444 int ipmi_pefconfig_set_data1_offset_mask(ipmi_pef_config_t *pefc,
00445                                          unsigned int      sel,
00446                                          unsigned int      val);
00447 int ipmi_pefconfig_get_data1_mask(ipmi_pef_config_t *pefc,
00448                                   unsigned int      sel,
00449                                   unsigned int      *val);
00450 int ipmi_pefconfig_set_data1_mask(ipmi_pef_config_t *pefc,
00451                                   unsigned int      sel,
00452                                   unsigned int      val);
00453 int ipmi_pefconfig_get_data1_compare1(ipmi_pef_config_t *pefc,
00454                                       unsigned int      sel,
00455                                       unsigned int      *val);
00456 int ipmi_pefconfig_set_data1_compare1(ipmi_pef_config_t *pefc,
00457                                       unsigned int      sel,
00458                                       unsigned int      val);
00459 int ipmi_pefconfig_get_data1_compare2(ipmi_pef_config_t *pefc,
00460                                       unsigned int      sel,
00461                                       unsigned int      *val);
00462 int ipmi_pefconfig_set_data1_compare2(ipmi_pef_config_t *pefc,
00463                                       unsigned int      sel,
00464                                       unsigned int      val);
00465 
00466 int ipmi_pefconfig_get_data2_mask(ipmi_pef_config_t *pefc,
00467                                   unsigned int      sel,
00468                                   unsigned int      *val);
00469 int ipmi_pefconfig_set_data2_mask(ipmi_pef_config_t *pefc,
00470                                   unsigned int      sel,
00471                                   unsigned int      val);
00472 int ipmi_pefconfig_get_data2_compare1(ipmi_pef_config_t *pefc,
00473                                       unsigned int      sel,
00474                                       unsigned int      *val);
00475 int ipmi_pefconfig_set_data2_compare1(ipmi_pef_config_t *pefc,
00476                                       unsigned int      sel,
00477                                       unsigned int      val);
00478 int ipmi_pefconfig_get_data2_compare2(ipmi_pef_config_t *pefc,
00479                                       unsigned int      sel,
00480                                       unsigned int      *val);
00481 int ipmi_pefconfig_set_data2_compare2(ipmi_pef_config_t *pefc,
00482                                       unsigned int      sel,
00483                                       unsigned int      val);
00484 
00485 int ipmi_pefconfig_get_data3_mask(ipmi_pef_config_t *pefc,
00486                                   unsigned int      sel,
00487                                   unsigned int      *val);
00488 int ipmi_pefconfig_set_data3_mask(ipmi_pef_config_t *pefc,
00489                                   unsigned int      sel,
00490                                   unsigned int      val);
00491 int ipmi_pefconfig_get_data3_compare1(ipmi_pef_config_t *pefc,
00492                                       unsigned int      sel,
00493                                       unsigned int      *val);
00494 int ipmi_pefconfig_set_data3_compare1(ipmi_pef_config_t *pefc,
00495                                       unsigned int      sel,
00496                                       unsigned int      val);
00497 int ipmi_pefconfig_get_data3_compare2(ipmi_pef_config_t *pefc,
00498                                       unsigned int      sel,
00499                                       unsigned int      *val);
00500 int ipmi_pefconfig_set_data3_compare2(ipmi_pef_config_t *pefc,
00501                                       unsigned int      sel,
00502                                       unsigned int      val);
00503 
00504 /*
00505  * Values from the alert policy table.
00506  *
00507  * NOTE! The event filter table in IPMI is one-based (entry zero is not
00508  * used, entry 1 is the first entry).  This might make Ada programmers
00509  * happy, but to make it so C programmers are not confused, this
00510  * implementation converts it to be zero-based (entry zero *is* the
00511  * first entry)
00512  */
00513 unsigned int ipmi_pefconfig_get_num_alert_policies(ipmi_pef_config_t *pefc);
00514 int ipmi_pefconfig_get_policy_num(ipmi_pef_config_t *pefc,
00515                                   unsigned int      sel,
00516                                   unsigned int      *val);
00517 int ipmi_pefconfig_set_policy_num(ipmi_pef_config_t *pefc,
00518                                   unsigned int      sel,
00519                                   unsigned int      val);
00520 int ipmi_pefconfig_get_enabled(ipmi_pef_config_t *pefc,
00521                                unsigned int      sel,
00522                                unsigned int      *val);
00523 int ipmi_pefconfig_set_enabled(ipmi_pef_config_t *pefc,
00524                                unsigned int      sel,
00525                                unsigned int      val);
00526 int ipmi_pefconfig_get_policy(ipmi_pef_config_t *pefc,
00527                               unsigned int      sel,
00528                               unsigned int      *val);
00529 int ipmi_pefconfig_set_policy(ipmi_pef_config_t *pefc,
00530                               unsigned int      sel,
00531                               unsigned int      val);
00532 int ipmi_pefconfig_get_channel(ipmi_pef_config_t *pefc,
00533                                unsigned int      sel,
00534                                unsigned int      *val);
00535 int ipmi_pefconfig_set_channel(ipmi_pef_config_t *pefc,
00536                                unsigned int      sel,
00537                                unsigned int      val);
00538 int ipmi_pefconfig_get_destination_selector(ipmi_pef_config_t *pefc,
00539                                             unsigned int      sel,
00540                                             unsigned int      *val);
00541 int ipmi_pefconfig_set_destination_selector(ipmi_pef_config_t *pefc,
00542                                             unsigned int      sel,
00543                                             unsigned int      val);
00544 int ipmi_pefconfig_get_alert_string_event_specific(ipmi_pef_config_t *pefc,
00545                                                    unsigned int      sel,
00546                                                    unsigned int      *val);
00547 int ipmi_pefconfig_set_alert_string_event_specific(ipmi_pef_config_t *pefc,
00548                                                    unsigned int      sel,
00549                                                    unsigned int      val);
00550 int ipmi_pefconfig_get_alert_string_selector(ipmi_pef_config_t *pefc,
00551                                              unsigned int      sel,
00552                                              unsigned int      *val);
00553 int ipmi_pefconfig_set_alert_string_selector(ipmi_pef_config_t *pefc,
00554                                              unsigned int      sel,
00555                                              unsigned int      val);
00556 
00557 /*
00558  * Values from the alert string keys and alert strings.  Note that
00559  * unlike the other PEF set data, there is a zero value here so the
00560  * numbering matches the numbering in the actual data.
00561  */
00562 unsigned int ipmi_pefconfig_get_num_alert_strings(ipmi_pef_config_t *pefc);
00563 int ipmi_pefconfig_get_event_filter(ipmi_pef_config_t *pefc,
00564                                     unsigned int      sel,
00565                                     unsigned int      *val);
00566 int ipmi_pefconfig_set_event_filter(ipmi_pef_config_t *pefc,
00567                                     unsigned int      sel,
00568                                     unsigned int      val);
00569 int ipmi_pefconfig_get_alert_string_set(ipmi_pef_config_t *pefc,
00570                                         unsigned int      sel,
00571                                         unsigned int      *val);
00572 int ipmi_pefconfig_set_alert_string_set(ipmi_pef_config_t *pefc,
00573                                         unsigned int      sel,
00574                                         unsigned int      val);
00575 int ipmi_pefconfig_get_alert_string(ipmi_pef_config_t *pefc, unsigned int sel,
00576                                     unsigned char *val, unsigned int *len);
00577 int ipmi_pefconfig_set_alert_string(ipmi_pef_config_t *pefc, unsigned int sel,
00578                                     unsigned char *val);
00579 
00580 
00581 /*
00582  * Cruft, don't use
00583  */
00584 int ipmi_pefconfig_get_guid(ipmi_pef_config_t *pefc,
00585                             unsigned int      *enabled,
00586                             unsigned char     *data,
00587                             unsigned int      *data_len);
00588 int ipmi_pefconfig_set_guid(ipmi_pef_config_t *pefc, unsigned int enabled,
00589                             unsigned char *data, unsigned int data_len);
00590 
00591 
00592 #ifdef __cplusplus
00593 }
00594 #endif
00595 
00596 #endif /* _IPMI_PEF_H */

© sourcejam.com 2005-2008