diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/siop.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/siop_common.c | 45 | ||||
-rw-r--r-- | sys/dev/ic/siopvar_common.h | 4 |
3 files changed, 31 insertions, 26 deletions
diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c index d3cfe1607cd..b46a9a89169 100644 --- a/sys/dev/ic/siop.c +++ b/sys/dev/ic/siop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siop.c,v 1.7 2001/04/23 13:48:42 krw Exp $ */ +/* $OpenBSD: siop.c,v 1.8 2001/06/24 18:28:10 krw Exp $ */ /* $NetBSD: siop.c,v 1.39 2001/02/11 18:04:49 bouyer Exp $ */ /* @@ -740,7 +740,7 @@ scintr: if ((siop_target->flags & TARF_SYNC) == 0) { siop_target->status = TARST_OK; - siop_print_info(sc, target); + siop_print_info(xs->sc_link); /* no table to flush here */ CALL_SCRIPT(Ent_msgin_ack); return 1; @@ -756,7 +756,7 @@ scintr: } else if (msg == MSG_EXTENDED && extmsg == MSG_EXT_SDTR) { siop_target->status = TARST_OK; - siop_print_info(sc, target); + siop_print_info(xs->sc_link); /* no table to flush here */ CALL_SCRIPT(Ent_msgin_ack); return 1; @@ -1390,7 +1390,7 @@ siop_scsicmd(xs) } else { sc->targets[target]->status = TARST_OK; - siop_print_info(sc, target); + siop_print_info(xs->sc_link); } } break; diff --git a/sys/dev/ic/siop_common.c b/sys/dev/ic/siop_common.c index 186f967e47b..50dc9f2e4d2 100644 --- a/sys/dev/ic/siop_common.c +++ b/sys/dev/ic/siop_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siop_common.c,v 1.6 2001/04/15 06:01:29 krw Exp $ */ +/* $OpenBSD: siop_common.c,v 1.7 2001/06/24 18:28:10 krw Exp $ */ /* $NetBSD: siop_common.c,v 1.12 2001/02/11 18:04:50 bouyer Exp $ */ /* @@ -155,7 +155,7 @@ siop_setuptables(siop_cmd) siop_sdtr_msg(siop_cmd, 1, sc->min_st_sync, sc->maxoff); } else { sc->targets[target]->status = TARST_OK; - siop_print_info(sc, target); + siop_print_info(xs->sc_link); } } else if (sc->targets[target]->status == TARST_OK && (targ_flags & TARF_TAG) && @@ -251,7 +251,7 @@ siop_ppr_neg(siop_cmd) (siop_target->id & 0xff)); siop_target->status = TARST_OK; - siop_print_info(sc, target); + siop_print_info(siop_cmd->xs->sc_link); return (SIOP_NEG_ACK); } @@ -301,7 +301,7 @@ siop_wdtr_neg(siop_cmd) printf("%s: rejecting invalid wide negotiation from " "target %d (%d)\n", sc->sc_dev.dv_xname, target, tables->msg_in[3]); - siop_print_info(sc, target); + siop_print_info(siop_cmd->xs->sc_link); tables->t_msgout.count= htole32(1); tables->msg_out[0] = MSG_MESSAGE_REJECT; return SIOP_NEG_MSGOUT; @@ -317,7 +317,7 @@ siop_wdtr_neg(siop_cmd) return SIOP_NEG_MSGOUT; } else { siop_target->status = TARST_OK; - siop_print_info(sc, target); + siop_print_info(siop_cmd->xs->sc_link); return SIOP_NEG_ACK; } } else { @@ -338,7 +338,7 @@ siop_wdtr_neg(siop_cmd) */ if (siop_target->status != TARST_PROBING) { siop_target->status = TARST_OK; - siop_print_info(sc, target); + siop_print_info(siop_cmd->xs->sc_link); } siop_wdtr_msg(siop_cmd, 0, (siop_target->flags & TARF_ISWIDE) ? MSG_EXT_WDTR_BUS_16_BIT : MSG_EXT_WDTR_BUS_8_BIT); @@ -428,7 +428,7 @@ end: if (siop_target->status != TARST_PROBING) { siop_target->status = TARST_OK; - siop_print_info(sc, target); + siop_print_info(siop_cmd->xs->sc_link); } if (send_msgout) { @@ -682,32 +682,37 @@ siop_resetbus(sc) * target->status is set to TARST_OK. */ void -siop_print_info(sc, target) - struct siop_softc *sc; - int target; +siop_print_info(sc_link) + struct scsi_link *sc_link; { - struct siop_target *siop_target = sc->targets[target]; + struct siop_target *siop_target; + struct siop_softc *sc; u_int8_t scf, offset; - int scf_index, i; - - const int factors = sizeof(period_factor) / sizeof(period_factor[0]); - - offset = ((siop_target->id >> 8) & 0xff) >> SXFER_MO_SHIFT; + int scf_index, factors, target, i; - scf = ((siop_target->id >> 24) & SCNTL3_SCF_MASK) >> SCNTL3_SCF_SHIFT; - scf_index = sc->scf_index; + sc = (struct siop_softc *)sc_link->adapter_softc; + target = sc_link->target; - printf("%s: target %d now using %s%s%s%s%d bit ", - sc->sc_dev.dv_xname, target, + siop_target = sc->targets[target]; + + printf("%s: negotiated %s%s%s%s%d bit ", + ((struct device *)sc_link->device_softc)->dv_xname, (siop_target->flags & TARF_TAG) ? "tagged " : "", (siop_target->flags & TARF_ISDT) ? "DT " : "", (siop_target->flags & TARF_ISQAS) ? "QAS " : "", (siop_target->flags & TARF_ISIUS) ? "IUS " : "", (siop_target->flags & TARF_ISWIDE) ? 16 : 8); + offset = ((siop_target->id >> 8) & 0xff) >> SXFER_MO_SHIFT; + if (offset == 0) printf("async "); else { + factors = sizeof(period_factor) / sizeof(period_factor[0]); + + scf = ((siop_target->id >> 24) & SCNTL3_SCF_MASK) >> SCNTL3_SCF_SHIFT; + scf_index = sc->scf_index; + for (i = 0; i < factors; i++) if (siop_target->flags & TARF_ISDT) { if (period_factor[i].scf[scf_index].dt_scf == scf) diff --git a/sys/dev/ic/siopvar_common.h b/sys/dev/ic/siopvar_common.h index f02c2d4127c..79e2a9f6afb 100644 --- a/sys/dev/ic/siopvar_common.h +++ b/sys/dev/ic/siopvar_common.h @@ -1,4 +1,4 @@ -/* $OpenBSD: siopvar_common.h,v 1.4 2001/04/15 06:01:29 krw Exp $ */ +/* $OpenBSD: siopvar_common.h,v 1.5 2001/06/24 18:28:10 krw Exp $ */ /* $NetBSD: siopvar_common.h,v 1.10 2001/01/26 21:58:56 bouyer Exp $ */ /* @@ -209,7 +209,7 @@ void siop_ppr_msg __P((struct siop_cmd *, int, int, int)); #define SIOP_NEG_ACK 0x2 #define SIOP_NEG_MSGREJ 0x3 -void siop_print_info __P((struct siop_softc *, int)); +void siop_print_info __P((struct scsi_link *)); void siop_minphys __P((struct buf *)); void siop_sdp __P((struct siop_cmd *)); void siop_clearfifo __P((struct siop_softc *)); |