Mercurial > illumos > illumos-gate
changeset 12315:e8f2d0caeb31
6944254 libipmi: need interface for issuing the CHASSIS IDENTIFY command
author | Robert Johnston <Robert.Johnston@Sun.COM> |
---|---|
date | Wed, 05 May 2010 12:43:42 -0700 |
parents | 0ed71edeac88 |
children | 69d4c3b671ec |
files | usr/src/lib/libipmi/common/ipmi_misc.c usr/src/lib/libipmi/common/libipmi.h |
diffstat | 2 files changed, 36 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/lib/libipmi/common/ipmi_misc.c Wed May 05 10:23:23 2010 -0700 +++ b/usr/src/lib/libipmi/common/ipmi_misc.c Wed May 05 12:43:42 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <libipmi.h> @@ -193,3 +192,33 @@ return (rsp->ic_data); } + +/* + * IPMI Chassis Identify Command + * See Section 28.5 + */ +int +ipmi_chassis_identify(ipmi_handle_t *ihp, boolean_t enable) +{ + ipmi_cmd_t cmd; + uint8_t msg_data[2]; + + if (enable) { + msg_data[0] = 0; + msg_data[1] = 1; + } else { + msg_data[0] = 0; + msg_data[1] = 0; + } + + cmd.ic_netfn = IPMI_NETFN_CHASSIS; + cmd.ic_cmd = IPMI_CMD_CHASSIS_IDENTIFY; + cmd.ic_data = msg_data; + cmd.ic_dlen = sizeof (msg_data); + cmd.ic_lun = 0; + + if (ipmi_send(ihp, &cmd) == NULL) + return (-1); + + return (0); +}
--- a/usr/src/lib/libipmi/common/libipmi.h Wed May 05 10:23:23 2010 -0700 +++ b/usr/src/lib/libipmi/common/libipmi.h Wed May 05 12:43:42 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _LIBIPMI_H @@ -53,6 +52,7 @@ /* * Basic netfn definitions. See section 5.1. */ +#define IPMI_NETFN_CHASSIS BMC_NETFN_CHASSIS #define IPMI_NETFN_APP BMC_NETFN_APP #define IPMI_NETFN_STORAGE BMC_NETFN_STORAGE #define IPMI_NETFN_SE BMC_NETFN_SE @@ -1847,6 +1847,9 @@ int ipmi_sunoem_update_fru(ipmi_handle_t *, ipmi_sunoem_fru_t *); +#define IPMI_CMD_CHASSIS_IDENTIFY 0x04 +int ipmi_chassis_identify(ipmi_handle_t *, boolean_t); + #pragma pack() #ifdef __cplusplus