diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-11-19 18:36:19 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-11-19 18:36:19 +0000 |
commit | f8eb256c65fe796edfbbb90ae32c5502ca585795 (patch) | |
tree | 90bfb3141076a93dd45b97c7da2903fd4ebd8507 /sys/dev | |
parent | c9e49ad98cb86122f4be405756296ca6ce04c29e (diff) |
Use queue.h macros instead of using the structure names directly.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/microcode/aic7xxx/aicasm.c | 10 | ||||
-rw-r--r-- | sys/dev/microcode/aic7xxx/aicasm_gram.y | 11 | ||||
-rw-r--r-- | sys/dev/microcode/aic7xxx/aicasm_scan.l | 8 | ||||
-rw-r--r-- | sys/dev/microcode/aic7xxx/aicasm_symbol.c | 56 | ||||
-rw-r--r-- | sys/dev/pcmcia/com_pcmcia.c | 5 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_an_pcmcia.c | 4 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_cnw.c | 4 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_ray.c | 4 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_rln_pcmcia.c | 4 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_sm_pcmcia.c | 4 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_wi_pcmcia.c | 4 | ||||
-rw-r--r-- | sys/dev/pcmcia/pcmcia.c | 22 | ||||
-rw-r--r-- | sys/dev/pcmcia/pcmcia_cis.c | 14 | ||||
-rw-r--r-- | sys/dev/pcmcia/pcmciavar.h | 6 |
14 files changed, 72 insertions, 84 deletions
diff --git a/sys/dev/microcode/aic7xxx/aicasm.c b/sys/dev/microcode/aic7xxx/aicasm.c index c7a9e5718d8..0eac26d40b1 100644 --- a/sys/dev/microcode/aic7xxx/aicasm.c +++ b/sys/dev/microcode/aic7xxx/aicasm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aicasm.c,v 1.8 2002/06/30 18:25:58 smurph Exp $ */ +/* $OpenBSD: aicasm.c,v 1.9 2002/11/19 18:36:18 jason Exp $ */ /* * Aic7xxx SCSI host adapter firmware asssembler * @@ -38,7 +38,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: aicasm.c,v 1.8 2002/06/30 18:25:58 smurph Exp $ + * $Id: aicasm.c,v 1.9 2002/11/19 18:36:18 jason Exp $ * * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm.c,v 1.34 2002/06/05 22:51:54 gibbs Exp $ */ @@ -197,15 +197,15 @@ main(argc, argv) "times\n", appname); } includes_search_curdir = 0; - for (include_dir = search_path.slh_first; - include_dir != NULL; - include_dir = include_dir->links.sle_next) + SLIST_FOREACH(include_dir, &search_path, + links) { /* * All entries before a '-I-' only * apply to includes specified with * quotes instead of "<>". */ include_dir->quoted_includes_only = 1; + } } else { include_dir = (path_entry_t)malloc(sizeof(*include_dir)); diff --git a/sys/dev/microcode/aic7xxx/aicasm_gram.y b/sys/dev/microcode/aic7xxx/aicasm_gram.y index ae40ec76d04..d9f2ba4cbcc 100644 --- a/sys/dev/microcode/aic7xxx/aicasm_gram.y +++ b/sys/dev/microcode/aic7xxx/aicasm_gram.y @@ -1753,9 +1753,7 @@ type_check(symbol_t *symbol, expression_t *expression, int opcode) * expression are defined for this register. */ if(symbol->info.rinfo->typecheck_masks != FALSE) { - for(node = expression->referenced_syms.slh_first; - node != NULL; - node = node->links.sle_next) { + SLIST_FOREACH(node, &expression->referenced_syms, links) { if ((node->symbol->type == MASK || node->symbol->type == BIT) && symlist_search(&node->symbol->info.minfo->symrefs, @@ -1844,9 +1842,10 @@ yyerror(const char *string) static int is_download_const(expression_t *immed) { - if ((immed->referenced_syms.slh_first != NULL) - && (immed->referenced_syms.slh_first->symbol->type == DOWNLOAD_CONST)) + if (SLIST_EMPTY(&immed->referenced_syms)) + return (FALSE); + if (SLIST_FIRST(&immed->referenced_syms)->symbol->type == + DOWNLOAD_CONST) return (TRUE); - return (FALSE); } diff --git a/sys/dev/microcode/aic7xxx/aicasm_scan.l b/sys/dev/microcode/aic7xxx/aicasm_scan.l index d4d7177e26f..7accfd699f7 100644 --- a/sys/dev/microcode/aic7xxx/aicasm_scan.l +++ b/sys/dev/microcode/aic7xxx/aicasm_scan.l @@ -439,9 +439,7 @@ include_file(char *file_name, include_type type) if (newfile == NULL && type != SOURCE_FILE) { path_entry_t include_dir; - for (include_dir = search_path.slh_first; - include_dir != NULL; - include_dir = include_dir->links.sle_next) { + SLIST_FOREACH(include_dir, &search_path, links) { char fullname[PATH_MAX]; if ((include_dir->quoted_includes_only == TRUE) @@ -575,8 +573,8 @@ yywrap() if (yyfilename != NULL) free(yyfilename); yyfilename = NULL; - include = include_stack.slh_first; - if (include != NULL) { + include = SLIST_FIRST(&include_stack); + if (include != SLIST_END(&include_stack)) { yy_switch_to_buffer(include->buffer); yylineno = include->lineno; yyfilename = include->filename; diff --git a/sys/dev/microcode/aic7xxx/aicasm_symbol.c b/sys/dev/microcode/aic7xxx/aicasm_symbol.c index 7b4ba330f65..72104ffb4e1 100644 --- a/sys/dev/microcode/aic7xxx/aicasm_symbol.c +++ b/sys/dev/microcode/aic7xxx/aicasm_symbol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aicasm_symbol.c,v 1.5 2002/06/30 18:25:58 smurph Exp $ */ +/* $OpenBSD: aicasm_symbol.c,v 1.6 2002/11/19 18:36:18 jason Exp $ */ /* * Aic7xxx SCSI host adapter firmware asssembler symbol table implementation * @@ -200,11 +200,9 @@ symlist_search(symlist, symname) { symbol_node_t *curnode; - curnode = symlist->slh_first; - while(curnode != NULL) { + SLIST_FOREACH(curnode, symlist, links) { if (strcmp(symname, curnode->symbol->name) == 0) break; - curnode = curnode->links.sle_next; } return (curnode); } @@ -243,7 +241,7 @@ symlist_add(symlist, symbol, how) /* NOTREACHED */ } - curnode = symlist->slh_first; + curnode = SLIST_FIRST(symlist); if (curnode == NULL || (mask && (curnode->symbol->info.minfo->mask > newnode->symbol->info.minfo->mask)) @@ -254,14 +252,14 @@ symlist_add(symlist, symbol, how) } while (1) { - if (curnode->links.sle_next == NULL) { + if (SLIST_NEXT(curnode, links) == SLIST_END(symlist)) { SLIST_INSERT_AFTER(curnode, newnode, links); break; } else { symbol_t *cursymbol; - cursymbol = curnode->links.sle_next->symbol; + cursymbol = SLIST_NEXT(curnode, links)->symbol; if ((mask && (cursymbol->info.minfo->mask > symbol->info.minfo->mask)) || (!mask &&(cursymbol->info.rinfo->address > @@ -271,7 +269,7 @@ symlist_add(symlist, symbol, how) break; } } - curnode = curnode->links.sle_next; + curnode = SLIST_NEXT(curnode, links); } } else { SLIST_INSERT_HEAD(symlist, newnode, links); @@ -282,15 +280,13 @@ void symlist_free(symlist) symlist_t *symlist; { - symbol_node_t *node1, *node2; + symbol_node_t *node; - node1 = symlist->slh_first; - while (node1 != NULL) { - node2 = node1->links.sle_next; - free(node1); - node1 = node2; + while (!SLIST_EMPTY(symlist)) { + node = SLIST_FIRST(symlist); + SLIST_REMOVE_HEAD(symlist, links); + free(node); } - SLIST_INIT(symlist); } void @@ -302,7 +298,7 @@ symlist_merge(symlist_dest, symlist_src1, symlist_src2) symbol_node_t *node; *symlist_dest = *symlist_src1; - while((node = symlist_src2->slh_first) != NULL) { + while((node = SLIST_FIRST(symlist_src2)) != NULL) { SLIST_REMOVE_HEAD(symlist_src2, links); SLIST_INSERT_HEAD(symlist_dest, node, links); } @@ -380,28 +376,28 @@ symtable_dump(ofile) } /* Put in the masks and bits */ - while (masks.slh_first != NULL) { + while (SLIST_FIRST(&masks) != SLIST_END(&masks)) { symbol_node_t *curnode; symbol_node_t *regnode; char *regname; - curnode = masks.slh_first; + curnode = SLIST_FIRST(&masks); SLIST_REMOVE_HEAD(&masks, links); regnode = - curnode->symbol->info.minfo->symrefs.slh_first; + SLIST_FIRST(&curnode->symbol->info.minfo->symrefs); regname = regnode->symbol->name; regnode = symlist_search(®isters, regname); SLIST_INSERT_AFTER(regnode, curnode, links); } /* Add the aliases */ - while (aliases.slh_first != NULL) { + while (SLIST_FIRST(&aliases) != SLIST_END(&aliases)) { symbol_node_t *curnode; symbol_node_t *regnode; char *regname; - curnode = aliases.slh_first; + curnode = SLIST_FIRST(&aliases); SLIST_REMOVE_HEAD(&aliases, links); regname = curnode->symbol->info.ainfo->parent->name; @@ -416,13 +412,13 @@ symtable_dump(ofile) " * from the following source files:\n" " *\n" "%s */\n", versions); - while (registers.slh_first != NULL) { + while (SLIST_FIRST(®isters) != SLIST_END(®isters)) { symbol_node_t *curnode; u_int value; char *tab_str; char *tab_str2; - curnode = registers.slh_first; + curnode = SLIST_FIRST(®isters); SLIST_REMOVE_HEAD(®isters, links); switch(curnode->symbol->type) { case REGISTER: @@ -464,10 +460,10 @@ symtable_dump(ofile) } fprintf(ofile, "\n\n"); - while (constants.slh_first != NULL) { + while (SLIST_FIRST(&constants) != SLIST_END(&constants)) { symbol_node_t *curnode; - curnode = constants.slh_first; + curnode = SLIST_FIRST(&constants); SLIST_REMOVE_HEAD(&constants, links); fprintf(ofile, "#define\t%-8s\t0x%02x\n", curnode->symbol->name, @@ -478,10 +474,11 @@ symtable_dump(ofile) fprintf(ofile, "\n\n/* Downloaded Constant Definitions */\n"); - while (download_constants.slh_first != NULL) { + while (SLIST_FIRST(&download_constants) != + SLIST_END(&download_constants)) { symbol_node_t *curnode; - curnode = download_constants.slh_first; + curnode = SLIST_FIRST(&download_constants); SLIST_REMOVE_HEAD(&download_constants, links); fprintf(ofile, "#define\t%-8s\t0x%02x\n", curnode->symbol->name, @@ -492,10 +489,11 @@ symtable_dump(ofile) fprintf(ofile, "\n\n/* Exported Labels */\n"); - while (exported_labels.slh_first != NULL) { + while (SLIST_FIRST(&exported_labels) != + SLIST_END(&exported_labels)) { symbol_node_t *curnode; - curnode = exported_labels.slh_first; + curnode = SLIST_FIRST(&exported_labels); SLIST_REMOVE_HEAD(&exported_labels, links); fprintf(ofile, "#define\tLABEL_%-8s\t0x%02x\n", curnode->symbol->name, diff --git a/sys/dev/pcmcia/com_pcmcia.c b/sys/dev/pcmcia/com_pcmcia.c index 115c3426ce0..ddf3b8fac8b 100644 --- a/sys/dev/pcmcia/com_pcmcia.c +++ b/sys/dev/pcmcia/com_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_pcmcia.c,v 1.32 2002/06/20 17:37:14 fgsch Exp $ */ +/* $OpenBSD: com_pcmcia.c,v 1.33 2002/11/19 18:36:18 jason Exp $ */ /* $NetBSD: com_pcmcia.c,v 1.15 1998/08/22 17:47:58 msaitoh Exp $ */ /* @@ -197,8 +197,7 @@ com_pcmcia_match(parent, match, aux) /* 2. Does it have all four 'standard' port ranges? */ comportmask = 0; - for (cfe = pa->pf->cfe_head.sqh_first; cfe; - cfe = cfe->cfe_list.sqe_next) { + SIMPLEQ_FOREACH(cfe, &pa->pf->cfe_head, cfe_list) { switch (cfe->iospace[0].start) { case IO_COM1: comportmask |= 1; diff --git a/sys/dev/pcmcia/if_an_pcmcia.c b/sys/dev/pcmcia/if_an_pcmcia.c index e4e761b2233..a1cb4a95012 100644 --- a/sys/dev/pcmcia/if_an_pcmcia.c +++ b/sys/dev/pcmcia/if_an_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_an_pcmcia.c,v 1.10 2002/06/25 15:13:09 millert Exp $ */ +/* $OpenBSD: if_an_pcmcia.c,v 1.11 2002/11/19 18:36:18 jason Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -106,7 +106,7 @@ an_pcmcia_attach(parent, self, aux) struct pcmcia_config_entry *cfe; psc->sc_pf = pa->pf; - cfe = pa->pf->cfe_head.sqh_first; + cfe = SIMPLEQ_FIRST(&pa->pf->cfe_head); pcmcia_function_init(pa->pf, cfe); if (pcmcia_function_enable(pa->pf)) { diff --git a/sys/dev/pcmcia/if_cnw.c b/sys/dev/pcmcia/if_cnw.c index 54ff270197a..40d22dad3c0 100644 --- a/sys/dev/pcmcia/if_cnw.c +++ b/sys/dev/pcmcia/if_cnw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cnw.c,v 1.11 2002/03/14 01:27:01 millert Exp $ */ +/* $OpenBSD: if_cnw.c,v 1.12 2002/11/19 18:36:18 jason Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -384,7 +384,7 @@ cnw_attach(parent, self, aux) /* Enable the card */ sc->sc_pf = pa->pf; - pcmcia_function_init(sc->sc_pf, sc->sc_pf->cfe_head.sqh_first); + pcmcia_function_init(sc->sc_pf, SIMPLEQ_FIRST(&sc->sc_pf->cfe_head)); if (pcmcia_function_enable(sc->sc_pf)) { printf(": function enable failed\n"); return; diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c index 47d072b99b5..ddfd0b899f0 100644 --- a/sys/dev/pcmcia/if_ray.c +++ b/sys/dev/pcmcia/if_ray.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ray.c,v 1.20 2002/06/04 00:09:08 deraadt Exp $ */ +/* $OpenBSD: if_ray.c,v 1.21 2002/11/19 18:36:18 jason Exp $ */ /* $NetBSD: if_ray.c,v 1.21 2000/07/05 02:35:54 onoe Exp $ */ /* @@ -532,7 +532,7 @@ ray_attach(parent, self, aux) printf("\n"); /* enable the card */ - pcmcia_function_init(sc->sc_pf, sc->sc_pf->cfe_head.sqh_first); + pcmcia_function_init(sc->sc_pf, SIMPLEQ_FIRST(&sc->sc_pf->cfe_head)); if (pcmcia_function_enable(sc->sc_pf)) { printf(": failed to enable the card"); return; diff --git a/sys/dev/pcmcia/if_rln_pcmcia.c b/sys/dev/pcmcia/if_rln_pcmcia.c index 63b2a96b92a..abec1002ce1 100644 --- a/sys/dev/pcmcia/if_rln_pcmcia.c +++ b/sys/dev/pcmcia/if_rln_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rln_pcmcia.c,v 1.13 2002/03/14 01:27:01 millert Exp $ */ +/* $OpenBSD: if_rln_pcmcia.c,v 1.14 2002/11/19 18:36:18 jason Exp $ */ /* * David Leonard <d@openbsd.org>, 1999. Public domain. * @@ -140,7 +140,7 @@ rln_pcmcia_attach(parent, self, aux) struct rln_pcmcia_product *rpp; psc->psc_pf = pa->pf; - cfe = psc->psc_pf->cfe_head.sqh_first; + cfe = SIMPLEQ_FIRST(&psc->psc_pf->cfe_head); /* Guess the transfer width we will be using */ if (cfe->flags & PCMCIA_CFE_IO16) diff --git a/sys/dev/pcmcia/if_sm_pcmcia.c b/sys/dev/pcmcia/if_sm_pcmcia.c index 911c0a86ab6..665a130c776 100644 --- a/sys/dev/pcmcia/if_sm_pcmcia.c +++ b/sys/dev/pcmcia/if_sm_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sm_pcmcia.c,v 1.17 2002/07/01 13:31:06 fgsch Exp $ */ +/* $OpenBSD: if_sm_pcmcia.c,v 1.18 2002/11/19 18:36:18 jason Exp $ */ /* $NetBSD: if_sm_pcmcia.c,v 1.11 1998/08/15 20:47:32 thorpej Exp $ */ /*- @@ -155,7 +155,7 @@ sm_pcmcia_attach(parent, self, aux) u_int8_t myla[ETHER_ADDR_LEN], *enaddr = NULL; psc->sc_pf = pa->pf; - cfe = pa->pf->cfe_head.sqh_first; + cfe = SIMPLEQ_FIRST(&pa->pf->cfe_head); /* Enable the card. */ pcmcia_function_init(pa->pf, cfe); diff --git a/sys/dev/pcmcia/if_wi_pcmcia.c b/sys/dev/pcmcia/if_wi_pcmcia.c index 525661c309e..7aad62aae4c 100644 --- a/sys/dev/pcmcia/if_wi_pcmcia.c +++ b/sys/dev/pcmcia/if_wi_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_pcmcia.c,v 1.38 2002/07/09 11:00:27 fgsch Exp $ */ +/* $OpenBSD: if_wi_pcmcia.c,v 1.39 2002/11/19 18:36:18 jason Exp $ */ /* $NetBSD: if_wi_pcmcia.c,v 1.14 2001/11/26 04:34:56 ichiro Exp $ */ /* @@ -331,7 +331,7 @@ wi_pcmcia_attach(parent, self, aux) struct wi_softc *sc = &psc->sc_wi; struct pcmcia_attach_args *pa = aux; struct pcmcia_function *pf = pa->pf; - struct pcmcia_config_entry *cfe = pf->cfe_head.sqh_first; + struct pcmcia_config_entry *cfe = SIMPLEQ_FIRST(&pf->cfe_head); int state = 0; psc->sc_pf = pf; diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c index ba0f9ef811d..1ac0b049569 100644 --- a/sys/dev/pcmcia/pcmcia.c +++ b/sys/dev/pcmcia/pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia.c,v 1.32 2002/03/14 01:27:01 millert Exp $ */ +/* $OpenBSD: pcmcia.c,v 1.33 2002/11/19 18:36:18 jason Exp $ */ /* $NetBSD: pcmcia.c,v 1.9 1998/08/13 02:10:55 eeh Exp $ */ /* @@ -170,7 +170,7 @@ pcmcia_card_attach(dev) /* * this is here so that when socket_enable calls gettype, trt happens */ - sc->card.pf_head.sqh_first = NULL; + SIMPLEQ_FIRST(&sc->card.pf_head) = NULL; pcmcia_chip_socket_enable(sc->pct, sc->pch); @@ -188,7 +188,7 @@ pcmcia_card_attach(dev) if (sc->card.error) return (1); - if (sc->card.pf_head.sqh_first == NULL) + if (SIMPLEQ_EMPTY(&sc->card.pf_head)) return (1); #endif @@ -455,8 +455,7 @@ pcmcia_function_enable(pf) * It's possible for different functions' CCRs to be in the same * underlying page. Check for that. */ - for (tmp = pf->sc->card.pf_head.sqh_first; tmp != NULL; - tmp = tmp->pf_list.sqe_next) { + SIMPLEQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) { if ((tmp->pf_flags & PFF_ENABLED) && (pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) && ((pf->ccr_base + PCMCIA_CCR_SIZE) <= @@ -532,8 +531,7 @@ pcmcia_function_enable(pf) } #ifdef PCMCIADEBUG - for (tmp = pf->sc->card.pf_head.sqh_first; tmp != NULL; - tmp = tmp->pf_list.sqe_next) { + SIMPLEQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) { printf("%s: function %d CCR at %d offset %lx: " "%x %x %x %x, %x %x %x %x, %x\n", tmp->sc->dev.dv_xname, tmp->number, @@ -599,8 +597,7 @@ pcmcia_function_disable(pf) * first to avoid matching ourself. */ pf->pf_flags &= ~PFF_ENABLED; - for (tmp = pf->sc->card.pf_head.sqh_first; tmp != NULL; - tmp = tmp->pf_list.sqe_next) { + SIMPLEQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) { if ((tmp->pf_flags & PFF_ENABLED) && (pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) && ((pf->ccr_base + PCMCIA_CCR_SIZE) <= @@ -701,8 +698,7 @@ pcmcia_intr_establish(pf, ipl, ih_fct, ih_arg, xname) * and find the highest ipl number (lowest priority). */ ihcnt = 0; - for (pf2 = pf->sc->card.pf_head.sqh_first; pf2 != NULL; - pf2 = pf2->pf_list.sqe_next) + SIMPLEQ_FOREACH(pf2, &pf->sc->card.pf_head, pf_list) { if (pf2->ih_fct) { DPRINTF(("%s: function %d has ih_fct %p\n", pf->sc->dev.dv_xname, pf2->number, @@ -715,6 +711,7 @@ pcmcia_intr_establish(pf, ipl, ih_fct, ih_arg, xname) ihcnt++; } + } /* * Establish the real interrupt, changing the ipl if @@ -804,8 +801,7 @@ pcmcia_intr_disestablish(pf, ih) * the current function. */ ihcnt = 0; - for (pf2 = pf->sc->card.pf_head.sqh_first; pf2 != NULL; - pf2 = pf2->pf_list.sqe_next) { + SIMPLEQ_FOREACH(pf2, &pf->sc->card.pf_head, pf_list) { if (pf2 == pf) continue; diff --git a/sys/dev/pcmcia/pcmcia_cis.c b/sys/dev/pcmcia/pcmcia_cis.c index 94aa293a953..fc32488cac8 100644 --- a/sys/dev/pcmcia/pcmcia_cis.c +++ b/sys/dev/pcmcia/pcmcia_cis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia_cis.c,v 1.8 2002/06/19 19:03:25 fgsch Exp $ */ +/* $OpenBSD: pcmcia_cis.c,v 1.9 2002/11/19 18:36:18 jason Exp $ */ /* $NetBSD: pcmcia_cis.c,v 1.9 1998/08/22 23:41:48 msaitoh Exp $ */ /* @@ -471,8 +471,7 @@ pcmcia_print_cis(sc) printf("%s: Manufacturer code 0x%x, product 0x%x\n", sc->dev.dv_xname, card->manufacturer, card->product); - for (pf = card->pf_head.sqh_first; pf != NULL; - pf = pf->pf_list.sqe_next) { + SIMPLEQ_FOREACH(pf, &card->pf_head, pf_list) { printf("%s: function %d: ", sc->dev.dv_xname, pf->number); switch (pf->function) { @@ -522,8 +521,7 @@ pcmcia_print_cis(sc) printf(", ccr addr %lx mask %lx\n", pf->ccr_base, pf->ccr_mask); - for (cfe = pf->cfe_head.sqh_first; cfe != NULL; - cfe = cfe->cfe_list.sqe_next) { + SIMPLEQ_FOREACH(cfe, &pf->cfe_head, cfe_list) { printf("%s: function %d, config table entry %d: ", sc->dev.dv_xname, pf->number, cfe->number); @@ -632,9 +630,9 @@ pcmcia_parse_cis_tuple(tuple, arg) if (state->gotmfc == 1) { struct pcmcia_function *pf, *pfnext; - for (pf = state->card->pf_head.sqh_first; pf != NULL; - pf = pfnext) { - pfnext = pf->pf_list.sqe_next; + for (pf = SIMPLEQ_FIRST(&state->card->pf_head); + pf != NULL; pf = pfnext) { + pfnext = SIMPLEQ_NEXT(pf, pf_list); free(pf, M_DEVBUF); } diff --git a/sys/dev/pcmcia/pcmciavar.h b/sys/dev/pcmcia/pcmciavar.h index 8f1fb59acf0..7aeecd781a0 100644 --- a/sys/dev/pcmcia/pcmciavar.h +++ b/sys/dev/pcmcia/pcmciavar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmciavar.h,v 1.16 2002/03/14 03:16:07 millert Exp $ */ +/* $OpenBSD: pcmciavar.h,v 1.17 2002/11/19 18:36:18 jason Exp $ */ /* $NetBSD: pcmciavar.h,v 1.5 1998/07/19 17:28:17 christos Exp $ */ /* @@ -238,8 +238,8 @@ int pcmcia_scan_cis(struct device * dev, int pcmcia_ccr_read(struct pcmcia_function *, int); void pcmcia_ccr_write(struct pcmcia_function *, int, int); -#define pcmcia_mfc(sc) ((sc)->card.pf_head.sqh_first && \ - (sc)->card.pf_head.sqh_first->pf_list.sqe_next) +#define pcmcia_mfc(sc) (SIMPLEQ_FIRST(&(sc)->card.pf_head) && \ + SIMPLEQ_NEXT(SIMPLEQ_FIRST(&(sc)->card.pf_head), pf_list)) void pcmcia_function_init(struct pcmcia_function *, struct pcmcia_config_entry *); |