/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libipmi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "ipmi_impl.h"
/*
* Extracts bits between index h (high, inclusive) and l (low, exclusive) from
* u, which must be an unsigned integer.
*/
/*
* Error handling
*/
int
{
else
return (-1);
}
int
{
}
/* ARGSUSED */
const char *
{
int i;
const char *str;
break;
}
}
str = "unknown failure";
return (str);
}
/*
* Memory allocation
*/
void *
{
void *ptr;
return (ptr);
}
void *
{
void *ptr;
return (ptr);
}
char *
{
char *ptr;
return (ptr);
}
/* ARGSUSED */
void
{
}
/*
* Translation between #defines and strings.
*/
void
{
return;
}
}
}
void
{
return;
}
}
}
void
{
return;
}
}
}
void
{
if (reading_type == IPMI_RT_SPECIFIC) {
val = sensor_type;
ntp = &ipmi_sensor_type_table[0];
} else {
val = reading_type;
ntp = &ipmi_reading_type_table[0];
}
return;
}
}
if (reading_type == IPMI_RT_SPECIFIC)
else
}
/*
* Converts a BCD decimal value to an integer.
*/
int
{
int ret = 0;
int digit;
int i;
for (i = 7; i >= 0; i--) {
}
return (ret);
}
/*
* See sections 43.15 and 43.16
*
* This is a utility function for decoding the strings that are packed into
* sensor data records. If the type is 6-bit packed ASCII, then it converts
* the string to an 8-bit ASCII string and copies that into the suuplied buffer.
* If it is 8-bit ASCII, it copies the string into the supplied buffer as-is.
*/
void
{
if (len == 0) {
*buf = '\0';
return;
}
/*
* If the type is 8-bit ASCII, we can simply copy the string and return
*/
if (type == 0x3) {
return;
/*
* Yuck - they either used BCD plus encoding, which we don't
* currently handle, or they used an unspecified encoding type.
* In these cases we'll set buf to an empty string. We still
* need to return the length so that we can get to the next
* record.
*/
*buf = '\0';
return;
}
/*
* Otherwise, it's 6-bit packed ASCII, so we have to convert the
* data first
*/
/*
* First we decode the 6-bit string in chunks of 3 bytes as far as
* possible
*/
for (i = 0; i < chunks; i++) {
}
switch (leftovers) {
case 1:
break;
case 2:
break;
}
*buf = '\0';
}