diff options
Diffstat (limited to 'sys/i386/isa/bs')
-rw-r--r-- | sys/i386/isa/bs/bs.c | 34 | ||||
-rw-r--r-- | sys/i386/isa/bs/bs_pisa.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/bs/bsfunc.c | 30 |
3 files changed, 35 insertions, 33 deletions
diff --git a/sys/i386/isa/bs/bs.c b/sys/i386/isa/bs/bs.c index fdbc8a1..97a506f 100644 --- a/sys/i386/isa/bs/bs.c +++ b/sys/i386/isa/bs/bs.c @@ -238,7 +238,7 @@ bscmdstart(ti, flags) struct bsccb *cb; struct bs_softc *bsc = ti->ti_bsc; - if ((cb = ti->ti_ctab.tqh_first) == NULL) + if ((cb = TAILQ_FIRST(&ti->ti_ctab)) == NULL) { if (bsc->sc_nexus == NULL) bshoststart(bsc, NULL); @@ -281,7 +281,7 @@ bscmddone(ti) struct targ_info *ti; { struct bs_softc *bsc = ti->ti_bsc; - struct bsccb *cb = ti->ti_ctab.tqh_first; + struct bsccb *cb = TAILQ_FIRST(&ti->ti_ctab); union ccb *ccb; int error; @@ -386,7 +386,7 @@ bscmddone(ti) } bs_free_ccb(cb); - cb = ti->ti_ctab.tqh_first; + cb = TAILQ_FIRST(&ti->ti_ctab); } while (cb != NULL && (cb->bsccb_flags & BSITSDONE) != 0); @@ -415,12 +415,12 @@ bshoststart(bsc, ti) again: if (ti == NULL) { - if ((ti = bsc->sc_sttab.tqh_first) == NULL) + if ((ti = TAILQ_FIRST(&bsc->sc_sttab)) == NULL) return; bs_hostque_delete(bsc, ti); } - if ((cb = ti->ti_ctab.tqh_first) == NULL) + if ((cb = TAILQ_FIRST(&ti->ti_ctab)) == NULL) { bs_printf(ti, "bshoststart", "Warning: No ccb"); BS_SETUP_PHASE(FREE); @@ -450,8 +450,8 @@ again: { struct targ_info *tmpti; - for (tmpti = bsc->sc_titab.tqh_first; tmpti; - tmpti = tmpti->ti_tchain.tqe_next) + for (tmpti = TAILQ_FIRST(&bsc->sc_titab); tmpti; + tmpti = TAILQ_NEXT(tmpti, ti_tchain)) if (tmpti->ti_phase >= DISCONNECTED) goto retry; } @@ -615,7 +615,7 @@ bs_reselect(bsc) /* confirm nexus */ BS_HOST_START bshw_setup_ctrl_reg(bsc, ti->ti_cfgflags); - if (ti->ti_ctab.tqh_first == NULL || ti->ti_phase != DISCONNECTED) + if (TAILQ_FIRST(&ti->ti_ctab) == NULL || ti->ti_phase != DISCONNECTED) { bs_printf(ti, "reselect", "phase mismatch"); BS_SETUP_PHASE(UNDEF) @@ -670,7 +670,7 @@ bs_poll_timeout(bsc, s) bs_printf(NULL, s, "timeout"); bsc->sc_flags |= BSRESET; - if ((ti = bsc->sc_nexus) && ti->ti_ctab.tqh_first) + if ((ti = bsc->sc_nexus) && TAILQ_FIRST(&ti->ti_ctab)) ti->ti_error |= BSTIMEOUT; } @@ -835,7 +835,7 @@ bs_quick_abort(ti, msg) { struct bsccb *cb; - if ((cb = ti->ti_ctab.tqh_first) == NULL) + if ((cb = TAILQ_FIRST(&ti->ti_ctab)) == NULL) return; cb->msgoutlen = 1; @@ -869,7 +869,7 @@ bs_msgin_ext(ti) struct targ_info *ti; { struct bs_softc *bsc = ti->ti_bsc; - struct bsccb *cb = ti->ti_ctab.tqh_first; + struct bsccb *cb = TAILQ_FIRST(&ti->ti_ctab); int count; u_int reqlen; u_int32_t *ptr; @@ -942,7 +942,7 @@ bs_msg_reject(ti) struct targ_info *ti; { struct bs_softc *bsc = ti->ti_bsc; - struct bsccb *cb = ti->ti_ctab.tqh_first; + struct bsccb *cb = TAILQ_FIRST(&ti->ti_ctab); char *s = "unexpected msg reject"; switch (ti->ti_ophase) @@ -1196,7 +1196,7 @@ bs_disconnect_phase(bsc, ti, cb) ti->ti_flags &= ~BSNEXUS; #endif /* BS_DIAG */ BS_SETUP_PHASE(FREE); - if (cb || bsc->sc_sttab.tqh_first == NULL) + if (cb || TAILQ_FIRST(&bsc->sc_sttab) == NULL) { BS_HOST_TERMINATE; bscmdstart(ti, BSCMDSTART); @@ -1374,7 +1374,7 @@ bs_sequencer(bsc) } ti = bsc->sc_nexus; - if (ti == NULL || (cb = ti->ti_ctab.tqh_first) == NULL) + if (ti == NULL || (cb = TAILQ_FIRST(&ti->ti_ctab)) == NULL) { bs_debug_print_all(bsc); bs_printf(ti, "bsintr", "no nexus"); @@ -1591,7 +1591,7 @@ bs_scsi_cmd_poll_internal(cti) /* setup timeout count */ if ((ti = bsc->sc_nexus) == NULL || - (cb = ti->ti_ctab.tqh_first) == NULL) + (cb = TAILQ_FIRST(&ti->ti_ctab)) == NULL) waits = BS_DEFAULT_TIMEOUT_SECOND * 1000000; else waits = cb->tcmax * 1000000; @@ -1602,7 +1602,7 @@ bs_scsi_cmd_poll_internal(cti) if ((ti = bsc->sc_ti[i]) != NULL) { ti->ti_flags |= BSFORCEIOPOLL; - if ((cb = ti->ti_ctab.tqh_first) != NULL) + if ((cb = TAILQ_FIRST(&ti->ti_ctab)) != NULL) cb->bsccb_flags |= BSFORCEIOPOLL; } } @@ -1658,7 +1658,7 @@ bs_scsi_cmd_poll(cti, targetcb) { if (bs_scsi_cmd_poll_internal(cti) != COMPLETE) { - if ((ti = bsc->sc_nexus) && ti->ti_ctab.tqh_first) + if ((ti = bsc->sc_nexus) && TAILQ_FIRST(&ti->ti_ctab)) ti->ti_error |= (BSTIMEOUT | BSABNORMAL); bs_reset_nexus(bsc); } diff --git a/sys/i386/isa/bs/bs_pisa.c b/sys/i386/isa/bs/bs_pisa.c index 62ae84b..059cb7e 100644 --- a/sys/i386/isa/bs/bs_pisa.c +++ b/sys/i386/isa/bs/bs_pisa.c @@ -26,6 +26,8 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ #include <dev/isa/bs/bsif.h> @@ -103,7 +105,7 @@ bs_activate(arg) bsc->sc_irqmasks = (1 << ia->ia_irq); - while((ti = bsc->sc_titab.tqh_first) != NULL) + while((ti = TAILQ_FIRST(&bsc->sc_titab)) != NULL) TAILQ_REMOVE(&bsc->sc_titab, ti, ti_tchain); bsc->sc_openf = 0; diff --git a/sys/i386/isa/bs/bsfunc.c b/sys/i386/isa/bs/bsfunc.c index 8800d3d..c0e5540 100644 --- a/sys/i386/isa/bs/bsfunc.c +++ b/sys/i386/isa/bs/bsfunc.c @@ -95,17 +95,17 @@ bstimeout(arg) bsc->sc_flags &= ~BSSTARTTIMEOUT; /* check */ - if ((ti = bsc->sc_nexus) && (cb = ti->ti_ctab.tqh_first)) + if ((ti = bsc->sc_nexus) && (cb = TAILQ_FIRST(&ti->ti_ctab))) { if ((cb->tc -= BS_TIMEOUT_CHECK_INTERVAL) < 0) bs_timeout_target(ti); } - else for (ti = bsc->sc_titab.tqh_first; ti; ti = ti->ti_tchain.tqe_next) + else TAILQ_FOREACH(ti, &bsc->sc_titab, ti_tchain) { if (bsc->sc_dtgnum && ti->ti_phase < DISCONNECTED) continue; - cb = ti->ti_ctab.tqh_first; + cb = TAILQ_FIRST(&ti->ti_ctab); if (cb && ((cb->tc -= BS_TIMEOUT_CHECK_INTERVAL) < 0)) bs_timeout_target(ti); } @@ -257,7 +257,7 @@ bs_start_syncmsg(ti, cb, flag) msg.flag = 0; lun = ti->ti_lun; if (cb == NULL) - cb = ti->ti_ctab.tqh_first; + cb = TAILQ_FIRST(&ti->ti_ctab); } else if (ti->ti_cfgflags & BS_SCSI_SYNC) { @@ -418,7 +418,7 @@ bs_force_abort(ti) { struct bs_softc *bsc = ti->ti_bsc; struct msgbase msg; - struct bsccb *cb = ti->ti_ctab.tqh_first; + struct bsccb *cb = TAILQ_FIRST(&ti->ti_ctab); u_int lun; if (cb) @@ -478,13 +478,13 @@ bs_scsibus_start(bsc) bshw_bus_reset(bsc); bshw_chip_reset(bsc); printf(" done. scsi bus ready.\n"); - nextti = bsc->sc_titab.tqh_first; + nextti = TAILQ_FIRST(&bsc->sc_titab); error = COMPLETE; } if ((ti = nextti) == NULL) break; - nextti = ti->ti_tchain.tqe_next; + nextti = TAILQ_NEXT(ti, ti_tchain); bits = (1 << ti->ti_id); if (skip & bits) @@ -510,11 +510,11 @@ bs_scsibus_start(bsc) bsc->sc_hstate = BSC_RDY; /* recover */ - for (ti = bsc->sc_titab.tqh_first; ti; ti = ti->ti_tchain.tqe_next) + TAILQ_FOREACH(ti, &bsc->sc_titab, ti_tchain) { ti->ti_ctab = ti->ti_bctab; TAILQ_INIT(&ti->ti_bctab); - if (ti->ti_ctab.tqh_first) + if (TAILQ_FIRST(&ti->ti_ctab)) bscmdstart(ti, BSCMDSTART); } } @@ -539,7 +539,7 @@ bs_reset_nexus(bsc) bsc->sc_dtgnum = 0; /* target state clear */ - for (ti = bsc->sc_titab.tqh_first; ti; ti = ti->ti_tchain.tqe_next) + TAILQ_FOREACH(ti, &bsc->sc_titab, ti_tchain) { if (ti->ti_state == BS_TARG_SYNCH) bs_analyze_syncmsg(ti, NULL); @@ -548,7 +548,7 @@ bs_reset_nexus(bsc) BS_SETUP_PHASE(UNDEF) bs_hostque_delete(bsc, ti); - if ((cb = ti->ti_ctab.tqh_first) != NULL) + if ((cb = TAILQ_FIRST(&ti->ti_ctab)) != NULL) { if (bsc->sc_hstate == BSC_TARG_CHECK) { @@ -573,7 +573,7 @@ bs_reset_nexus(bsc) ti->ti_flags &= ~BSNEXUS; #endif /* BS_DIAG */ - for ( ; cb; cb = cb->ccb_chain.tqe_next) + for ( ; cb; cb = TAILQ_NEXT(cb, ccb_chain)) { bs_kill_msg(cb); cb->bsccb_flags &= ~(BSITSDONE | BSCASTAT); @@ -581,7 +581,7 @@ bs_reset_nexus(bsc) } if (bsc->sc_hstate != BSC_TARG_CHECK && - ti->ti_bctab.tqh_first == NULL) + TAILQ_FIRST(&ti->ti_bctab) == NULL) ti->ti_bctab = ti->ti_ctab; TAILQ_INIT(&ti->ti_ctab); @@ -872,7 +872,7 @@ bs_debug_print_all(bsc) { struct targ_info *ti; - for (ti = bsc->sc_titab.tqh_first; ti; ti = ti->ti_tchain.tqe_next) + TAILQ_FOREACH(ti, &bsc->sc_titab, ti_tchain) bs_debug_print(bsc, ti); } @@ -903,7 +903,7 @@ bs_debug_print(bsc, ti) ti->ti_lun, phase[(int) ti->ti_phase]); printf("msgptr %x msg[0] %x status %x tqh %lx fl %x\n", (u_int) (ti->ti_msginptr), (u_int) (ti->ti_msgin[0]), - ti->ti_status, (u_long) (cb = ti->ti_ctab.tqh_first), + ti->ti_status, (u_long) (cb = TAILQ_FIRST(&ti->ti_ctab)), ti->ti_flags); if (cb) printf("cmdlen %x cmdaddr %lx cmd[0] %x\n", |