From 97d6a2e491c6ed08473beb2c4bac47c5cbc1201a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 20 Feb 2016 02:12:40 +0100 Subject: Imported Upstream version 1.8.16 --- lib/ipmi_vita.c | 1012 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1012 insertions(+) create mode 100644 lib/ipmi_vita.c (limited to 'lib/ipmi_vita.c') diff --git a/lib/ipmi_vita.c b/lib/ipmi_vita.c new file mode 100644 index 0000000..3900974 --- /dev/null +++ b/lib/ipmi_vita.c @@ -0,0 +1,1012 @@ +/* + * Copyright (c) 2014 Pigeon Point Systems. All right reserved + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistribution 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 Pigeon Point Systems, or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * This software is provided "AS IS, " without a warranty of any kind. + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. + * PIGEON POINT SYSTEMS ("PPS") AND ITS LICENSORS SHALL NOT BE LIABLE + * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING + * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL + * PPS OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, + * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, + * EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + + +#include +#include +#include +#include +#include +#include + +/* Handled VITA 46.11 commands */ +#define VITA_CMD_HELP 0 +#define VITA_CMD_PROPERTIES 1 +#define VITA_CMD_FRUCONTROL 2 +#define VITA_CMD_ADDRINFO 3 +#define VITA_CMD_ACTIVATE 4 +#define VITA_CMD_DEACTIVATE 5 +#define VITA_CMD_POLICY_GET 6 +#define VITA_CMD_POLICY_SET 7 +#define VITA_CMD_LED_PROP 8 +#define VITA_CMD_LED_CAP 9 +#define VITA_CMD_LED_GET 10 +#define VITA_CMD_LED_SET 11 +#define VITA_CMD_UNKNOWN 255 + +/* VITA 46.11 Site Type strings */ +static struct valstr vita_site_types[] = { + { VITA_FRONT_VPX_MODULE, "Front Loading VPX Plug-In Module" }, + { VITA_POWER_ENTRY, "Power Entry Module" }, + { VITA_CHASSIS_FRU, "Chassic FRU Information Module" }, + { VITA_DEDICATED_CHMC, "Dedicated Chassis Manager" }, + { VITA_FAN_TRAY, "Fan Tray" }, + { VITA_FAN_TRAY_FILTER, "Fan Tray Filter" }, + { VITA_ALARM_PANEL, "Alarm Panel" }, + { VITA_XMC, "XMC" }, + { VITA_VPX_RTM, "VPX Rear Transition Module" }, + { VITA_FRONT_VME_MODULE, "Front Loading VME Plug-In Module" }, + { VITA_FRONT_VXS_MODULE, "Front Loading VXS Plug-In Module" }, + { VITA_POWER_SUPPLY, "Power Supply" }, + { VITA_FRONT_VITA62_MODULE, "Front Loading VITA 62 Module\n" }, + { VITA_71_MODULE, "VITA 71 Module\n" }, + { VITA_FMC, "FMC\n" }, + { 0, NULL } +}; + +/* VITA 46.11 command help strings */ +static struct valstr vita_help_strings[] = { + { + VITA_CMD_HELP, + "VITA commands:\n" + " properties - get VSO properties\n" + " frucontrol - FRU control\n" + " addrinfo - get address information\n" + " activate - activate a FRU\n" + " deactivate - deactivate a FRU\n" + " policy get - get the FRU activation policy\n" + " policy set - set the FRU activation policy\n" + " led prop - get led properties\n" + " led cap - get led color capabilities\n" + " led get - get led state\n" + " led set - set led state" + }, + { + VITA_CMD_FRUCONTROL, + "usage: frucontrol