From: Subrata <sub...@us...> - 2008-07-26 04:41:43
|
Update of /cvsroot/ltp/ltp/testcases/open_hpi_testsuite/plugins/rtas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14452/ltp/testcases/open_hpi_testsuite/plugins/rtas Added Files: rtas.h rtas_annunciator.h rtas_control.h rtas_discover.h rtas_event.h rtas_eventlog.h rtas_hotswap.h rtas_indicator.h rtas_inventory.h rtas_power.h rtas_reset.h rtas_resource.h rtas_sensor.h rtas_utils.h rtas_watchdog.h Log Message: Update to OpenHPI 2.12.0 (see www.openhpi.org for more info) --- NEW FILE: rtas_resource.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_RESOURCE_H #define RTAS_RESOURCE_H #include <glib.h> #include <SaHpi.h> SaErrorT rtas_set_resource_tag(void *hnd, SaHpiResourceIdT id, SaHpiTextBufferT *tag); SaErrorT rtas_set_resource_severity(void *hnd, SaHpiResourceIdT id, SaHpiSeverityT sev); #endif --- NEW FILE: rtas_watchdog.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_WATCHDOG_H #define RTAS_WATCHDOG_H #include <glib.h> #include <SaHpi.h> SaErrorT rtas_get_watchdog_info(void *hnd, SaHpiResourceIdT id, SaHpiWatchdogNumT num, SaHpiWatchdogT *wdt); SaErrorT rtas_set_watchdog_info(void *hnd, SaHpiResourceIdT id, SaHpiWatchdogNumT num, SaHpiWatchdogT *wdt); SaErrorT rtas_reset_watchdog(void *hnd, SaHpiResourceIdT id, SaHpiWatchdogNumT num); #endif --- NEW FILE: rtas_power.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_POWER_H #define RTAS_POWER_H #include <glib.h> #include <SaHpi.h> SaErrorT rtas_get_power_state(void *hnd, SaHpiResourceIdT id, SaHpiPowerStateT *state); SaErrorT rtas_set_power_state(void *hnd, SaHpiResourceIdT id, SaHpiPowerStateT state); #endif --- NEW FILE: rtas_discover.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_DISCOVER_H #define RTAS_DISCOVER_H #include <glib.h> #include <SaHpi.h> #include <oh_handler.h> #include <oh_utils.h> #include <oh_error.h> #include <oh_domain.h> #include <rtas_sensor.h> #include <librtas.h> #define LSVPD_CMD "/sbin/lsvpd" /* Enums */ typedef enum rtasSensorTokenEnum { RTAS_SECURITY_SENSOR = 1, RTAS_RESERVED_SENSOR_2, RTAS_THERMAL_SENSOR, RTAS_RESERVED_SENSOR_4, RTAS_RESERVED_SENSOR_5, RTAS_RESERVED_SENSOR_6, RTAS_RESERVED_SENSOR_7, RTAS_RESERVED_SENSOR_8, RTAS_POWER_STATE_SENSOR, RTAS_RESERVED_SENSOR_10, RTAS_RESERVED_SENSOR_11, RTAS_SURVEILLANCE_SENSOR = 9000, RTAS_FAN_SENSOR, RTAS_VOLTAGE_SENSOR, RTAS_CONNECTOR_SENSOR, RTAS_POWER_SUPPLY_SENSOR, RTAS_GIQ_SENSOR, RTAS_SYSTEM_ATTENTION_SENSOR, RTAS_IDENTIFY_INDICATOR_SENSOR, RTAS_RESERVED_SENSOR_9008, RTAS_COMPONENT_RESET_STATE_SENSOR, RTAS_OEM_SPECIFIC_SENSOR_START, RTAS_OEM_SPECIFIC_SENSOR_END = 9999 } rtasSensorToken; /* Function Protos */ SaErrorT rtas_discover_resources(void *hnd); SaErrorT rtas_discover_sensors(struct oh_handler_state *handle, struct oh_event *res_oh_event); SaErrorT rtas_discover_inventory(struct oh_handler_state *handle, struct oh_event *res_oh_event); void populate_rtas_sensor_rec_info(int token, SaHpiSensorRecT *sensor_info); #endif /* RTAS_DISCOVER_H */ --- NEW FILE: rtas_eventlog.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_EVENTLOG_H #define RTAS_EVENTLOG_H #include <glib.h> #include <SaHpi.h> SaErrorT rtas_get_el_info(void *hnd, SaHpiResourceIdT id, SaHpiEventLogInfoT *info); SaErrorT rtas_set_el_time(void *hnd, SaHpiResourceIdT id, SaHpiTimeT time); SaErrorT rtas_add_el_entry(void *hnd, SaHpiResourceIdT id, const SaHpiEventT *Event); SaErrorT rtas_get_el_entry(void *hnd, SaHpiResourceIdT id, SaHpiEventLogEntryIdT current, SaHpiEventLogEntryIdT *prev, SaHpiEventLogEntryIdT *next, SaHpiEventLogEntryT *entry, SaHpiRdrT *rdr, SaHpiRptEntryT *rptentry); SaErrorT rtas_clear_el(void *hnd, SaHpiResourceIdT id); SaErrorT rtas_set_el_state(void *hnd, SaHpiResourceIdT id, SaHpiBoolT e); SaErrorT rtas_reset_el_overflow(void *hnd, SaHpiResourceIdT id); SaErrorT rtas_get_sel_info (void *hnd, SaHpiResourceIdT id, SaHpiEventLogInfoT *evtlog); SaErrorT rtas_set_sel_time (void *hnd, SaHpiResourceIdT id, const SaHpiEventT *evt); SaErrorT rtas_add_sel_entry (void *hnd, SaHpiResourceIdT id, const SaHpiEventT *evt); SaErrorT rtas_get_sel_entry (void *hnd, SaHpiResourceIdT id, SaHpiEventLogEntryIdT current, SaHpiEventLogEntryIdT *prev, SaHpiEventLogEntryIdT *next, SaHpiEventLogEntryT *entry, SaHpiRdrT *rdr, SaHpiRptEntryT *rdtentry); #endif --- NEW FILE: rtas_hotswap.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_HOTSWAP_H #define RTAS_HOTSWAP_H #include <glib.h> #include <SaHpi.h> SaErrorT rtas_get_hotswap_state(void *hnd, SaHpiResourceIdT id, SaHpiHsStateT *state); SaErrorT rtas_set_hotswap_state(void *hnd, SaHpiResourceIdT id, SaHpiHsStateT state); SaErrorT rtas_request_hotswap_action(void *hnd, SaHpiResourceIdT id, SaHpiHsActionT act); #endif --- NEW FILE: rtas_inventory.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_INVENTORY_H #define RTAS_INVENTORY_H #include <glib.h> #include <SaHpi.h> struct oh_rtas_idr_area { SaHpiIdrAreaHeaderT hpi_idr_area; GSList *fields; }; struct oh_rtas_idr { SaHpiIdrInfoT hpi_idr; GSList *areas; }; SaHpiIdrFieldTypeT rtas_get_idr_field_type(char *type); SaHpiIdrAreaTypeT rtas_get_idr_area_type(char *type); SaErrorT rtas_get_idr_info(void *hnd, SaHpiResourceIdT rid, SaHpiIdrIdT idrid, SaHpiIdrInfoT *idrinfo); SaErrorT rtas_get_idr_area_header(void *hnd, SaHpiResourceIdT rid, SaHpiIdrIdT idrid, SaHpiIdrAreaTypeT areatype, SaHpiEntryIdT areaid, SaHpiEntryIdT *nextareaid, SaHpiIdrAreaHeaderT *header); SaErrorT rtas_add_idr_area(void *hnd, SaHpiResourceIdT rid, SaHpiIdrIdT idrid, SaHpiIdrAreaTypeT areatype, SaHpiEntryIdT *areaid); SaErrorT rtas_del_idr_area(void *hnd, SaHpiResourceIdT rid, SaHpiIdrIdT idrid, SaHpiEntryIdT areaid); SaErrorT rtas_get_idr_field(void *hnd, SaHpiResourceIdT rid, SaHpiIdrIdT idrid, SaHpiEntryIdT areaid, SaHpiIdrFieldTypeT fieldtype, SaHpiEntryIdT fieldid, SaHpiEntryIdT *nextfieldid, SaHpiIdrFieldT *field); SaErrorT rtas_add_idr_field(void *hnd, SaHpiResourceIdT rid, SaHpiIdrIdT idrid, SaHpiIdrFieldT *field); SaErrorT rtas_set_idr_field(void *hnd, SaHpiResourceIdT rid, SaHpiIdrIdT idrid, SaHpiIdrFieldT *field); SaErrorT rtas_del_idr_field(void *hnd, SaHpiResourceIdT rid, SaHpiIdrIdT idrid, SaHpiEntryIdT areaid, SaHpiEntryIdT fieldid); #endif --- NEW FILE: rtas_annunciator.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_ANNUNCIATOR_H #define RTAS_ANNUNCIATOR_H #include <glib.h> #include <SaHpi.h> SaErrorT rtas_get_next_announce(void *hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiSeverityT sev, SaHpiBoolT unack, SaHpiAnnouncementT *a); SaErrorT rtas_get_announce(void *hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiEntryIdT aid, SaHpiAnnouncementT *a); SaErrorT rtas_ack_announce(void *hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiEntryIdT aid, SaHpiSeverityT sev); SaErrorT rtas_add_announce(void *hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiAnnouncementT *a); SaErrorT rtas_del_announce(void *hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiEntryIdT aid, SaHpiSeverityT sev); SaErrorT rtas_get_annunc_mode(void *hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiAnnunciatorModeT *mode); SaErrorT rtas_set_annunc_mode(void *hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiAnnunciatorModeT mode); #endif --- NEW FILE: rtas_sensor.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_SENSOR_H #define RTAS_SENSOR_H #include <glib.h> #include <SaHpi.h> #include <oh_handler.h> #include <oh_utils.h> #include <oh_error.h> #include <oh_domain.h> #include <librtas.h> #define RTAS_SENSORS_PATH "/proc/device-tree/rtas/rtas-sensors" #define RTAS_SENSOR_LOCATION "/proc/device-tree/rtas/ibm,sensor-" #define MAX_SENSOR_LOCATION_STRING_SIZE 24 #define MILLISECONDS_PER_MINUTE 1000 #define TOKEN_MASK 0xFFFFFFF0 #define TIME_MASK ~TOKEN_MASK typedef enum rtasSensorStateEnum { SENSOR_OK = 0, SENSOR_CRITICAL_LOW = 9, SENSOR_WARNING_LOW = 10, SENSOR_NORMAL = 11, SENSOR_WARNING_HIGH = 12, SENSOR_CRITICAL_HIGH = 13 }rtasSensorState; struct SensorInfo { SaHpiUint32T token; SaHpiUint32T index; SaHpiBoolT enabled; SaHpiEventStateT current_state; SaHpiUint32T current_val; char sensor_location[MAX_SENSOR_LOCATION_STRING_SIZE]; }; /* Function Protos */ SaErrorT rtas_get_sensor_reading(void *handler, SaHpiResourceIdT resourceid, SaHpiSensorNumT sensornum, SaHpiSensorReadingT *reading, SaHpiEventStateT *e_state); SaErrorT rtas_get_sensor_thresholds(void *handler, SaHpiResourceIdT resourceid, SaHpiSensorNumT sensornum, SaHpiSensorThresholdsT *thresholds); SaErrorT rtas_set_sensor_thresholds(void *handler, SaHpiResourceIdT resourceid, SaHpiSensorNumT sensornum, const SaHpiSensorThresholdsT *thresholds); SaErrorT rtas_get_sensor_enable(void *hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, SaHpiBoolT *enable); SaErrorT rtas_set_sensor_enable(void *hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, SaHpiBoolT enable); SaErrorT rtas_get_sensor_event_enables(void *hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, SaHpiBoolT *enables); SaErrorT rtas_set_sensor_event_enables(void *hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, const SaHpiBoolT enables); SaErrorT rtas_get_sensor_event_masks(void *hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, SaHpiEventStateT *AssertEventMask, SaHpiEventStateT *DeassertEventMask); SaErrorT rtas_set_sensor_event_masks(void *hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, SaHpiSensorEventMaskActionT act, SaHpiEventStateT AssertEventMask, SaHpiEventStateT DeassertEventMask); SaErrorT rtas_get_sensor_event_enabled(void *hnd, SaHpiResourceIdT id, SaHpiSensorNumT sensornum, SaHpiBoolT *enable); SaErrorT rtas_set_sensor_event_enabled(void *hnd, SaHpiResourceIdT id, SaHpiSensorNumT sensornum, SaHpiBoolT *enable); int rtas_get_sensor_location_code(int token, int index, char *buffer); #endif --- NEW FILE: rtas_control.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_CONTROL_H #define RTAS_CONTROL_H #include <glib.h> #include <SaHpi.h> SaErrorT rtas_get_control_state(void *hnd, SaHpiResourceIdT id, SaHpiCtrlNumT num, SaHpiCtrlModeT *mode, SaHpiCtrlStateT *state); SaErrorT rtas_set_control_state(void *hnd, SaHpiResourceIdT id, SaHpiCtrlNumT num, SaHpiCtrlModeT mode, SaHpiCtrlStateT *state); SaErrorT rtas_control_parm(void *hnd, SaHpiResourceIdT id, SaHpiParmActionT act); #endif --- NEW FILE: rtas_event.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_EVENT_H #define RTAS_EVENT_H #include <glib.h> #include <oh_handler.h> #include <SaHpi.h> #include <oh_error.h> SaErrorT rtas_get_event(void *hnd); #endif --- NEW FILE: rtas_indicator.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_INDICATOR_H #define RTAS_INDICATOR_H #include <glib.h> #include <SaHpi.h> SaErrorT rtas_get_indicator_state(void *hnd, SaHpiResourceIdT id, SaHpiHsIndicatorStateT *state); SaErrorT rtas_set_indicator_state(void *hnd, SaHpiResourceIdT id, SaHpiHsIndicatorStateT state); #endif --- NEW FILE: rtas.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> */ #ifndef RTAS_H #define RTAS_H #include <glib.h> #include <SaHpi.h> #include <oh_handler.h> #include <oh_utils.h> #include <oh_error.h> void *rtas_open(GHashTable *handler_config, unsigned int hid, oh_evt_queue *eventq); void rtas_close(void *hnd); #endif /* _OH_RTAS_H */ --- NEW FILE: rtas_reset.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_RESET_H #define RTAS_RESET_H #include <glib.h> #include <SaHpi.h> SaErrorT rtas_get_reset_state(void *hnd, SaHpiResourceIdT id, SaHpiResetActionT *act); SaErrorT rtas_set_reset_state(void *hnd, SaHpiResourceIdT id, SaHpiResetActionT act); #endif --- NEW FILE: rtas_utils.h --- /* -*- linux-c -*- * * (C) Copyright IBM Corp. 2005 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This * file and program are licensed under a BSD style license. See * the Copying file included with the OpenHPI distribution for * full licensing terms. * * Author(s): * Renier Morales <re...@op...> * Daniel de Araujo <dde...@us...> */ #ifndef RTAS_UTILS_H #define RTAS_UTILS_H #include <glib.h> #include <SaHpi.h> #include <oh_handler.h> #include <oh_utils.h> #include <oh_error.h> #include <oh_domain.h> #include <librtas.h> void decode_rtas_error (int error, char *buf, size_t size, int token, int index); #endif /* RTAS_UTILS_H */ |