/*
* 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
*/
/*
*/
/*
* FMA capability messenger
*
* fdd-msg module is called once when fmd starts up. It does the following
* based on different scenarios
*
* 1. If it's on a x86 platform, fdd-msg module sends fdd running on service
* processor a message (ILOM) which indicates the Solaris host FMA capability.
* 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.
*
* 2. If it's on a Sparc platform, fdd-msg module just exit for now.
*/
#include <errno.h>
#include <stdio.h>
#include <strings.h>
#include <sys/systeminfo.h>
#include <libipmi.h>
#if defined(__x86)
#include <sys/x86_archext.h>
#include <fm/fmd_agent.h>
#include <libnvpair.h>
#endif
#if defined(__x86)
typedef struct cpu_tbl {
char *propname;
} cpu_tbl_t;
{"GenuineIntel", 6, 26, "NHMEP_fma_cap"},
{"GenuineIntel", 6, 46, "NHMEX_fma_cap"},
{"GenuineIntel", 6, 44, "WSMEP_fma_cap"},
{"GenuineIntel", 6, 47, "INTLN_fma_cap"},
};
#endif
static int
{
return (-1);
if (!ipmi_is_sun_ilom(devid))
return (-2);
return (0);
}
#if defined(__x86)
static int32_t
{
char *ven;
return (-1);
return (-1);
}
return (-1);
/*
* There is no mixed CPU type on x86 systems, it's ok to
* just pick the first one
*/
for (i = 0; i < ncpu; i++)
nvlist_free(cpus[i]);
return (-1);
}
for (i = 0; i < ncpu; i++)
nvlist_free(cpus[i]);
return (0);
}
#endif
static uint32_t
{
#if defined(__x86)
int found = 0;
if (fma_cap_cpu_info(&ci) == 0) {
X86_VENDOR_STRLEN) == 0 &&
found++;
break;
}
}
} else {
}
if (found) {
fma_cap);
} else {
#endif
"use default=0x%x", fma_cap);
#if defined(__x86)
}
#endif
return (fma_cap);
}
static void
{
int error;
char *msg;
== NULL) {
/*
* without doing anything.
*/
if (error != EIPMI_BMC_OPEN_FAILED)
"connection: %s\n", msg);
return;
}
/*
* Check if it's Sun ILOM
*/
if (check_sunoem(ipmi_hdl) != 0) {
"Sun ILOM");
return;
}
}
}
/*ARGSUSED*/
static void
{
}
NULL, /* fmdo_recv */
fma_cap_init, /* fmdo_timeout */
NULL, /* fmdo_close */
NULL, /* fmdo_stats */
NULL, /* fmdo_gc */
NULL, /* fmdo_send */
NULL, /* fmdo_topo */
};
};
};
void
{
/*
* For now the module only sends message to ILOM on i386 platforms
* till CR 6933053 is fixed. Module unregister may cause etm module
* core dump due to 6933053.
*/
return;
return;
/*
* Setup the timer.
*/
}
/*ARGSUSED*/
void
{
}