Lines Matching refs:tag

56 get_tag_size(fru_tagtype_t tag)
58 switch (tag) {
78 fru_tag_t *tag)
81 /* make sure the tag is clear. */
82 tag->raw_data = 0;
91 tag->a.type = FRU_A_ID;
92 tag->a.dense = dense;
93 tag->a.pl_len = pl_len;
100 tag->b.type = FRU_B_ID;
101 tag->b.dense = dense;
102 tag->b.pl_len = pl_len;
109 tag->c.type = FRU_C_ID;
110 tag->c.dense = dense;
111 tag->c.pl_len = pl_len;
118 tag->d.type = FRU_D_ID;
119 tag->d.dense = dense;
120 tag->d.pl_len = pl_len;
127 tag->e.type = FRU_E_ID;
128 tag->e.dense = dense;
129 tag->e.pl_len = pl_len;
136 tag->f.type = FRU_F_ID;
137 tag->f.dense = dense;
138 tag->f.pl_len = pl_len;
145 tag->g.type = FRU_G_ID;
146 tag->g.dense = dense;
147 tag->g.pl_len = pl_len;
159 get_tag_type(fru_tag_t *tag)
165 if (tag->a.type == FRU_A_ID)
168 tmp.raw_data = (tag->byte[0] << 8) | tag->byte[1];
174 tmp32 = (tag->byte[0] << 16) | (tag->byte[1] << 8) | tag->byte[2];
181 tmp32 = (tag->byte[0] << 24) | (tag->byte[1] << 16) |
182 (tag->byte[2] << 8) | tag->byte[3];
187 tmp64 = ((uint64_t)tag->byte[0] << 40) |
188 ((uint64_t)tag->byte[1] << 32) |
189 ((uint64_t)tag->byte[2] << 24) |
190 ((uint64_t)tag->byte[3] << 16) |
191 ((uint64_t)tag->byte[4] << 8) |
192 (uint64_t)tag->byte[5];
202 get_tag_type(fru_tag_t *tag)
204 if (tag->a.type == FRU_A_ID)
206 else if (tag->b.type == FRU_B_ID)
208 else if (tag->c.type == FRU_C_ID)
210 else if (tag->d.type == FRU_D_ID)
212 else if (tag->e.type == FRU_E_ID)
214 else if (tag->f.type == FRU_F_ID)
216 else if (tag->g.type == FRU_G_ID)
226 get_tag_dense(fru_tag_t *tag)
232 tmp = *tag;
233 switch (get_tag_type(tag)) {
235 return (tag->a.dense);
237 tmp.raw_data = (tag->byte[0] << 8) | tag->byte[1];
240 tmp.raw_data = (tag->byte[0] << 8) | tag->byte[1];
243 tmp32 = (tag->byte[0] << 16) | (tag->byte[1] << 8) |
244 tag->byte[2];
248 tmp32 = (tag->byte[0] << 16) | (tag->byte[1] << 8) |
249 tag->byte[2];
253 tmp32 = (tag->byte[0] << 24) | (tag->byte[1] << 16) |
254 (tag->byte[2] << 8) | tag->byte[3];
258 tmp64 = ((uint64_t)tag->byte[0] << 40) |
259 ((uint64_t)tag->byte[1] << 32) |
260 ((uint64_t)tag->byte[2] << 24) |
261 ((uint64_t)tag->byte[3] << 16) |
262 ((uint64_t)tag->byte[4] << 8) |
263 (uint64_t)tag->byte[5];
273 get_tag_dense(fru_tag_t *tag)
275 switch (get_tag_type(tag)) {
277 return (tag->a.dense);
279 return (tag->b.dense);
281 return (tag->c.dense);
283 return (tag->d.dense);
285 return (tag->e.dense);
287 return (tag->f.dense);
289 return (tag->g.dense);
299 get_payload_length(fru_tag_t *tag)
305 tmp = *tag;
306 switch (get_tag_type(tag)) {
308 return (tag->a.pl_len);
310 tmp.raw_data = (tag->byte[0] << 8) | tag->byte[1];
313 tmp.raw_data = (tag->byte[0] << 8) | tag->byte[1];
316 tmp32 = (tag->byte[0] << 16) | (tag->byte[1] << 8) |
317 tag->byte[2];
321 tmp32 = (tag->byte[0] << 16) | (tag->byte[1] << 8) |
322 tag->byte[2];
326 tmp32 = (tag->byte[0] << 24) | (tag->byte[1] << 16) |
327 (tag->byte[2] << 8) | tag->byte[3];
331 tmp64 = ((uint64_t)tag->byte[0] << 40) |
332 ((uint64_t)tag->byte[1] << 32) |
333 ((uint64_t)tag->byte[2] << 24) |
334 ((uint64_t)tag->byte[3] << 16) |
335 ((uint64_t)tag->byte[4] << 8) |
336 (uint64_t)tag->byte[5];
346 get_payload_length(fru_tag_t *tag)
348 switch (get_tag_type(tag)) {
350 return (tag->a.pl_len);
352 return (tag->b.pl_len);
354 return (tag->c.pl_len);
356 return (tag->d.pl_len);
358 return (tag->e.pl_len);
360 return (tag->f.pl_len);
362 return (tag->g.pl_len);