Print this page
7491 usr/src/lib/libfru is a mess
Reviewed by: Robert Mustacchi <rm@joyent.com>


  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 #include <stddef.h>
  27 #include <string.h>
  28 #include <strings.h>
  29 #include <alloca.h>
  30 #include <libnvpair.h>

  31 
  32 #include <scsi/libses.h>
  33 #include <scsi/libses_plugin.h>
  34 #include <scsi/plugins/ses/framework/libses.h>
  35 #include <scsi/plugins/ses/vendor/sun.h>
  36 #include <scsi/plugins/ses/vendor/sun_impl.h>
  37 
  38 #include "../../../../../../lib/libfru/libnvfru/nvfru.h"
  39 
  40 int
  41 sun_fruid_parse_common(sun_fru_descr_impl_t *sfdip, nvlist_t *nvl)
  42 {
  43         int nverr;
  44 
  45         SES_NV_ADD(boolean_value, nverr, nvl,
  46             LIBSES_PROP_FRU, sfdip-> sfdi_fru);
  47         SES_NV_ADD(uint64, nverr, nvl,
  48             LIBSES_PROP_PHYS_PARENT, sfdip->sfdi_parent_element_index);
  49 
  50         return (0);
  51 }
  52 
  53 static int
  54 sun_node_parse(ses_plugin_t *sp, ses_node_t *np)
  55 {
  56         switch (ses_node_type(np)) {
  57         case SES_NODE_ENCLOSURE:
  58                 return (sun_fill_enclosure_node(sp, np));
  59 


  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 #include <stddef.h>
  27 #include <string.h>
  28 #include <strings.h>
  29 #include <alloca.h>
  30 #include <libnvpair.h>
  31 #include <nvfru.h>
  32 
  33 #include <scsi/libses.h>
  34 #include <scsi/libses_plugin.h>
  35 #include <scsi/plugins/ses/framework/libses.h>
  36 #include <scsi/plugins/ses/vendor/sun.h>
  37 #include <scsi/plugins/ses/vendor/sun_impl.h>
  38 


  39 int
  40 sun_fruid_parse_common(sun_fru_descr_impl_t *sfdip, nvlist_t *nvl)
  41 {
  42         int nverr;
  43 
  44         SES_NV_ADD(boolean_value, nverr, nvl,
  45             LIBSES_PROP_FRU, sfdip-> sfdi_fru);
  46         SES_NV_ADD(uint64, nverr, nvl,
  47             LIBSES_PROP_PHYS_PARENT, sfdip->sfdi_parent_element_index);
  48 
  49         return (0);
  50 }
  51 
  52 static int
  53 sun_node_parse(ses_plugin_t *sp, ses_node_t *np)
  54 {
  55         switch (ses_node_type(np)) {
  56         case SES_NODE_ENCLOSURE:
  57                 return (sun_fill_enclosure_node(sp, np));
  58