Print this page
7491 usr/src/lib/libfru is a mess
Reviewed by: Robert Mustacchi <rm@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/scsi/plugins/ses/SUN/common/sun.c
+++ new/usr/src/lib/scsi/plugins/ses/SUN/common/sun.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
21 21
22 22 /*
23 23 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25
26 26 #include <stddef.h>
27 27 #include <string.h>
28 28 #include <strings.h>
29 29 #include <alloca.h>
30 30 #include <libnvpair.h>
31 +#include <nvfru.h>
31 32
32 33 #include <scsi/libses.h>
33 34 #include <scsi/libses_plugin.h>
34 35 #include <scsi/plugins/ses/framework/libses.h>
35 36 #include <scsi/plugins/ses/vendor/sun.h>
36 37 #include <scsi/plugins/ses/vendor/sun_impl.h>
37 38
38 -#include "../../../../../../lib/libfru/libnvfru/nvfru.h"
39 -
40 39 int
41 40 sun_fruid_parse_common(sun_fru_descr_impl_t *sfdip, nvlist_t *nvl)
42 41 {
43 42 int nverr;
44 43
45 44 SES_NV_ADD(boolean_value, nverr, nvl,
46 45 LIBSES_PROP_FRU, sfdip-> sfdi_fru);
47 46 SES_NV_ADD(uint64, nverr, nvl,
48 47 LIBSES_PROP_PHYS_PARENT, sfdip->sfdi_parent_element_index);
49 48
50 49 return (0);
51 50 }
52 51
53 52 static int
54 53 sun_node_parse(ses_plugin_t *sp, ses_node_t *np)
55 54 {
56 55 switch (ses_node_type(np)) {
57 56 case SES_NODE_ENCLOSURE:
58 57 return (sun_fill_enclosure_node(sp, np));
59 58
60 59 case SES_NODE_AGGREGATE:
61 60 case SES_NODE_ELEMENT:
62 61 return (sun_fill_element_node(sp, np));
63 62
64 63 default:
65 64 return (0);
66 65 }
67 66 }
68 67
69 68 int
70 69 _ses_init(ses_plugin_t *sp)
71 70 {
72 71 ses_plugin_config_t config = {
73 72 .spc_pages = sun_pages,
74 73 .spc_node_parse = sun_node_parse
75 74 };
76 75
77 76 return (ses_plugin_register(sp, LIBSES_PLUGIN_VERSION,
78 77 &config) != 0);
79 78 }
↓ open down ↓ |
30 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX