2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * This macros are used by ipmi_sdr_conv_reading. They were taken verbatim from 2N/A * the source for ipmitool (v1.88) 2N/A 0xff000000) >>
24) | \
2N/A * Analog sensor reading data formats 2N/A * "Get SDR Repostiory Info" command. 2N/A * Issue the "Reserve SDR Repository" command. 2N/A * Returns B_TRUE if the repository has changed since the cached copy was last 2N/A * Refresh the cache of sensor data records. 2N/A * Iterate over all existing SDRs and add them to the cache. 2N/A * Extract the name from the record-specific data. 2N/A * This should never happen. It means that the SP has returned 2N/A * a SDR record twice, with the same name and ID. This has 2N/A * been observed on service processors that don't correctly 2N/A * return SDR_LAST during iteration, so assume we've looped in 2N/A * the SDR and return gracefully. 2N/A * Hash routines. We allow lookup by name, but since not all entries have 2N/A * names, we fall back to the entry pointer, which is guaranteed to be unique. 2N/A * The end result is that entities without names cannot be looked up, but will 2N/A * show up during iteration. 2N/A * While it is strange for a service processor to report multiple 2N/A * entries with the same name, we allow it by treating the (name, id) 2N/A * as the unique identifier. When looking up by name, the SDR pointer 2N/A * is NULL, and we return the first matching name. 2N/A * The size of the SDR is contained in the 5th byte of the SDR header, 2N/A * so we'll read the first 5 bytes to get the size, so we know how big 2N/A * to make the buffer. 2N/A * Some SDRs can be bigger than the buffer sizes for a given bmc 2N/A * interface. Therefore we break up the process of reading in an entire 2N/A * SDR into multiple smaller reads. 2N/A * Mostly taken from ipmitool source v1.88 2N/A * This function converts the raw sensor reading returned by 2N/A * ipmi_get_sensor_reading to a unit-based value of type double. 2N/A /* This sensor does not return a numeric reading */