Lines Matching defs:section
99 static int get_sensor_by_name(const rmclomv_cache_section_t *section,
101 static int validate_section_entry(rmclomv_cache_section_t *section,
103 static int add_names_to_section(rmclomv_cache_section_t *section);
104 static void free_section(rmclomv_cache_section_t *section);
106 rmclomv_cache_section_t *section);
597 * Create a cache section structure
616 free_section(rmclomv_cache_section_t *section)
618 size_t len = section->section_len;
619 kmem_free(section, len);
623 * adds supplied section to end of cache chain
627 add_section(rmclomv_cache_section_t **head, rmclomv_cache_section_t *section)
629 section->next_section = *head;
630 *head = section;
713 * The sensor id name is sought in the supplied section and if found
714 * its index within the section is written to *index.
719 get_sensor_by_name(const rmclomv_cache_section_t *section,
724 for (i = 0; i < section->num_entries; i++) {
725 if (strcmp(name, section->entry[i].handle_name.name) == 0) {
1301 validate_section_entry(rmclomv_cache_section_t *section, int index)
1306 for (i = index; i < section->num_entries; i++) {
1307 entry = §ion->entry[i];
1311 entry->handle, section->sensor_type);
1317 entry->handle_name.name, section->sensor_type);
1320 } else if (section->entry[index].handle == entry->handle) {
1323 entry->handle, section->sensor_type);
1325 section->entry[index].handle_name.name) == 0) {
1329 entry->handle, section->sensor_type);
1336 section->num_entries--;
1338 for (i = index; i < section->num_entries; i++) {
1339 section->entry[i] = section->entry[i + 1];
1349 * Populate a section containing handles with corresponding names
1350 * The supplied section structure must not be publically visible and the
1358 add_names_to_section(rmclomv_cache_section_t *section)
1366 for (index = 0; index < section->num_entries; index++) {
1367 entry = §ion->entry[index];
1382 for (index = 0; index < section->num_entries; index++) {
1383 while (validate_section_entry(section, index) == B_FALSE)
1389 section->num_entries, section->sensor_type);
1395 * The supplied (PSU) cache section is traversed and entries are created
1474 * Adjust number of entries value in cache section
1616 rmclomv_cache_section_t *section;
1635 * Reserve space for special additional entries in the FRU section
1667 section = create_cache_section(RMCLOMV_VOLT_SENS,
1670 section->entry[index].handle =
1673 add_section(&my_chain, section);
1682 section = create_cache_section(RMCLOMV_TEMP_SENS,
1685 section->entry[index].handle =
1688 add_section(&my_chain, section);
1696 section = create_cache_section(RMCLOMV_FAN_SENS,
1699 section->entry[index].handle =
1702 add_section(&my_chain, section);
1711 section = create_cache_section(RMCLOMV_AMP_IND,
1714 section->entry[index].handle =
1717 add_section(&my_chain, section);
1725 section = create_cache_section(RMCLOMV_LED_IND,
1728 section->entry[index].handle =
1731 add_section(&my_chain, section);
1744 section = create_cache_section(RMCLOMV_ALARM_IND,
1747 section->entry[index].handle =
1750 add_section(&my_chain, section);
1776 for (section = my_chain;
1777 section != NULL;
1778 section = section->next_section) {
1779 retval = add_names_to_section(section);
1833 rmclomv_cache_section_t *section;
1844 section = rmclomv_find_section(rmclomv_subcache, detector_type);
1847 if ((section == NULL) || (section->num_entries == 0))
1850 env_ind->next_id = section->entry[0].handle_name;
1855 if ((section == NULL) || (get_sensor_by_name(section,
1859 } else if (index + 1 < section->num_entries)
1861 section->entry[index + 1].handle_name;
1870 rmc_psu->handle = section->entry[index].handle;
1871 indicator_mask = section->entry[index].ind_mask;
1986 rmclomv_cache_section_t *section;
2050 ((section = rmclomv_find_section(rmclomv_cache,
2056 if (section->num_entries == 0)
2060 section->entry[0].handle_name;
2065 if (get_sensor_by_name(section, env_sensor.id.name,
2069 } else if (index + 1 < section->num_entries)
2071 section->entry[index + 1].handle_name;
2080 rmc_volts.handle = section->entry[index].handle;
2161 ((section = rmclomv_find_section(rmclomv_cache,
2167 if (section->num_entries == 0)
2171 section->entry[0].handle_name;
2176 if (get_sensor_by_name(section, env_sensor.id.name,
2180 } else if (index + 1 < section->num_entries)
2182 section->entry[index + 1].handle_name;
2191 rmc_temp.handle = section->entry[index].handle;
2248 ((section = rmclomv_find_section(rmclomv_cache,
2254 if (section->num_entries == 0)
2258 section->entry[0].handle_name;
2263 if (get_sensor_by_name(section, env_fan.id.name,
2267 } else if (index + 1 < section->num_entries)
2269 section->entry[index + 1].handle_name;
2278 rmc_fan.handle = section->entry[index].handle;
2340 ((section = rmclomv_find_section(rmclomv_cache,
2347 if (section->num_entries == 0) {
2352 env_ind.next_id = section->entry[0].handle_name;
2357 if (get_sensor_by_name(section, env_ind.id.name,
2363 if (index + 1 < section->num_entries) {
2365 section->entry[index + 1].handle_name;
2383 rmc_ampi.handle = section->entry[index].handle;
2433 ((section = rmclomv_find_section(rmclomv_cache,
2440 * At this point the cache is locked and section points to
2441 * the section relating to hpus.
2446 if (section->num_entries == 0)
2450 section->entry[0].handle_name;
2455 if (get_sensor_by_name(section, env_hpu.id.name,
2459 } else if (index + 1 < section->num_entries)
2461 section->entry[index + 1].handle_name;
2470 rmc_fru.handle = section->entry[index].handle;
2471 special = section->entry[index].ind_mask;
2554 ((section = rmclomv_find_section(rmclomv_cache,
2560 if (section->num_entries == 0)
2564 section->entry[0].handle_name;
2569 if (get_sensor_by_name(section, env_ledinfo.id.name,
2573 } else if (index + 1 < section->num_entries)
2575 section->entry[index + 1].handle_name;
2584 rmc_led.handle = section->entry[index].handle;
2671 ((section = rmclomv_find_section(rmclomv_cache,
2673 (get_sensor_by_name(section, env_ledctl.id.name,
2681 rmc_setled.handle = section->entry[index].handle;
2760 ((section = rmclomv_find_section(rmclomv_cache,
2766 if (section->num_entries == 0)
2770 section->entry[0].handle_name;
2775 if (get_sensor_by_name(section, env_alarminfo.id.name,
2779 } else if (index + 1 < section->num_entries)
2781 section->entry[index + 1].handle_name;
2790 rmc_alarm.handle = section->entry[index].handle;
2865 ((section = rmclomv_find_section(rmclomv_cache,
2867 (get_sensor_by_name(section, env_alarmctl.id.name,
2875 rmc_setalarm.handle = section->entry[index].handle;
3447 rmclomv_cache_section_t *section;
3458 ((section = rmclomv_find_section(rmclomv_cache,
3468 if (index >= section->num_entries)
3471 u_rmc_alarm.handle = section->entry[index].handle;
3513 rmclomv_cache_section_t *section;
3524 ((section = rmclomv_find_section(rmclomv_cache,
3534 if (index >= section->num_entries)
3537 u_rmc_setalarm.handle = section->entry[index].handle;