fac_prov_mptsas.c revision aed5247ff899ec457005d93dfbdb4ffd74574695
/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <limits.h>
#include <alloca.h>
#include <errno.h>
#include <libnvpair.h>
#include <fm/topo_mod.h>
#include "sys/scsi/adapters/mpt_sas/mptsas_ioctl.h"
#define TOPO_METH_MPTSAS_LED_MODE_VERSION 0
topo_instance_t, topo_instance_t, void *, void *);
/*
* mpt_sas facility provider methods
*/
const topo_modinfo_t mptsas_info =
&mptsas_ops };
static const topo_method_t mptsas_fac_methods[] = {
{ "mptsas_led_mode", TOPO_PROP_METH_DESC,
{ NULL }
};
/*ARGSUSED*/
int
{
}
void
{
}
static int
{
int fd;
return (-1);
}
/*
* If there is not presently a target attached for
* does not track LED status for this bay. Assume
* all LEDs are off.
*/
} else {
return (-1);
}
}
return (0);
}
static int
{
__func__);
goto out;
}
}
switch (type) {
case (TOPO_LED_TYPE_SERVICE):
break;
case (TOPO_LED_TYPE_LOCATE):
break;
case (TOPO_LED_TYPE_OK2RM):
break;
default:
type);
}
" properties\n", __func__);
goto out;
}
/*
* Set the LED mode
*/
&ledmode)) != 0) {
goto out;
}
} else {
/*
* Get the LED mode
*/
}
set) != 0) {
goto out;
}
__func__);
goto out;
}
out:
return (ret);
}
/*ARGSUSED*/
static int
{
return (-1);
}
return (0);
}
return (-1);
}