/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <strings.h>
#include <libgen.h>
#include <cfga_scsi.h>
#define OPL_LOCATOR_OPT 0
char *opl_opts[] = {
"locator",
"led",
"mode",
};
static scfga_ret_t
{
int len;
char *phys_path;
char *strptr;
return (SCFGA_ERR);
}
strptr[0] = '\0';
"%s", (char *)(phys_path));
return (SCFGA_ERR);
}
} else {
return (SCFGA_ERR);
}
return (SCFGA_OK);
}
/*
* Open the SCF driver and use the ioctl interface to set or get the status.
*
* Returns 0 on success. Returns OP_FAILED on error.
*/
static scfga_ret_t
{
int retry = 0;
/* paranoid check */
return (SCFGA_ERR);
}
scf_disk);
/* errstring is set in opl_get_scf_logical_disk */
return (retval);
}
/* Open a file descriptor for the scf driver. */
if (scf_fd < 0) {
return (SCFGA_LIB_ERR);
}
/*
* hdd locator indicator.
*/
errno = 0;
/* Check Retry Error Number */
break;
}
/* Check Retry Times */
break;
}
errno = 0;
(void) sleep(SCFIOCWAIT);
}
return (SCFGA_LIB_ERR);
}
return (SCFGA_OK);
}
/*
* Print the value of the hard disk locator in a human friendly form.
*/
static void
{
return;
}
switch ((int)led) {
case SCF_DISK_LED_ON:
break;
case SCF_DISK_LED_OFF:
mode = LED_MODE_OFF;
break;
case SCF_DISK_LED_BLINK:
mode = LED_MODE_ON;
break;
default:
mode = LED_MODE_UNK;
}
}
/*
* Print the value of the hard disk fault LED in a human friendly form.
*/
static void
{
return;
}
switch ((int)led) {
case SCF_DISK_LED_ON:
mode = LED_MODE_ON;
break;
case SCF_DISK_LED_OFF:
mode = LED_MODE_OFF;
break;
case SCF_DISK_LED_BLINK:
break;
default:
mode = LED_MODE_UNK;
}
}
static scfga_ret_t
const char *mode,
char **errstring,
{
} else {
return (SCFGA_ERR);
}
return (retval);
}
static scfga_ret_t
int print_switch,
char **errstring,
{
return (retval);
}
if (print_switch == OPL_LED_OPT) {
} else {
}
return (SCFGA_OK);
}
static scfga_ret_t
const char *mode,
char **errstring,
{
} else {
return (SCFGA_ERR);
}
return (retval);
}
/*
* The func argument is a string in one of the two following forms:
* led=LED[,mode=MODE]
* locator[=on|off]
* which can generically be thought of as:
* name=value[,name=value]
* So first, split the function based on the comma into two name-value
* pairs.
*/
/*ARGSUSED*/
const char *func,
char **errstring)
{
int opt_locator = 0;
int opt_led = 0;
int opt_mode = 0;
return (SCFGA_ERR);
}
while (*optptr != '\0') {
case OPL_LOCATOR_OPT:
opt_locator++;
break;
case OPL_LED_OPT:
opt_led++;
break;
case OPL_MODE_OPT:
opt_mode++;
mode_value = value;
break;
default:
return (SCFGA_OPNOTSUPP);
break;
}
}
if (!opt_locator && !opt_led) {
return (SCFGA_ERR);
}
if (opt_locator) {
(locator_value &&
return (SCFGA_ERR);
}
/* Options are sane so set or get the locator. */
if (locator_value) {
} else {
}
}
if (opt_led) {
(opt_mode && !mode_value)) {
return (SCFGA_ERR);
}
/* options are sane so go ahead and set or get the led */
if (mode_value != NULL) {
} else {
}
}
return (retval);
}