ipmi_sdr.c revision 9113a79cf228b8f7bd509b1328adf88659dfe218
/*
* 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 2007 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 "ipmi_impl.h"
typedef struct ipmi_cmd_get_sdr {
typedef struct ipmi_rsp_get_sdr {
/*
* Issue the "Reserve SDR Repository" command.
*/
static int
{
return (-1);
return (0);
}
/*
* Refresh the cache of sensor data records.
*/
static int
{
/*
* Free any existing SDRs.
*/
}
/*
* Iterate over all existing SDRs and add them to the cache.
*/
id = IPMI_SDR_FIRST;
while (id != IPMI_SDR_LAST) {
return (-1);
/*
* We currently only understand FRU and generic device records.
*/
continue;
/*
* Create a copy of the SDR-specific data.
*/
return (-1);
break;
return (-1);
break;
}
sizeof (ipmi_sdr_cache_ent_t))) == NULL) {
}
}
return (0);
}
{
int i;
req.ic_gs_offset = 0;
for (i = 0; i < ihp->ih_retries; i++) {
return (NULL);
if (ipmi_sdr_reserve_repository(ihp) != 0)
return (NULL);
}
}
return (NULL);
return (NULL);
}
}
{
ipmi_sdr_refresh(ihp) != 0)
return (NULL);
continue;
}
return (NULL);
}
{
ipmi_sdr_refresh(ihp) != 0)
return (NULL);
continue;
return (ent->isc_generic);
}
return (NULL);
}