libipmi.c revision 9113a79cf228b8f7bd509b1328adf88659dfe218
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * CDDL HEADER START
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * The contents of this file are subject to the terms of the
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * Common Development and Distribution License (the "License").
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * You may not use this file except in compliance with the License.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * See the License for the specific language governing permissions
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * and limitations under the License.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * When distributing Covered Code, include this CDDL HEADER in each
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * If applicable, add the following below this CDDL HEADER, with the
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * fields enclosed by brackets "[]" replaced with your own identifying
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * information: Portions Copyright [yyyy] [name of copyright owner]
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * CDDL HEADER END
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * Use is subject to license terms.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim#pragma ident "%Z%%M% %I% %E% SMI"
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim if ((ihp = calloc(sizeof (ipmi_handle_t), 1)) == NULL) {
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim /* /dev/bmc is the only currently available transport */
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim if ((ihp->ih_tdata = ihp->ih_transport->it_open(ihp)) == NULL) {
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * See section 5.2 for a description of the completion codes.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kimstatic struct ipmi_err_conv {
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim { BMC_IPMI_OEM_FAILURE_SENDBMC, EIPMI_SEND_FAILED },
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim (sizeof (ipmi_errtable) / sizeof (ipmi_errtable[0]))
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim if (ihp->ih_transport->it_send(ihp->ih_tdata, cmd, &ihp->ih_response,
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim for (i = 0; i < IPMI_ERROR_COUNT; i++) {