/*
* 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
*/
/*
*/
#include <sys/systeminfo.h>
#include <scsi/libsmp_plugin.h>
#include <dlfcn.h>
#include <link.h>
#include <dirent.h>
#include <string.h>
#include <strings.h>
#include <limits.h>
#include "smp_impl.h"
/*
* As part of basic initialization, we always retrieve the REPORT GENERAL
* data so that we will know whether this target supports the long response
* format.
*/
static int
{
return (-1);
return (smp_set_errno(ESMP_REPGEN_FAILED));
}
return (smp_set_errno(ESMP_REPGEN_FAILED));
}
return (0);
}
static int
{
return (-1);
return (smp_set_errno(ESMP_REPGEN_FAILED));
}
if (result != SMP_RES_FUNCTION_ACCEPTED ||
len != sizeof (smp_report_manufacturer_info_resp_t)) {
return (0); /* Not supported */
}
sizeof (rp->srmir_vendor_identification));
sizeof (rp->srmir_product_identification));
sizeof (rp->srmir_product_revision_level));
if (rp->srmir_sas_1_1_format) {
sizeof (rp->srmir_component_vendor_identification));
}
return (smp_set_errno(ESMP_NOMEM));
}
return (0);
}
static int
{
if (smp_report_general(tp) != 0 ||
return (-1);
return (0);
}
const smp_function_def_t *
{
continue;
return (dp);
}
}
return (NULL);
}
int
const smp_plugin_config_t *pcp)
{
if (version != LIBSMP_PLUGIN_VERSION)
return (smp_set_errno(ESMP_VERSION));
return (0);
}
void
{
}
void *
{
}
static void
smp_plugin_cleanstr(char *s)
{
while (*s != '\0') {
if (*s == ' ' || *s == '/')
*s = '-';
s++;
}
}
static void
{
}
static int
{
void *obj;
int (*smp_priority)(void);
return (0);
return (-1);
}
return (0);
}
/*
* Framework modules can establish an explicit prioritying by declaring
* the '_smp_priority' symbol, which returns an integer used to create
* an explicit ordering between plugins.
*/
break;
}
else
return (-1);
return (0);
}
static int
{
#if defined(_LP64)
isa[0] = '\0';
#else
isa[0] = '\0';
#endif
continue;
return (-1);
}
}
}
/*
* Now attempt to load platform-specific plugins. The framework
* plugins had better give us the ability to perform basic SMP
* functions like REPORT GENERAL and REPORT MANUFACTURER INFORMATION;
* if not, we're toast anyway. If the latter is not supported, we
* will not be able to use any vendor-specific plugins. Note that
* there are actually two possible specifications for vendor plugins:
* less specific, so we try to load those first.
*/
if (smp_target_fill(tp) != 0)
return (-1);
return (0);
}
return (-1);
return (-1);
return (-1);
}
return (-1);
return (-1);
return (-1);
return (0);
}
int
{
const char *pluginpath, *p, *q;
for (p = pluginpath; p != NULL; p = q) {
while (*q == ':')
++q;
if (*q == '\0')
q = NULL;
if (len == 0)
continue;
} else {
(void) strcpy(pluginroot, p);
}
if (pluginroot[0] != '/')
continue;
return (-1);
}
return (0);
}
void
{
}
}