fdd_msg.c revision dfe4040d6edf92f7d63a1cbac17c5da83512671b
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* fdd messenger
*
* This module sends fdd running on service processor a message which
* indicates the Solaris host FMA capability when fmd is started. The
* message is sent via the BMC driver (KCS interface) to the IPMI stack
* of ILOM using the IPMI Sun OEM core tunnel command. The sub-command
* is CORE_TUNNEL_SUBCMD_HOSTCAP. The IPMI stack posts an host FMA
* capability event to the event manager upon receiving this message.
* fdd subscribes to the event manager for this event. Upon receving
* this event, fdd will adjust its configuration.
*
*/
#include <errno.h>
#include <stdio.h>
#include <strings.h>
#include <sys/systeminfo.h>
#include <libipmi.h>
#define CMD_SUNOEM_CORE_TUNNEL 0x44
#define CORE_TUNNEL_SUBCMD_HOSTFMACAP 2
#define OEM_DATA_LENGTH 3
#define VERSION 0x10
#define HOST_CAPABILITY 2
static int
{
return (-1);
if (!ipmi_is_sun_ilom(devid))
return (-2);
return (0);
}
/*ARGSUSED*/
static void
{
}
}
static const fmd_hdl_ops_t fmd_ops = {
NULL, /* fmdo_recv */
send_fma_cap, /* fmdo_timeout */
NULL, /* fmdo_close */
NULL, /* fmdo_stats */
NULL, /* fmdo_gc */
NULL, /* fmdo_send */
NULL, /* fmdo_topo */
};
static const fmd_prop_t fmd_props[] = {
};
static const fmd_hdl_info_t fmd_info = {
};
void
{
int error;
char *msg;
char isa[8];
/* For now the module only sends message to ILOM on i386 platforms */
return;
return;
== NULL) {
/*
* module without doing anything.
*/
if (error != EIPMI_BMC_OPEN_FAILED)
"connection: %s\n", msg);
"present");
return;
}
/*
* Check if it's Sun ILOM
*/
if (check_sunoem(ipmi_hdl) != 0) {
"Sun ILOM");
return;
}
/*
* Setup the timer.
*/
}
void
{
if (ipmi_hdl) {
}
}