/*
* 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 "libipmi.h"
#include <stddef.h>
#include <strings.h>
#include <stdio.h>
#include <unistd.h>
#include "ipmi_impl.h"
typedef struct ipmi_cmd_sunoem_led_set {
typedef struct ipmi_cmd_sunoem_led_get {
#define IPMI_SUNOEM_LED_TYPE_OK2RM 0
{
}
static int
{
return (-1);
if (!ipmi_is_sun_ilom(devid))
return (0);
}
static int
{
return (-1);
return (0);
}
static int
{
return (-1);
return (0);
}
int
{
if (check_sunoem(ihp) != 0)
return (-1);
}
int
{
if (check_sunoem(ihp) != 0)
return (-1);
}
int
{
if (check_sunoem(ihp) != 0)
return (-1);
return (-1);
if (uptime)
if (gen)
return (0);
}
int
{
if (check_sunoem(ihp) != 0)
return (-1);
case IPMI_SUNOEM_FRU_DIMM:
break;
case IPMI_SUNOEM_FRU_CPU:
break;
case IPMI_SUNOEM_FRU_BIOS:
break;
case IPMI_SUNOEM_FRU_DISK:
break;
}
return (-1);
return (0);
}
int
{
char *curcmd;
int c = 0, i = 0, retry = 0;
int tmp_delay;
char *delay_env;
int max_retries;
if (check_sunoem(ihp) != 0)
return (-1);
if (tmp_delay > 0) {
}
}
/*
* Do some basic input validation
*/
return (-1);
}
/*
* Before we can send the actual command line we want ILOM to execute,
* we have to initiate the transaction. ILOM made a design decision
* that only one CLI transaction can be open at any one time. Therefore
* if we get a response code that indicates a CLI transaction is already
* in progress, we'll return EIPMI_BUSY. Client code can then either
* retry the call, or try the call with force set to B_TRUE, which will
* cause ILOM to cancel any pre-existing transaction. Upon success,
* ILOM will return a 4-byte handle that we'll use for all subsequent
* requests involving this particular command line transaction.
*/
if (force)
else
return (-1);
return (-1);
}
/* Delay, allowing spsh to start on SP */
/*
* Send the command in the POLL on the first poll only.
* All other poll requests will read the data.
* The command literally gets passed to spsh, so we need to tack
* on a carriage-return.
*/
curcmd);
/*
* This loop polls for output from the command. We will break
* out of this loop if any of the following conditions occur:
*
* 1. We get a response with just a null-char in the data field
* (indicating that there is no more output to be read)
*
* 2. We've filled up the caller-supplied buffer. Any
* additional output from the command will be lost.
*
* 3. We were not able to send the command.
*/
/*LINTED*/
while (1) {
/*
* If ILOM spshell isn't ready yet, sending
* the POLL followed by a CLOSE can cause
* the spshell to hang. Therefore retry to
* allow ILOM to respond.
*/
msg_resp =
/* Received valid data */
break;
}
/* Don't send command on next poll */
}
/* Delay, allowing SP to respond */
(void) usleep(SUNOEM_POLL_DELAY);
}
if (retry == max_retries) {
/* Not able to get data, terminate */
break;
}
/*
* caller-supplied buffer was too small, so
* output will be truncated.
*/
olen - i);
break;
}
/* Store the data */
/*
* For all subsequent polls after first. use
* shorter delay.
*/
}
}
/*
* Ok - all done. Send a CLOSE command to close out this transaction
*/
/* Close sent */
break;
}
}
if (retry == max_retries) {
/* Not able to send close */
return (-1);
}
return (0);
}