⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rsa_resources.c

📁 HIP 硬件设备管理标准接口
💻 C
📖 第 1 页 / 共 5 页
字号:
/*      -*- linux-c -*- * * (C) Copyright IBM Corp. 2004 * * 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. * * Authors: *      W. David Ashley <dashley@us.ibm.com> *//************************************************************************** * This source file defines the resource arrays declared in rsa_resources.h *************************************************************************/#include <SaHpi.h>#include <rsa_resources.h>/************************************************************************* * RESTRICTIONS!!! * * - If IsThreshold=SAHPI_TRUE for an interpreted sensor,  *   Range.Max.Interpreted.Type must be defined for snmp_rsa.c  *   get_interpreted_thresholds to work. * - Digital controls must be integers and depend on SaHpiStateDigitalT *************************************************************************//************************************************************************* *                   Resource Definitions *************************************************************************/struct snmp_rpt snmp_rsa_rpt_array[] = {	/* Chassis */        {                .rpt = {			.ResourceInfo = {                                .ManufacturerId = 2,                        },                        .ResourceEntity = {                                .Entry[0] =                                {                                        .EntityType = SAHPI_ENT_ROOT,                                        .EntityLocation = 0                                }                        },                        .ResourceCapabilities = SAHPI_CAPABILITY_CONTROL |                                                SAHPI_CAPABILITY_RDR |			                        SAHPI_CAPABILITY_RESOURCE |			                        SAHPI_CAPABILITY_SEL |                                                SAHPI_CAPABILITY_FRU |			                        SAHPI_CAPABILITY_SENSOR,                        .ResourceSeverity = SAHPI_CRITICAL,                },		.rsa_res_info = {                        .mib = {                                .OidHealth = ".1.3.6.1.4.1.2.3.51.1.2.7.1.0",                                .HealthyValue = 255,                                .OidReset = '\0',                                .OidPowerState = '\0',                                .OidPowerOnOff = '\0',                        },                        .event_array = {},		},                .comment = "Chassis"        },        /* CPUs */        {                .rpt = {                        .ResourceInfo = {                                .ManufacturerId = 2,                        },                        .ResourceEntity = {                                .Entry[0] = 				{                                        .EntityType = SAHPI_ENT_PROCESSOR,                                        .EntityLocation = RSA_HPI_INSTANCE_BASE                                },                                {                                        .EntityType = SAHPI_ENT_ROOT,                                        .EntityLocation = 0                                }			},                        .ResourceCapabilities = SAHPI_CAPABILITY_INVENTORY_DATA |			                        SAHPI_CAPABILITY_RESOURCE |			                        SAHPI_CAPABILITY_RDR |                                                SAHPI_CAPABILITY_SENSOR,                        .ResourceSeverity = SAHPI_MAJOR,                 },		.rsa_res_info = {                        .mib = {                                .OidHealth = '\0',                                .HealthyValue = 0,                                .OidReset = '\0',                                .OidPowerState = '\0',                                .OidPowerOnOff = '\0',                        },                        .event_array = {},		},                .comment = "CPUs"        },        /* DASD */        {                .rpt = {                        .ResourceInfo = {                                .ManufacturerId = 2,                        },                        .ResourceEntity = {                                .Entry[0] = 				{                                        .EntityType = SAHPI_ENT_DISK_BAY,                                        .EntityLocation = RSA_HPI_INSTANCE_BASE                                },                                {                                        .EntityType = SAHPI_ENT_ROOT,                                        .EntityLocation = 0                                }			},                        .ResourceCapabilities = SAHPI_CAPABILITY_INVENTORY_DATA |			                        SAHPI_CAPABILITY_RESOURCE |			                        SAHPI_CAPABILITY_RDR |                                                SAHPI_CAPABILITY_SENSOR,                        .ResourceSeverity = SAHPI_MAJOR,                 },		.rsa_res_info = {                        .mib = {                                .OidHealth = '\0',                                .HealthyValue = 0,                                .OidReset = '\0',                                .OidPowerState = '\0',                                .OidPowerOnOff = '\0',                        },                        .event_array = {},		},                .comment = "DASD"        },        /* Fans */        {                .rpt = {                        .ResourceInfo = {                                .ManufacturerId = IBM_MANUFACTURING_ID,                        },                        .ResourceEntity = {                                .Entry[0] =                                {				        .EntityType = SAHPI_ENT_FAN,			                .EntityLocation = RSA_HPI_INSTANCE_BASE				},                                {                                        .EntityType = SAHPI_ENT_ROOT,                                        .EntityLocation = 0                                }			},                        .ResourceCapabilities = SAHPI_CAPABILITY_EVT_DEASSERTS |			                        SAHPI_CAPABILITY_RESOURCE |			                        SAHPI_CAPABILITY_RDR |			                        SAHPI_CAPABILITY_SENSOR,                        .ResourceSeverity = SAHPI_MAJOR,                 },		.rsa_res_info = {			.mib = {				.OidHealth = '\0',				.HealthyValue = 0,				.OidReset = '\0',				.OidPowerState = '\0',				.OidPowerOnOff = '\0',			},			.event_array = {				{},			},		},                .comment = "Fan"        },        {} /* Terminate array with a null element */};/****************************************************************************** *                      Sensor Definitions ******************************************************************************//***************** * Chassis Sensors *****************/struct snmp_rsa_sensor snmp_rsa_chassis_sensors[] = {        /* Main thermal sensor on planar */        {                .sensor = {                        .Num = 1,                        .Type = SAHPI_TEMPERATURE,                        .Category = SAHPI_EC_THRESHOLD,                        .EventCtrl = SAHPI_SEC_GLOBAL_DISABLE,                        /* FIXME:: Change when SNMP adds thresholds */                        .Events = SAHPI_ES_UPPER_MINOR | SAHPI_ES_UPPER_CRIT,                        .Ignore = SAHPI_FALSE,                        .DataFormat = {                                .ReadingFormats = SAHPI_SRF_INTERPRETED,                                .IsNumeric = SAHPI_TRUE,                                .SignFormat = SAHPI_SDF_UNSIGNED,                                .BaseUnits = SAHPI_SU_DEGREES_C,                                .ModifierUnits = SAHPI_SU_UNSPECIFIED,                                .ModifierUse = SAHPI_SMUU_NONE,                                .FactorsStatic = SAHPI_TRUE,                                .Factors = {                                        .Linearization = SAHPI_SL_LINEAR,                                },                                .Percentage = SAHPI_FALSE,                                .Range = {					.Flags = SAHPI_SRF_MAX | SAHPI_SRF_MIN,					.Max = {						.ValuesPresent = SAHPI_SRF_INTERPRETED,						.Interpreted = {							.Type = SAHPI_SENSOR_INTERPRETED_TYPE_FLOAT32,							.Value = {								.SensorFloat32 = 125,							}							},					},					.Min = {						.ValuesPresent = SAHPI_SRF_INTERPRETED,						.Interpreted = {							.Type = SAHPI_SENSOR_INTERPRETED_TYPE_FLOAT32,							.Value = {								.SensorFloat32 = 0,							}							},					},				},                        },                        .ThresholdDefn = {                                 /* FIXME:: SNMP is supposed to add thresholds soon */                                .IsThreshold = SAHPI_FALSE,				.TholdCapabilities = SAHPI_STC_INTERPRETED,                                 /* FIXME:: SNMP is supposed to add thresholds soon */				.ReadThold = SAHPI_STM_UP_MINOR | SAHPI_STM_UP_CRIT,				.FixedThold = SAHPI_STM_UP_MINOR | SAHPI_STM_UP_CRIT,                        },                        .Oem = 0                },		.rsa_sensor_info = {			.cur_state = SAHPI_ES_UNSPECIFIED,			.mib = {				.not_avail_indicator_num = 0,				.write_only = 0,				.convert_snmpstr = SAHPI_SENSOR_INTERPRETED_TYPE_FLOAT32,                                .oid = ".1.3.6.1.4.1.2.3.51.1.2.1.1.1.0",				/* FIXME:: SNMP is supposed to add thresholds soon */				.threshold_oids = {					.InterpretedThresholds = {						.OidUpMinor      = ".1.3.6.1.4.1.2.3.51.1.2.20.1.1.1.1.6.1",						.OidUpCrit       = ".1.3.6.1.4.1.2.3.51.1.2.20.1.1.1.1.4.1",					},				},			},			.event_array = {				{},			},		},                .comment = "Planar ambient temperature in degrees centigrade(C)."        },        /* ASM thermal sensor on planar */        {                .sensor = {                        .Num = 2,                        .Type = SAHPI_TEMPERATURE,                        .Category = SAHPI_EC_THRESHOLD,                        .EventCtrl = SAHPI_SEC_GLOBAL_DISABLE,                        /* FIXME:: Change when SNMP adds thresholds */                        .Events = SAHPI_ES_UPPER_MINOR | SAHPI_ES_UPPER_CRIT,                        .Ignore = SAHPI_FALSE,                        .DataFormat = {                                .ReadingFormats = SAHPI_SRF_INTERPRETED,                                .IsNumeric = SAHPI_TRUE,                                .SignFormat = SAHPI_SDF_UNSIGNED,                                .BaseUnits = SAHPI_SU_DEGREES_C,                                .ModifierUnits = SAHPI_SU_UNSPECIFIED,                                .ModifierUse = SAHPI_SMUU_NONE,                                .FactorsStatic = SAHPI_TRUE,                                .Factors = {                                        .Linearization = SAHPI_SL_LINEAR,                                },                                .Percentage = SAHPI_FALSE,                                .Range = {					.Flags = SAHPI_SRF_MAX | SAHPI_SRF_MIN,					.Max = {						.ValuesPresent = SAHPI_SRF_INTERPRETED,						.Interpreted = {							.Type = SAHPI_SENSOR_INTERPRETED_TYPE_FLOAT32,							.Value = {								.SensorFloat32 = 125,							}							},					},					.Min = {						.ValuesPresent = SAHPI_SRF_INTERPRETED,						.Interpreted = {							.Type = SAHPI_SENSOR_INTERPRETED_TYPE_FLOAT32,							.Value = {								.SensorFloat32 = 0,							}							},					},				},                        },                        .ThresholdDefn = {                                 /* FIXME:: SNMP is supposed to add thresholds soon */                                .IsThreshold = SAHPI_FALSE,				.TholdCapabilities = SAHPI_STC_INTERPRETED,                                 /* FIXME:: SNMP is supposed to add thresholds soon */				.ReadThold = SAHPI_STM_UP_MINOR | SAHPI_STM_UP_CRIT,				.FixedThold = SAHPI_STM_UP_MINOR | SAHPI_STM_UP_CRIT,                        },                        .Oem = 0                },		.rsa_sensor_info = {			.cur_state = SAHPI_ES_UNSPECIFIED,			.mib = {				.not_avail_indicator_num = 0,				.write_only = 0,				.convert_snmpstr = SAHPI_SENSOR_INTERPRETED_TYPE_FLOAT32,                                .oid = ".1.3.6.1.4.1.2.3.51.1.2.1.2.1.0",				/* FIXME:: SNMP is supposed to add thresholds soon */				.threshold_oids = {					.InterpretedThresholds = {						.OidUpMinor      = ".1.3.6.1.4.1.2.3.51.1.2.20.1.1.1.1.6.2",						.OidUpCrit       = ".1.3.6.1.4.1.2.3.51.1.2.20.1.1.1.1.4.2",					},				},			},			.event_array = {				{},			},		},                .comment = "ASM ambient temperature in degrees centigrade(C)."        },        /* CPU area thermal sensor on planar */        {                .sensor = {                        .Num = 3,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -