/*
* 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 <libgen.h>
#include <cfga_scsi.h>
#define PLATSES_LOCATOR_OPT 0
char *platses_opts[] = {
"locator",
"led",
"mode",
};
struct info_disk {
};
/* CDB for Additional Element Status diagnositc page(page code:0xa) */
(char)((SCSZ) & 0xff), 0};
/*
* get the status of led from target_disk.
*/
static int
{
led = AMBER_LED_OFF;
} else {
} else {
led = AMBER_LED_ON;
} else {
led = -1;
}
}
}
return (led);
}
/*
* Use ses driver to get all the disks' information.
* Use the information of disk to set or get the LED status.
*
* Returns 0 on success.
*/
static scfga_ret_t
{
int retry = 0;
int i, j;
char *phy_disk_path;
char *wwn_disk;
char *tmp_wwn_disk;
char *obj;
return (SCFGA_ERR);
}
/*
* get the wwn_disk and phys_ses_path from apidp->path
*/
/*
* get the char from w and before ","
* result likes this:500000e1143dbc92
* this is the wwn of disk(sas_address)
*/
/*
* set uscsi command parameter
*/
/*
*/
return (SCFGA_OPNOTSUPP);
}
int nobj;
int hdd_num = 0;
int aes_hdd_num = 0;
char *aes_hdr;
char *aes_tail;
char *aes_desc;
char *slot_elem;
char *phy_desc;
char *sas_addr;
if (ses_fd == -1)
continue;
/*
* count HDD element
*/
continue;
}
continue;
}
continue;
}
for (i = 0; i < nobj; i++) {
hdd_num++;
}
}
if (hdd_num == 0) {
continue;
}
/*
* assgin object id
*/
j = 0;
for (i = 0; i < nobj; i++) {
continue;
}
j++;
}
/*
* get AES diag page by uscsi
*/
errno = 0;
retry = 0;
/* Check Retry Error Number */
break;
}
/* Check Retry Times */
break;
}
errno = 0;
(void) sleep(SESIOCWAIT);
}
continue;
}
/*
* walk AES diag page and get sas_addr
*/
/* aes_len is whole length of AES page */
/*
* check AES descriptor
*/
if (desc_len == 0) {
/* can't walk */
break;
}
/* EIP=1 and PROTOCOL ID=6(SAS) is supported */
if ((aes_desc[0] & 0x10) == 0 ||
continue;
}
/*
* check element
*/
/* DESCRIPTOR TYPE=0(Device Slot) is supported */
/* skip to next AES descriptor */
continue;
}
for (i = 0; i < phy_desc_num; i++) {
"%016llx",
}
aes_hdd_num++;
}
continue;
}
/*
* search sas_addr and get object id
*/
for (i = 0; i < hdd_num; i++) {
if (cmp_rtn == 0) {
break;
}
}
if (cmp_rtn == 0) {
break;
}
}
if (cmp_rtn != 0) {
return (SCFGA_OPNOTSUPP);
}
/*
*/
if (request == SESIOC_SETOBJSTAT) {
(void) memset((void *)&tmp_target_disk, 0,
sizeof (tmp_target_disk));
if (ses_fd < 0) {
phy_ses_path, 0);
return (SCFGA_LIB_ERR);
}
errno = 0;
/* Check Retry Error Number */
break;
}
/* Check Retry Times */
break;
}
errno = 0;
(void) sleep(SESIOCWAIT);
}
}
}
}
/*
* hdd locator indicator.
*/
if (ses_fd < 0) {
return (SCFGA_LIB_ERR);
}
errno = 0;
/* Check Retry Error Number */
break;
}
/* Check Retry Times */
break;
}
errno = 0;
(void) sleep(SESIOCWAIT);
}
return (SCFGA_LIB_ERR);
}
return (SCFGA_OK);
}
/*
* Print the value of the hard disk locator in a human friendly form.
*/
static void
{
return;
}
switch (led) {
case AMBER_LED_ON:
break;
case AMBER_LED_OFF:
mode = LED_MODE_OFF;
break;
case AMBER_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 (led) {
case AMBER_LED_ON:
mode = LED_MODE_ON;
break;
case AMBER_LED_OFF:
mode = LED_MODE_OFF;
break;
case AMBER_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 == PLATSES_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;
char *phy_disk_path;
char *tmp_wwn_disk;
int open_flag = 0;
return (SCFGA_ERR);
}
/*
* check if the ses device is accessible
*/
return (SCFGA_OPNOTSUPP);
}
if (ses_fd != -1) {
open_flag = 1;
}
}
if (open_flag == 0) {
return (SCFGA_OPNOTSUPP);
}
return (SCFGA_OPNOTSUPP);
}
return (SCFGA_ERR);
}
while (*optptr != '\0') {
case PLATSES_LOCATOR_OPT:
opt_locator++;
break;
case PLATSES_LED_OPT:
opt_led++;
break;
case PLATSES_MODE_OPT:
opt_mode++;
mode_value = value;
break;
default:
return (SCFGA_OPNOTSUPP);
break;
}
}
/*
* In cmd, there is no locator or led, return err.
*/
if (!opt_locator && !opt_led) {
return (SCFGA_ERR);
}
/*
* For locator
*/
if (opt_locator) {
(locator_value &&
return (SCFGA_ERR);
}
/* Options are sane so set or get the locator. */
if (locator_value) {
} else {
}
}
if (opt_led) {
(led_value &&
(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);
}