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

ipmi_pef.h File Reference

#include <OpenIPMI/ipmi_types.h>

Go to the source code of this file.

Defines

#define IPMI_PEF_NAME_LEN   64
#define IPMI_PEFPARM_SET_IN_PROGRESS   0
#define IPMI_PEFPARM_CONTROL   1
#define IPMI_PEFPARM_ACTION_GLOBAL_CONTROL   2
#define IPMI_PEFPARM_STARTUP_DELAY   3
#define IPMI_PEFPARM_ALERT_STARTUP_DELAY   4
#define IPMI_PEFPARM_NUM_EVENT_FILTERS   5
#define IPMI_PEFPARM_EVENT_FILTER_TABLE   6
#define IPMI_PEFPARM_EVENT_FILTER_TABLE_DATA1   7
#define IPMI_PEFPARM_NUM_ALERT_POLICIES   8
#define IPMI_PEFPARM_ALERT_POLICY_TABLE   9
#define IPMI_PEFPARM_SYSTEM_GUID   10
#define IPMI_PEFPARM_NUM_ALERT_STRINGS   11
#define IPMI_PEFPARM_ALERT_STRING_KEY   12
#define IPMI_PEFPARM_ALERT_STRING   13
#define IPMI_PEFPARM_EFT_FILTER_CONFIG_MANUFACTURE_CONFIG   2
#define IPMI_PEFPARM_EFT_FILTER_CONFIG_SOFTWARE_CONFIG   0
#define IPMI_PEFPARM_EVENT_SEVERITY_UNSPECIFIED   0x00
#define IPMI_PEFPARM_EVENT_SEVERITY_MONITOR   0x01
#define IPMI_PEFPARM_EVENT_SEVERITY_INFORMATION   0x02
#define IPMI_PEFPARM_EVENT_SEVERITY_OK   0x04
#define IPMI_PEFPARM_EVENT_SEVERITY_NON_CRITICAL   0x08
#define IPMI_PEFPARM_EVENT_SEVERITY_CRITICAL   0x10
#define IPMI_PEFPARM_EVENT_SEVERITY_NON_RECOVERABLE   0x20

Typedefs

typedef ipmi_pef_s ipmi_pef_t
typedef void(* ipmi_pef_done_cb )(ipmi_pef_t *pef, int err, void *cb_data)
typedef void(* ipmi_pef_ptr_cb )(ipmi_pef_t *pef, void *cb_data)
typedef void(* ipmi_pef_get_cb )(ipmi_pef_t *pef, int err, unsigned char *data, unsigned int data_len, void *cb_data)
typedef ipmi_pef_config_s ipmi_pef_config_t
typedef void(* ipmi_pef_get_config_cb )(ipmi_pef_t *pef, int err, ipmi_pef_config_t *config, void *cb_data)

Enumerations

enum  ipmi_pefconf_val_type_e { IPMI_PEFCONFIG_INT, IPMI_PEFCONFIG_BOOL, IPMI_PEFCONFIG_DATA, IPMI_PEFCONFIG_STR }

Functions

