4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
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]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
31 #include <sys/types.h>
37 #if defined(_LITTLE_ENDIAN)
41 unsigned char byte
[8];
112 unsigned pl_len
: 12;
117 unsigned pl_len
: 32;
121 #endif /* LITTLE_ENDIAN */
123 #define FRU_ID_MASK 0xFF
124 #define FRU_A_ID 0x00
125 #define FRU_B_ID 0x02
126 #define FRU_C_ID 0x06
127 #define FRU_D_ID 0x0E
128 #define FRU_E_ID 0x1E
129 #define FRU_F_ID 0x3E
130 #define FRU_G_ID 0x7E
132 typedef enum { FRU_A
= 0x00, FRU_B
= 0x80, FRU_C
= 0xc0,
133 FRU_D
= 0xe0, FRU_E
= 0xf0, FRU_F
= 0xf8,
134 FRU_G
= 0xfc, FRU_X
= 0xfe } fru_tagtype_t
;
135 char *get_tagtype_str(fru_tagtype_t e
);
136 size_t get_tag_size(fru_tagtype_t tag
);
138 /* Returns -1 on error */
139 int mk_tag(fru_tagtype_t type
, uint32_t dense
, size_t pl_len
,
142 fru_tagtype_t
get_tag_type(fru_tag_t
*tag
);
143 uint32_t get_tag_dense(fru_tag_t
*tag
);
144 size_t get_payload_length(fru_tag_t
*tag
);
146 /* Returns 1 if equal, 0 if not */
147 int tags_equal(fru_tag_t t1
, fru_tag_t t2
);
153 #endif /* _FRU_TAG_H */