Lines Matching +full:tp +full:- +full:link

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
31 * Code cleanup, bug-fix and extension
57 {"Long link to next chain for CardBus", CIS_LONGLINK_CB, LENGTH_ANY},
61 {"Long link to next chain for MFC", CIS_LONGLINK_MFC, LENGTH_ANY},
64 {"Long link to attribute memory", CIS_LONGLINK_A, 4},
65 {"Long link to common memory", CIS_LONGLINK_C, 4},
66 {"Link target", CIS_LINKTARGET, 3},
67 {"No link", CIS_NOLINK, 0},
118 * free_cis - delete cis entry.
124 struct tuple *tp; in freecis() local
127 tlist = tl->next; in freecis()
128 while ((tp = tl->tuples) != 0) { in freecis()
129 tl->tuples = tp->next; in freecis()
130 free(tp->data); in freecis()
131 free(tp); in freecis()
176 * - Read tuples at attribute memory, offset 0.
177 * - If a CIS_END is the first tuple, look for
180 * - If a long link tuple was encountered, execute the long
181 * link.
182 * - If a no-link tuple was seen, terminate processing.
183 * - If no no-link tuple exists, and no long link tuple
186 * - If a long link tuple is found in any list, then process
187 * it. Only one link is allowed per list.
195 struct tuple *tp; in read_tuples() local
205 tp = find_tuple_in_list(last_tl, CIS_LONGLINK_A); in read_tuples()
206 if (tp == NULL) { in read_tuples()
208 tp = find_tuple_in_list(last_tl, CIS_LONGLINK_C); in read_tuples()
211 if (tp == NULL || tp->length != 4) in read_tuples()
214 offs = (uint32_t)tpl32(tp->data); in read_tuples()
216 printf("Checking long link at %zd (%s memory)\n", in read_tuples()
220 * If a link was found, it looks sane read the tuple list from it. in read_tuples()
224 last_tl->next = tl; in read_tuples()
237 printf("Reading long link at 0 (Common memory)\n"); in read_tuples()
239 tlist->next = read_one_tuplelist(fd, 0, 0); in read_tuples()
250 struct tuple *tp, *last_tp = 0; in read_one_tuplelist() local
257 for (tl = tlist; tl; tl = tl->next) in read_one_tuplelist()
258 if (tl->offs == offs && tl->flags == (flags & MDF_ATTR)) in read_one_tuplelist()
261 tl->offs = offs; in read_one_tuplelist()
262 tl->flags = flags & MDF_ATTR; in read_one_tuplelist()
275 tp = xmalloc(sizeof(*tp)); in read_one_tuplelist()
276 tp->code = code; in read_one_tuplelist()
306 if (tinfo == NULL || (tinfo->length != LENGTH_ANY && tinfo->length > length)) { in read_one_tuplelist()
310 tp->length = length; in read_one_tuplelist()
313 tp->data = xmalloc(length); in read_one_tuplelist()
314 if (read(fd, tp->data, length) != length) in read_one_tuplelist()
319 last_tp->next = tp; in read_one_tuplelist()
320 if (tl->tuples == NULL) { in read_one_tuplelist()
321 tl->tuples = tp; in read_one_tuplelist()
322 tp->next = NULL; in read_one_tuplelist()
324 last_tp = tp; in read_one_tuplelist()
355 * find_tuple_in_list - find a tuple within a
361 struct tuple *tp; in find_tuple_in_list() local
363 for (tp = tl->tuples; tp; tp = tp->next) in find_tuple_in_list()
364 if (tp->code == code) in find_tuple_in_list()
366 return (tp); in find_tuple_in_list()
375 struct tuple_info *tp; in get_tuple_info() local
377 for (tp = tuple_info; tp->name; tp++) in get_tuple_info()
378 if (tp->code == code) in get_tuple_info()
379 return (tp); in get_tuple_info()
386 struct tuple_info *tp; in tuple_name() local
388 tp = get_tuple_info(code); in tuple_name()
389 if (tp) in tuple_name()
390 return (tp->name); in tuple_name()