int ipmi_pef_alloc (ipmi_mc_t *mc, ipmi_pef_done_cb done, void *cb_data, ipmi_pef_t **new_pef)
int ipmi_pef_destroy (ipmi_pef_t *pef, ipmi_pef_done_cb handler, void *cb_data)
void ipmi_pef_ref (ipmi_pef_t *pef)
void ipmi_pef_deref (ipmi_pef_t *pef)
void ipmi_pef_iterate_pefs (ipmi_domain_t *domain, ipmi_pef_ptr_cb handler, void *cb_data)
int ipmi_pef_get_parm (ipmi_pef_t *pef, unsigned int parm, unsigned int set, unsigned int block, ipmi_pef_get_cb done, void *cb_data)
int ipmi_pef_set_parm (ipmi_pef_t *pef, unsigned int parm, unsigned char *data, unsigned int data_len, ipmi_pef_done_cb done, void *cb_data)
int ipmi_pef_valid (ipmi_pef_t *pef)
int ipmi_pef_supports_diagnostic_interrupt (ipmi_pef_t *pef)
int ipmi_pef_supports_oem_action (ipmi_pef_t *pef)
int ipmi_pef_supports_power_cycle (ipmi_pef_t *pef)
int ipmi_pef_supports_reset (ipmi_pef_t *pef)
int ipmi_pef_supports_power_down (ipmi_pef_t *pef)
int ipmi_pef_supports_alert (ipmi_pef_t *pef)
unsigned int ipmi_pef_major_version (ipmi_pef_t *pef)
unsigned int ipmi_pef_minor_version (ipmi_pef_t *pef)
unsigned int num_event_filter_table_entries (ipmi_pef_t *pef)
ipmi_mcid_t ipmi_pef_get_mc (ipmi_pef_t *pef)
int ipmi_pef_get_name (ipmi_pef_t *pef, char *name, int length)
int ipmi_pef_get_config (ipmi_pef_t *pef, ipmi_pef_get_config_cb done, void *cb_data)
int ipmi_pef_set_config (ipmi_pef_t *pef, ipmi_pef_config_t *pefc, ipmi_pef_done_cb done, void *cb_data)
int ipmi_pef_clear_lock (ipmi_pef_t *pef, ipmi_pef_config_t *pefc, ipmi_pef_done_cb done, void *cb_data)
void ipmi_pef_free_config (ipmi_pef_config_t *config)
int ipmi_pefconfig_get_val (ipmi_pef_config_t *pefc, unsigned int parm, const char **name, int *index, enum ipmi_pefconf_val_type_e *valtype, unsigned int *ival, unsigned char **dval, unsigned int *dval_len)
int ipmi_pefconfig_set_val (ipmi_pef_config_t *pefc, unsigned int parm, int index, unsigned int ival, unsigned char *dval, unsigned int dval_len)
int ipmi_pefconfig_enum_val (unsigned int parm, int val, int *nval, const char **sval)
int ipmi_pefconfig_enum_idx (unsigned int parm, int idx, const char **sval)
void ipmi_pefconfig_data_free (void *data)
unsigned int ipmi_pefconfig_str_to_parm (char *name)
const char * ipmi_pefconfig_parm_to_str (unsigned int parm)
int ipmi_pefconfig_parm_to_type (unsigned int parm, enum ipmi_pefconf_val_type_e *valtype)
unsigned int ipmi_pefconfig_get_alert_startup_delay_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_alert_startup_delay_enabled (ipmi_pef_config_t *pefc, unsigned int val)
unsigned int ipmi_pefconfig_get_startup_delay_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_startup_delay_enabled (ipmi_pef_config_t *pefc, unsigned int val)
unsigned int ipmi_pefconfig_get_event_messages_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_event_messages_enabled (ipmi_pef_config_t *pefc, unsigned int val)
unsigned int ipmi_pefconfig_get_pef_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_pef_enabled (ipmi_pef_config_t *pefc, unsigned int val)
unsigned int ipmi_pefconfig_get_diagnostic_interrupt_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_diagnostic_interrupt_enabled (ipmi_pef_config_t *pefc, unsigned int val)
unsigned int ipmi_pefconfig_get_oem_action_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_oem_action_enabled (ipmi_pef_config_t *pefc, unsigned int val)
unsigned int ipmi_pefconfig_get_power_cycle_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_power_cycle_enabled (ipmi_pef_config_t *pefc, unsigned int val)
unsigned int ipmi_pefconfig_get_reset_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_reset_enabled (ipmi_pef_config_t *pefc, unsigned int val)
unsigned int ipmi_pefconfig_get_power_down_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_power_down_enabled (ipmi_pef_config_t *pefc, unsigned int val)
unsigned int ipmi_pefconfig_get_alert_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_alert_enabled (ipmi_pef_config_t *pefc, unsigned int val)
int ipmi_pefconfig_get_startup_delay (ipmi_pef_config_t *pefc, unsigned int *val)
int ipmi_pefconfig_set_startup_delay (ipmi_pef_config_t *pefc, unsigned int val)
int ipmi_pefconfig_get_alert_startup_delay (ipmi_pef_config_t *pefc, unsigned int *val)
int ipmi_pefconfig_set_alert_startup_delay (ipmi_pef_config_t *pefc, unsigned int val)
unsigned int ipmi_pefconfig_get_guid_enabled (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_set_guid_enabled (ipmi_pef_config_t *pefc, unsigned int val)
int ipmi_pefconfig_get_guid_val (ipmi_pef_config_t *pefc, unsigned char *data, unsigned int *data_len)
int ipmi_pefconfig_set_guid_val (ipmi_pef_config_t *pefc, unsigned char *data, unsigned int data_len)
unsigned int ipmi_pefconfig_get_num_event_filters (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_get_enable_filter (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_enable_filter (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_filter_type (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_filter_type (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_diagnostic_interrupt (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_diagnostic_interrupt (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_oem_action (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_oem_action (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_power_cycle (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_power_cycle (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_reset (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_reset (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_power_down (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_power_down (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_alert (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_alert (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_alert_policy_number (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_alert_policy_number (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_event_severity (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_event_severity (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_generator_id_addr (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_generator_id_addr (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_generator_id_channel_lun (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_generator_id_channel_lun (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_sensor_type (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_sensor_type (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_sensor_number (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_sensor_number (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_event_trigger (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_event_trigger (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_data1_offset_mask (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_data1_offset_mask (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_data1_mask (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_data1_mask (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_data1_compare1 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_data1_compare1 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_data1_compare2 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_data1_compare2 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_data2_mask (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_data2_mask (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_data2_compare1 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_data2_compare1 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_data2_compare2 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_data2_compare2 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_data3_mask (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_data3_mask (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_data3_compare1 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_data3_compare1 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_data3_compare2 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_data3_compare2 (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
unsigned int ipmi_pefconfig_get_num_alert_policies (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_get_policy_num (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_policy_num (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_enabled (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_enabled (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_policy (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_policy (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_channel (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_channel (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_destination_selector (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_destination_selector (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_alert_string_event_specific (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_alert_string_event_specific (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_alert_string_selector (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_alert_string_selector (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
unsigned int ipmi_pefconfig_get_num_alert_strings (ipmi_pef_config_t *pefc)
int ipmi_pefconfig_get_event_filter (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_event_filter (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_alert_string_set (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int *val)
int ipmi_pefconfig_set_alert_string_set (ipmi_pef_config_t *pefc, unsigned int sel, unsigned int val)
int ipmi_pefconfig_get_alert_string (ipmi_pef_config_t *pefc, unsigned int sel, unsigned char *val, unsigned int *len)
int ipmi_pefconfig_set_alert_string (ipmi_pef_config_t *pefc, unsigned int sel, unsigned char *val)
int ipmi_pefconfig_get_guid (ipmi_pef_config_t *pefc, unsigned int *enabled, unsigned char *data, unsigned int *data_len)
int ipmi_pefconfig_set_guid (ipmi_pef_config_t *pefc, unsigned int enabled, unsigned char *data, unsigned int data_len)


Define Documentation

#define IPMI_PEF_NAME_LEN   64
 

Definition at line 127 of file ipmi_pef.h.

Referenced by for_each_pef_handler(), pef_close_done(), pef_config_get_done(), pef_info(), pef_list_handler(), and pef_new_done().

#define IPMI_PEFPARM_ACTION_GLOBAL_CONTROL   2
 

Definition at line 134 of file ipmi_pef.h.

Referenced by ipmi_pet_create_mc().

#define IPMI_PEFPARM_ALERT_POLICY_TABLE   9
 

Definition at line 141 of file ipmi_pef.h.

Referenced by got_parm(), ipmi_pet_create_mc(), and set_done().

#define IPMI_PEFPARM_ALERT_STARTUP_DELAY   4
 

Definition at line 136 of file ipmi_pef.h.

#define IPMI_PEFPARM_ALERT_STRING   13
 

Definition at line 145 of file ipmi_pef.h.

Referenced by got_parm(), and set_done().

#define IPMI_PEFPARM_ALERT_STRING_KEY   12
 

Definition at line 144 of file ipmi_pef.h.

Referenced by got_parm(), and set_done().

#define IPMI_PEFPARM_CONTROL   1
 

Definition at line 133 of file ipmi_pef.h.

Referenced by ipmi_pet_create_mc().

#define IPMI_PEFPARM_EFT_FILTER_CONFIG_MANUFACTURE_CONFIG   2
 

Definition at line 332 of file ipmi_pef.h.

#define IPMI_PEFPARM_EFT_FILTER_CONFIG_SOFTWARE_CONFIG   0
 

Definition at line 333 of file ipmi_pef.h.

#define IPMI_PEFPARM_EVENT_FILTER_TABLE   6
 

Definition at line 138 of file ipmi_pef.h.

Referenced by got_parm(), ipmi_pet_create_mc(), and set_done().

#define IPMI_PEFPARM_EVENT_FILTER_TABLE_DATA1   7
 

Definition at line 139 of file ipmi_pef.h.

#define IPMI_PEFPARM_EVENT_SEVERITY_CRITICAL   0x10
 

Definition at line 397 of file ipmi_pef.h.

#define IPMI_PEFPARM_EVENT_SEVERITY_INFORMATION   0x02
 

Definition at line 394 of file ipmi_pef.h.

#define IPMI_PEFPARM_EVENT_SEVERITY_MONITOR   0x01
 

Definition at line 393 of file ipmi_pef.h.

#define IPMI_PEFPARM_EVENT_SEVERITY_NON_CRITICAL   0x08
 

Definition at line 396 of file ipmi_pef.h.

#define IPMI_PEFPARM_EVENT_SEVERITY_NON_RECOVERABLE   0x20
 

Definition at line 398 of file ipmi_pef.h.

#define IPMI_PEFPARM_EVENT_SEVERITY_OK   0x04
 

Definition at line 395 of file ipmi_pef.h.

#define IPMI_PEFPARM_EVENT_SEVERITY_UNSPECIFIED   0x00
 

Definition at line 392 of file ipmi_pef.h.

#define IPMI_PEFPARM_NUM_ALERT_POLICIES   8
 

Definition at line 140 of file ipmi_pef.h.

Referenced by got_parm(), and set_done().

#define IPMI_PEFPARM_NUM_ALERT_STRINGS   11
 

Definition at line 143 of file ipmi_pef.h.

Referenced by got_parm(), and set_done().

#define IPMI_PEFPARM_NUM_EVENT_FILTERS   5
 

Definition at line 137 of file ipmi_pef.h.

Referenced by got_parm(), and set_done().

#define IPMI_PEFPARM_SET_IN_PROGRESS   0
 

Definition at line 132 of file ipmi_pef.h.

#define IPMI_PEFPARM_STARTUP_DELAY   3
 

Definition at line 135 of file ipmi_pef.h.

#define IPMI_PEFPARM_SYSTEM_GUID   10
 

Definition at line 142 of file ipmi_pef.h.


Typedef Documentation

typedef struct ipmi_pef_config_s ipmi_pef_config_t
 

Definition at line 162 of file ipmi_pef.h.

typedef void(* ipmi_pef_done_cb)(ipmi_pef_t *pef, int err, void *cb_data)
 

Definition at line 52 of file ipmi_pef.h.

typedef void(* ipmi_pef_get_cb)(ipmi_pef_t *pef, int err, unsigned char *data, unsigned int data_len, void *cb_data)
 

Definition at line 89 of file ipmi_pef.h.

typedef void(* ipmi_pef_get_config_cb)(ipmi_pef_t *pef, int err, ipmi_pef_config_t *config, void *cb_data)
 

Definition at line 169 of file ipmi_pef.h.

typedef void(* ipmi_pef_ptr_cb)(ipmi_pef_t *pef, void *cb_data)
 

Definition at line 57 of file ipmi_pef.h.

typedef struct ipmi_pef_s ipmi_pef_t
 

Definition at line 48 of file ipmi_pef.h.


Enumeration Type Documentation

enum ipmi_pefconf_val_type_e
 

Enumerator:
IPMI_PEFCONFIG_INT 
IPMI_PEFCONFIG_BOOL 
IPMI_PEFCONFIG_DATA 
IPMI_PEFCONFIG_STR 

Definition at line 201 of file ipmi_pef.h.


Function Documentation

int ipmi_pef_alloc ipmi_mc_t mc,
ipmi_pef_done_cb  done,
void *  cb_data,
ipmi_pef_t **  new_pef
 

Definition at line 363 of file pef.c.

References CHECK_MC_LOCK, ipmi_domain_attr_get_data(), ipmi_domain_attr_put(), ipmi_domain_convert_to_id(), ipmi_domain_get_name(), ipmi_domain_get_os_hnd(), ipmi_domain_get_unique_num(), ipmi_domain_register_attribute(), ipmi_mc_convert_to_id(), ipmi_mc_get_domain(), ipmi_mem_alloc(), ipmi_mem_free(), IPMI_PEF_ATTR_NAME, locked_list_add(), ipmi_domain_s::name, opq_alloc(), opq_destroy(), p, pef, pef_attr_destroy(), pef_attr_init(), and pef_start_capability_fetch().

Referenced by pef_new(), pef_unlock_mc(), readpef_mc_handler(), and start_pet_setup().

00367 {
00368     ipmi_pef_t         *pef = NULL;
00369     int                rv = 0;
00370     ipmi_domain_t      *domain = ipmi_mc_get_domain(mc);
00371     locked_list_t      *pefl;
00372     ipmi_domain_attr_t *attr;
00373     int                len, p;
00374 
00375     CHECK_MC_LOCK(mc);
00376 
00377     rv = ipmi_domain_register_attribute(domain, IPMI_PEF_ATTR_NAME,
00378                                         pef_attr_init,
00379                                         pef_attr_destroy,
00380                                         NULL,
00381                                         &attr);
00382     if (rv)
00383         return rv;
00384     pefl = ipmi_domain_attr_get_data(attr);
00385 
00386     pef = ipmi_mem_alloc(sizeof(*pef));
00387     if (!pef) {
00388         rv = ENOMEM;
00389         goto out;
00390     }
00391     memset(pef, 0, sizeof(*pef));
00392 
00393     pef->refcount = 1;
00394     pef->in_list = 1;
00395     pef->mc = ipmi_mc_convert_to_id(mc);
00396     pef->domain = ipmi_domain_convert_to_id(domain);
00397     len = sizeof(pef->name);
00398     p = ipmi_domain_get_name(domain, pef->name, len);
00399     len -= p;
00400     snprintf(pef->name+p, len, ".%d", ipmi_domain_get_unique_num(domain));
00401     pef->os_hnd = ipmi_domain_get_os_hnd(domain);
00402     pef->pef_lock = NULL;
00403     pef->ready_cb = done;
00404     pef->ready_cb_data = cb_data;
00405 
00406     pef->opq = opq_alloc(pef->os_hnd);
00407     if (!pef->opq) {
00408         rv = ENOMEM;
00409         goto out;
00410     }
00411 
00412     if (pef->os_hnd->create_lock) {
00413         rv = pef->os_hnd->create_lock(pef->os_hnd, &pef->pef_lock);
00414         if (rv)
00415             goto out;
00416     }
00417 
00418     if (! locked_list_add(pefl, pef, NULL)) {
00419         rv = ENOMEM;
00420         goto out;
00421     }
00422 
00423  out:
00424     ipmi_domain_attr_put(attr);
00425     if (!rv)
00426         rv = pef_start_capability_fetch(pef, mc);
00427 
00428     if (rv) {
00429         if (pef) {
00430             if (pef->opq)
00431                 opq_destroy(pef->opq);
00432             if (pef->pef_lock)
00433                 pef->os_hnd->destroy_lock(pef->os_hnd, pef->pef_lock);
00434             ipmi_mem_free(pef);
00435         }
00436     } else {
00437         if (new_pef)
00438             *new_pef = pef;
00439     }
00440     return rv;
00441 }

int ipmi_pef_clear_lock ipmi_pef_t pef,
ipmi_pef_config_t pefc,
ipmi_pef_done_cb  done,
void *  cb_data
 

Definition at line 2157 of file pef.c.

References ipmi_mem_alloc(), ipmi_mem_free(), ipmi_pef_set_parm(), lock_cleared(), ipmi_pef_config_s::my_pef, pef_get(), ipmi_pef_config_s::pef_locked, and pef_put().

Referenced by clearpeflock_cmd(), pef_config_unlock(), and pef_unlock_mc_done1().

02161 {
02162     unsigned char data[1];
02163     int           rv;
02164     clear_lock_t  *cl;
02165 
02166     if (pefc) {
02167         if (pefc->my_pef != pef)
02168             return EINVAL;
02169 
02170         if (!pefc->pef_locked)
02171             return EINVAL;
02172     }
02173 
02174     cl = ipmi_mem_alloc(sizeof(*cl));
02175     if (!cl)
02176         return ENOMEM;
02177     cl->done = done;
02178     cl->cb_data = cb_data;
02179 
02180     data[0] = 0; /* Clear the lock. */
02181     pef_get(pef);
02182     rv = ipmi_pef_set_parm(pef, 0, data, 1, lock_cleared, cl);
02183     if (rv) {
02184         pef_put(pef);
02185         ipmi_mem_free(cl);
02186     } else if (pefc) {
02187         pefc->pef_locked = 0;
02188     }
02189 
02190     return rv;
02191 }

void ipmi_pef_deref ipmi_pef_t pef  ) 
 

Definition at line 164 of file pef.c.

References pef_put().

00165 {
00166     pef_put(pef);
00167 }

int ipmi_pef_destroy ipmi_pef_t pef,
ipmi_pef_done_cb  handler,
void *  cb_data
 

Definition at line 493 of file pef.c.

References ipmi_pef_s::destroy_cb_data, ipmi_pef_s::destroy_handler, ipmi_pef_s::destroyed, ipmi_pef_s::domain, ipmi_pef_s::in_list, ipmi_domain_attr_get_data(), ipmi_domain_attr_put(), ipmi_domain_id_find_attribute(), IPMI_PEF_ATTR_NAME, locked_list_remove(), pef_lock(), pef_put(), and pef_unlock().

Referenced by leave(), pef_close(), pef_commited(), pef_op_done(), pef_unlock_mc_done1(), pef_unlock_mc_done2(), pef_unlocked(), readpef_alloc_handler(), and readpef_mc_handler().

00496 {
00497     int                rv;
00498     ipmi_domain_attr_t *attr;
00499     locked_list_t      *pefl;
00500 
00501     pef_lock(pef);
00502     if (pef->in_list) {
00503         pef->in_list = 0;
00504         rv = ipmi_domain_id_find_attribute(pef->domain, IPMI_PEF_ATTR_NAME,
00505                                            &attr);
00506         if (!rv) {
00507             pef_unlock(pef);
00508             pefl = ipmi_domain_attr_get_data(attr);
00509 
00510             locked_list_remove(pefl, pef, NULL);
00511             ipmi_domain_attr_put(attr);
00512             pef_lock(pef);
00513         }
00514     }
00515 
00516     if (pef->destroyed) {
00517         pef_unlock(pef);
00518         return EINVAL;
00519     }
00520     pef->destroyed = 1;
00521     pef_unlock(pef);
00522     pef->destroy_handler = done;
00523     pef->destroy_cb_data = cb_data;
00524     pef_put(pef);
00525     return 0;
00526 }

void ipmi_pef_free_config ipmi_pef_config_t config  ) 
 

Definition at line 2194 of file pef.c.

References ipmi_pef_config_s::alert_strings, ipmi_pef_config_s::apts, ipmi_pef_config_s::asks, ipmi_pef_config_s::efts, i, and ipmi_mem_free().

Referenced by config_destroy_handler(), err_lock_cleared(), got_parm(), ipmi_pef_get_config(), ipmi_pef_set_config(), leave(), lock_done(), pef_config_close(), pef_config_get_done(), readpef_mc_handler(), and set_clear().

02195 {
02196     int i;
02197 
02198     if (pefc->efts)
02199         ipmi_mem_free(pefc->efts);
02200     if (pefc->apts)
02201         ipmi_mem_free(pefc->apts);
02202     if (pefc->asks)
02203         ipmi_mem_free(pefc->asks);
02204     if (pefc->alert_strings) {
02205         for (i=0; i<pefc->num_alert_strings; i++) {
02206             if (pefc->alert_strings[i])
02207                 ipmi_mem_free(pefc->alert_strings[i]);
02208         }
02209         ipmi_mem_free(pefc->alert_strings);
02210     }
02211     ipmi_mem_free(pefc);
02212 }

int ipmi_pef_get_config ipmi_pef_t pef,
ipmi_pef_get_config_cb  done,
void *  cb_data
 

Definition at line 1811 of file pef.c.

References ipmi_mem_alloc(), ipmi_pef_free_config(), ipmi_pef_set_parm(), lock_done(), pef_get(), and pef_put().

Referenced by pef_config_get(), and readpef_alloc_handler().

01814 {
01815     ipmi_pef_config_t *pefc;
01816     int               rv;
01817     unsigned char     data[1];
01818 
01819     pefc = ipmi_mem_alloc(sizeof(*pefc));
01820     if (!pefc)
01821         return ENOMEM;
01822     memset(pefc, 0, sizeof(*pefc));
01823 
01824     pefc->curr_parm = 1;
01825     pefc->curr_sel = 0;
01826     pefc->done = done;
01827     pefc->cb_data = cb_data;
01828     pefc->my_pef = pef;
01829     pefc->lock_supported = 1; /* Assume it works. */
01830 
01831     /* First grab the lock */
01832     data[0] = 1; /* Set in progress. */
01833     pef_get(pef);
01834     rv = ipmi_pef_set_parm(pef, 0, data, 1, lock_done, pefc);
01835     if (rv) {
01836         ipmi_pef_free_config(pefc);
01837         pef_put(pef);
01838     }
01839 
01840     return rv;
01841 }

ipmi_mcid_t ipmi_pef_get_mc ipmi_pef_t pef  ) 
 

Definition at line 924 of file pef.c.

References ipmi_pef_s::mc.

Referenced by pef_info().

00925 {
00926     return pef->mc;
00927 }

int ipmi_pef_get_name ipmi_pef_t pef,
char *  name,
int  length
 

Definition at line 239 of file pef.c.

References ipmi_pef_s::name.

Referenced by for_each_pef_handler(), pef_close(), pef_close_done(), pef_config_get(), pef_config_get_done(), pef_config_set(), pef_config_set_done(), pef_config_unlock(), pef_config_unlock_done(), pef_info(), pef_list_handler(), pef_new_done(), and pef_unlock_mc_done2().

00240 {
00241     int  slen;
00242 
00243     if (length <= 0)
00244         return 0;
00245 
00246     /* Never changes, no lock needed. */
00247     slen = strlen(pef->name);
00248     if (slen == 0) {
00249         if (name)
00250             *name = '\0';
00251         goto out;
00252     }
00253 
00254     if (name) {
00255         memcpy(name, pef->name, slen);
00256         name[slen] = '\0';
00257     }
00258  out:
00259     return slen;
00260 }

int ipmi_pef_get_parm ipmi_pef_t pef,
unsigned int  parm,
unsigned int  set,
unsigned int  block,
ipmi_pef_get_cb  done,
void *  cb_data
 

Definition at line 654 of file pef.c.

References ipmi_pef_s::destroyed, ipmi_log(), IPMI_LOG_ERR_INFO, ipmi_mem_alloc(), ipmi_mem_free(), ipmi_pef_s::opq, opq_new_op(), pef_get(), pef_put(), start_config_fetch(), and ipmi_pef_s::valid.

Referenced by got_parm(), lock_done(), pef_locked(), and pef_next_config().

00660 {
00661     pef_fetch_handler_t *elem;
00662     int                 rv = 0;
00663 
00664     if (pef->destroyed)
00665         return EINVAL;
00666 
00667     if (!pef->valid)
00668         return EINVAL;
00669         
00670     elem = ipmi_mem_alloc(sizeof(*elem));
00671     if (!elem) {
00672         ipmi_log(IPMI_LOG_ERR_INFO,
00673                  "ipmi_pef_get: could not allocate the pef element");
00674         return ENOMEM;
00675     }
00676 
00677     elem->handler = done;
00678     elem->cb_data = cb_data;
00679     elem->pef = pef;
00680     elem->parm = parm;
00681     elem->set = set;
00682     elem->block = block;
00683     elem->rv = 0;
00684 
00685     pef_get(pef);
00686     if (!opq_new_op(pef->opq, start_config_fetch, elem, 0)) {
00687         pef_put(pef);
00688         rv = ENOMEM;
00689     }
00690 
<