ipmi_sdr.c revision 2eeaed14a5e2ed9bd811643ad5bffc3510ca0310
/*
* 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 <stddef.h>
#include <string.h>
#include <strings.h>
#include "ipmi_impl.h"
typedef struct ipmi_sdr_cache_ent {
char *isc_name;
typedef struct ipmi_cmd_get_sdr {
typedef struct ipmi_rsp_get_sdr {
/*
* "Get SDR Repostiory Info" command.
*/
{
return (NULL);
return (sip);
}
/*
* Issue the "Reserve SDR Repository" command.
*/
static int
{
return (-1);
return (0);
}
/*
* Returns B_TRUE if the repository has changed since the cached copy was last
* referenced.
*/
{
return (B_TRUE);
}
/*
* Refresh the cache of sensor data records.
*/
int
{
char *name;
return (-1);
return (0);
/*
* Iterate over all existing SDRs and add them to the cache.
*/
id = IPMI_SDR_FIRST;
while (id != IPMI_SDR_LAST) {
return (-1);
/*
* Extract the name from the record-specific data.
*/
{
break;
}
{
break;
}
{
break;
}
{
break;
}
case IPMI_SDR_TYPE_EVENT_ONLY:
{
break;
}
{
break;
}
{
break;
}
default:
}
sizeof (ipmi_sdr_cache_ent_t))) == NULL)
return (-1);
return (-1);
}
NULL) {
}
}
}
return (0);
}
/*
* Hash routines. We allow lookup by name, but since not all entries have
* names, we fall back to the entry pointer, which is guaranteed to be unique.
* The end result is that entities without names cannot be looked up, but will
* show up during iteration.
*/
static const void *
ipmi_sdr_hash_convert(const void *p)
{
return (p);
}
static ulong_t
ipmi_sdr_hash_compute(const void *p)
{
const ipmi_sdr_cache_ent_t *ep = p;
else
return (ipmi_hash_ptrhash(ep));
}
static int
ipmi_sdr_hash_compare(const void *a, const void *b)
{
const ipmi_sdr_cache_ent_t *ap = a;
const ipmi_sdr_cache_ent_t *bp = b;
return (-1);
}
int
{
ipmi_sdr_hash_compare)) == NULL)
return (-1);
return (0);
}
void
{
}
}
void
{
}
}
{
int i;
req.ic_gs_offset = 0;
for (i = 0; i < ihp->ih_retries; i++) {
break;
return (NULL);
if (ipmi_sdr_reserve_repository(ihp) != 0)
return (NULL);
}
return (NULL);
return (NULL);
}
}
int
const char *, ipmi_sdr_t *, void *), void *data)
{
int ret;
ipmi_sdr_refresh(ihp) != 0)
return (-1);
return (ret);
}
return (0);
}
{
ipmi_sdr_refresh(ihp) != 0)
return (NULL);
return (NULL);
}
}
static void *
{
return (NULL);
return (NULL);
}
}
{
}
{
}
{
}
{
}