/**************************************************************************** Copyright (c) 2006, Dell Inc All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Dell Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #ifndef __COMMONSUPT_H_INCLUDED__ #define __COMMONSUPT_H_INCLUDED__ /**************************************************************************** SDR attribute definitions ****************************************************************************/ #define SDR_ATTRIBUTE_RECORD_TYPE (0) #define SDR_ATTRIBUTE_TOLERANCE (1) #define SDR_ATTRIBUTE_ACCURACY (2) #define SDR_ATTRIBUTE_OFFSET (3) #define SDR_ATTRIBUTE_MULTIPLIER (4) #define SDR_ATTRIBUTE_EXPONENT (5) #define SDR_ATTRIBUTE_ENTITY_ID (6) #define SDR_ATTRIBUTE_ENTITY_INST (7) #define SDR_ATTRIBUTE_READING_TYPE (8) #define SDR_ATTRIBUTE_SENSOR_TYPE (9) #define SDR_ATTRIBUTE_SHARE_COUNT (10) #define SDR_ATTRIBUTE_SENSOR_OWNER_ID (11) #define SDR_ATTRIBUTE_THRES_READ_MASK (12) #define SDR_ATTRIBUTE_THRES_SET_MASK (13) #define SDR_ATTRIBUTE_OEM_BYTE (14) #define SDR_ATTRIBUTE_SENSOR_NUMBER (15) #define SDR_ATTRIBUTE_SENSOR_UNITS (16) /**************************************************************************** Threshold Sensor calculation ****************************************************************************/ #define CSS_TO_COOKED (1) #define CSS_TO_RAW (2) /**************************************************************************** Common Strng Tables definitions ****************************************************************************/ #define MAX_SENSOR_TYPE_NAMES (45) #define MAX_UNITS_TYPE_NAMES (93) #define MAX_READING_TYPES (13) #define MIN_OEM_READING_TYPES 0x70 #define MAX_OEM_READING_TYPES 0x7F #define OEM_DELL_READING_TYPE 0x7E #define MAX_READING_BIT (16) #define MAX_SEVERITY_TYPE_NAMES (6) #define POST_TABLE_SIZE (19) #ifndef SYSTEM_BBB #define GENERIC_TABLE_SIZE (11) #define SPECIFIC_TABLE_SIZE (31) #else #define GENERIC_TABLE_SIZE (3) #define SPECIFIC_TABLE_SIZE (15) #endif /**************************************************************************** Common Strng Tables Structures ****************************************************************************/ #pragma pack(1) typedef struct _SensorStateText { unsigned char severity; char* state; }SensorStateText; typedef struct _SensorStateElement { unsigned char readingType; unsigned char maxIndex; SensorStateText* pSensorState; }SensorStateElement; typedef struct _AppendStateText { unsigned char assertSeverity; unsigned char deassertSeverity; char* state; }AppendStateText; typedef struct _AppendTableElement { unsigned char readingType; unsigned char maxIndex; AppendStateText* pSensorState; }AppendStateElement; typedef struct _PostCodeType { unsigned char code; char* message; }PostCodeType; typedef struct _longdiv_t { long quot; long rem; } longdiv_t; #pragma pack() /**************************************************************************** Global Variables ****************************************************************************/ extern char* g_SensorTypesTable[]; extern char* g_StatusTable[]; /**************************************************************************** Common Functions ****************************************************************************/ longdiv_t CSSLongDiv( _IN long numerator, _IN long denominator); unsigned char CSSlongToAscii( _IN long value, _INOUT char* buff, _IN int radix); long CSSAsciiToLong( _IN const char *nptr); SDRType *CSSFindEntitySDRRecord( _IN const GETFIRSTSDRFN GetFirstSDR, _IN const GETNEXTSDRFN GetNextSDR, _IN const OEM2IPMISDRFN Oem2IPMISDR, _IN const void* pIPMISDR, _IN void* puserParameter); char *CSSGetSensorTypeStr( _IN unsigned char sensorType, _IN unsigned char readingType); int CSSGetProbeName( _IN IPMISDR* pSdr, _IN unsigned char instance, _INOUT char* probeName, _IN unsigned short size, _IN const OEM2IPMISDRFN Oem2IPMISDR); unsigned char CSSSDRGetAttribute( _IN const void* pSdr, _IN unsigned char param, _IN const OEM2IPMISDRFN Oem2IPMISDR); #endif /* __COMMONSUPT_H_INCLUDED__ */