#include <OpenIPMI/ipmi_types.h>Go to the source code of this file.
|
|
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(). |
|
|
Definition at line 134 of file ipmi_pef.h. Referenced by ipmi_pet_create_mc(). |
|
|
Definition at line 141 of file ipmi_pef.h. Referenced by got_parm(), ipmi_pet_create_mc(), and set_done(). |
|
|
Definition at line 136 of file ipmi_pef.h. |
|
|
Definition at line 145 of file ipmi_pef.h. Referenced by got_parm(), and set_done(). |
|
|
Definition at line 144 of file ipmi_pef.h. Referenced by got_parm(), and set_done(). |
|
|
Definition at line 133 of file ipmi_pef.h. Referenced by ipmi_pet_create_mc(). |
|
|
Definition at line 332 of file ipmi_pef.h. |
|
|
Definition at line 333 of file ipmi_pef.h. |
|
|
Definition at line 138 of file ipmi_pef.h. Referenced by got_parm(), ipmi_pet_create_mc(), and set_done(). |
|
|
Definition at line 139 of file ipmi_pef.h. |
|
|
Definition at line 397 of file ipmi_pef.h. |
|
|
Definition at line 394 of file ipmi_pef.h. |
|
|
Definition at line 393 of file ipmi_pef.h. |
|
|
Definition at line 396 of file ipmi_pef.h. |
|
|
Definition at line 398 of file ipmi_pef.h. |
|
|
Definition at line 395 of file ipmi_pef.h. |
|
|
Definition at line 392 of file ipmi_pef.h. |
|
|
Definition at line 140 of file ipmi_pef.h. Referenced by got_parm(), and set_done(). |
|
|
Definition at line 143 of file ipmi_pef.h. Referenced by got_parm(), and set_done(). |
|
|
Definition at line 137 of file ipmi_pef.h. Referenced by got_parm(), and set_done(). |
|
|
Definition at line 132 of file ipmi_pef.h. |
|
|
Definition at line 135 of file ipmi_pef.h. |
|
|
Definition at line 142 of file ipmi_pef.h. |
|
|
Definition at line 162 of file ipmi_pef.h. |
|
|
Definition at line 52 of file ipmi_pef.h. |
|
|
Definition at line 89 of file ipmi_pef.h. |
|
|
Definition at line 169 of file ipmi_pef.h. |
|
|
Definition at line 57 of file ipmi_pef.h. |
|
|
Definition at line 48 of file ipmi_pef.h. |
|
|
Definition at line 201 of file ipmi_pef.h. 00201 { IPMI_PEFCONFIG_INT, IPMI_PEFCONFIG_BOOL, 00202 IPMI_PEFCONFIG_DATA, IPMI_PEFCONFIG_STR };
|
|
||||||||||||||||||||
|
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 }
|
|
||||||||||||||||||||
|
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 }
|
|
|
Definition at line 164 of file pef.c. References pef_put(). 00165 { 00166 pef_put(pef); 00167 }
|
|
||||||||||||||||
|
|
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 }
|
|
||||||||||||||||
|
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 }
|
|
|
Definition at line 924 of file pef.c. References ipmi_pef_s::mc. Referenced by pef_info(). 00925 { 00926 return pef->mc; 00927 }
|
|
||||||||||||||||
|
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 }
|
|
||||||||||||||||||||||||||||
|
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 < |