From 9cdf7ddf03d36f5e7286298e47ef9089b0995990 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Tue, 20 Feb 2001 00:32:31 +0000 Subject: Tone down the verbosity level on the siop driver, print negotiation results on one line, during boot polling only. Force wide/sync negotiations for all targets during boot. Delete extraneous name field and associated strings that duplicate info provided in INQUIRY data. Actually timeout during polling rather than wait forever for ITSDONE. Remove unneeded check for SCSI_POLL before calling scsi_done(). Makes logic conform to other drivers. --- sys/dev/ic/siop.c | 67 +++++++++++++++++++++++++++++++++---------- sys/dev/ic/siop_common.c | 18 +----------- sys/dev/pci/siop_pci_common.c | 47 +++++++++--------------------- sys/dev/pci/siop_pci_common.h | 3 +- 4 files changed, 67 insertions(+), 68 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c index c00398df08d..1026e69fe7a 100644 --- a/sys/dev/ic/siop.c +++ b/sys/dev/ic/siop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siop.c,v 1.1 2001/02/15 04:07:58 krw Exp $ */ +/* $OpenBSD: siop.c,v 1.2 2001/02/20 00:32:28 krw Exp $ */ /* $NetBSD: siop.c,v 1.39 2001/02/11 18:04:49 bouyer Exp $ */ /* @@ -86,6 +86,7 @@ int siop_morecbd __P((struct siop_softc *)); struct siop_lunsw *siop_get_lunsw __P((struct siop_softc *)); void siop_add_reselsw __P((struct siop_softc *, int)); void siop_update_scntl3 __P((struct siop_softc *, struct siop_target *)); +void siop_print_info __P((struct siop_softc *, int)); struct cfdriver siop_cd = { NULL, "siop", DV_DULL @@ -732,10 +733,6 @@ scintr: } if (msg == MSG_EXTENDED && extmsg == MSG_EXT_WDTR) { - /* WDTR rejected, initiate sync */ - printf("%s: target %d using 8bit " - "transfers\n", sc->sc_dev.dv_xname, - target); if ((siop_target->flags & TARF_SYNC) == 0) { siop_target->status = TARST_OK; @@ -753,10 +750,6 @@ scintr: return 1; } else if (msg == MSG_EXTENDED && extmsg == MSG_EXT_SDTR) { - /* sync rejected */ - printf("%s: target %d asynchronous\n", - sc->sc_dev.dv_xname, - target); siop_target->status = TARST_OK; /* no table to flush here */ CALL_SCRIPT(Ent_msgin_ack); @@ -1088,8 +1081,7 @@ out: siop_cmd->status = CMDST_FREE; xs->flags |= ITSDONE; xs->resid = 0; - if ((xs->flags & SCSI_POLL) == 0) - scsi_done (xs); + scsi_done(xs); } /* @@ -1226,6 +1218,37 @@ siop_handle_reset(sc) } } +void +siop_print_info(sc, target) + struct siop_softc *sc; + int target; +{ + const u_int32_t id = sc->targets[target]->id; + const u_int8_t scf = ((id >> 24) & SCNTL3_SCF_MASK) >> SCNTL3_SCF_SHIFT; + const u_int8_t offset = ((id >> 8) & SXFER_MO_MASK) >> SXFER_MO_SHIFT; + const int clock = sc->clock_period; + int i; + + printf("%s: target %d using %d bit ", sc->sc_dev.dv_xname, target, + (sc->targets[target]->flags & TARF_ISWIDE) ? 16 : 8); + + if (offset == 0) + printf("async "); + else { + for (i = 0; i < sizeof(scf_period) / sizeof(scf_period[0]); i++) + if ((scf_period[i].clock == clock) + && (scf_period[i].scf == scf)) { + printf("%s ", scf_period[i].rate); + break; + } + if (i == sizeof(scf_period) / sizeof(scf_period[0])) + printf("? "); + printf("MHz %d REQ/ACK offset ", offset); + } + + printf("xfers\n"); +} + int siop_scsicmd(xs) struct scsi_xfer *xs; @@ -1281,7 +1304,7 @@ siop_scsicmd(xs) return(TRY_AGAIN_LATER); } sc->targets[target]->status = TARST_PROBING; - sc->targets[target]->flags = 0; + sc->targets[target]->flags = TARF_WIDE | TARF_SYNC; sc->targets[target]->id = sc->clock_div << 24; /* scntl3 */ sc->targets[target]->id |= target << 16; /* id */ /* sc->targets[target]->id |= 0x0 << 8; scxfer is 0 */ @@ -1298,7 +1321,9 @@ siop_scsicmd(xs) for (i=0; i < 8; i++) sc->targets[target]->siop_lun[i] = NULL; siop_add_reselsw(sc, target); - } + } else if (sc->targets[target]->status == TARST_PROBING) + sc->targets[target]->status = TARST_ASYNC; + if (sc->targets[target]->siop_lun[lun] == NULL) { sc->targets[target]->siop_lun[lun] = malloc(sizeof(struct siop_lun), M_DEVBUF, M_NOWAIT); @@ -1352,11 +1377,23 @@ siop_scsicmd(xs) siop_start(sc); if (xs->flags & SCSI_POLL) { /* poll for command completion */ - while ((xs->flags & ITSDONE) == 0) { - delay(1000); + for(i = xs->timeout; i > 0; i--) { siop_intr(sc); + if (xs->flags & ITSDONE) { + if ((xs->cmd->opcode == INQUIRY) + && (xs->sc_link->lun == 0) + && (xs->error == XS_NOERROR)) + siop_print_info(sc, target); + break; + } + delay(1000); } splx(s); + if (i == 0) { + siop_timeout(siop_cmd); + while ((xs->flags & ITSDONE) == 0) + siop_intr(sc); + } return (COMPLETE); } splx(s); diff --git a/sys/dev/ic/siop_common.c b/sys/dev/ic/siop_common.c index 1300c91c117..e6d93470787 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.1 2001/02/15 04:07:58 krw Exp $ */ +/* $OpenBSD: siop_common.c,v 1.2 2001/02/20 00:32:29 krw Exp $ */ /* $NetBSD: siop_common.c,v 1.12 2001/02/11 18:04:50 bouyer Exp $ */ /* @@ -184,15 +184,11 @@ siop_wdtr_neg(siop_cmd) /* we initiated wide negotiation */ switch (tables->msg_in[3]) { case MSG_EXT_WDTR_BUS_8_BIT: - printf("%s: target %d using 8bit transfers\n", - sc->sc_dev.dv_xname, target); siop_target->flags &= ~TARF_ISWIDE; sc->targets[target]->id &= ~(SCNTL3_EWS << 24); break; case MSG_EXT_WDTR_BUS_16_BIT: if (siop_target->flags & TARF_WIDE) { - printf("%s: target %d using 16bit transfers\n", - sc->sc_dev.dv_xname, target); siop_target->flags |= TARF_ISWIDE; sc->targets[target]->id |= (SCNTL3_EWS << 24); break; @@ -229,13 +225,9 @@ siop_wdtr_neg(siop_cmd) /* target initiated wide negotiation */ if (tables->msg_in[3] >= MSG_EXT_WDTR_BUS_16_BIT && (siop_target->flags & TARF_WIDE)) { - printf("%s: target %d using 16bit transfers\n", - sc->sc_dev.dv_xname, target); siop_target->flags |= TARF_ISWIDE; sc->targets[target]->id |= SCNTL3_EWS << 24; } else { - printf("%s: target %d using 8bit transfers\n", - sc->sc_dev.dv_xname, target); siop_target->flags &= ~TARF_ISWIDE; sc->targets[target]->id &= ~(SCNTL3_EWS << 24); } @@ -282,9 +274,6 @@ siop_sdtr_neg(siop_cmd) continue; if (scf_period[i].period == sync) { /* ok, found it. we now are sync. */ - printf("%s: target %d now synchronous at " - "%sMhz, offset %d\n", sc->sc_dev.dv_xname, - target, scf_period[i].rate, offset); sc->targets[target]->id &= ~(SCNTL3_SCF_MASK << 24); sc->targets[target]->id |= scf_period[i].scf @@ -310,8 +299,6 @@ reject: send_msgout = 1; tables->t_msgout.count= htole32(1); tables->msg_out[0] = MSG_MESSAGE_REJECT; - printf("%s: target %d asynchronous\n", sc->sc_dev.dv_xname, - target); sc->targets[target]->id &= ~(SCNTL3_SCF_MASK << 24); sc->targets[target]->id &= ~(SCNTL3_ULTRA << 24); sc->targets[target]->id &= ~(SXFER_MO_MASK << 8); @@ -333,9 +320,6 @@ reject: continue; if (scf_period[i].period == sync) { /* ok, found it. we now are sync. */ - printf("%s: target %d now synchronous at " - "%sMhz, offset %d\n", sc->sc_dev.dv_xname, - target, scf_period[i].rate, offset); sc->targets[target]->id &= ~(SCNTL3_SCF_MASK << 24); sc->targets[target]->id |= scf_period[i].scf diff --git a/sys/dev/pci/siop_pci_common.c b/sys/dev/pci/siop_pci_common.c index 11b85509fe9..17c0dd9fd30 100644 --- a/sys/dev/pci/siop_pci_common.c +++ b/sys/dev/pci/siop_pci_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siop_pci_common.c,v 1.1 2001/02/15 04:07:58 krw Exp $ */ +/* $OpenBSD: siop_pci_common.c,v 1.2 2001/02/20 00:32:30 krw Exp $ */ /* $NetBSD: siop_pci_common.c,v 1.6 2001/01/10 15:50:20 thorpej Exp $ */ /* @@ -56,37 +56,31 @@ const struct siop_product_desc siop_products[] = { { PCI_PRODUCT_SYMBIOS_810, 0x00, - "Symbios Logic 53c810 (fast scsi)", SF_PCI_RL | SF_CHIP_LS, 4, 8, 3, 250, 0 }, { PCI_PRODUCT_SYMBIOS_810, 0x10, - "Symbios Logic 53c810a (fast scsi)", SF_PCI_RL | SF_PCI_BOF | SF_CHIP_PF | SF_CHIP_LS, 4, 8, 3, 250, 0 }, { PCI_PRODUCT_SYMBIOS_815, 0x00, - "Symbios Logic 53c815 (fast scsi)", SF_PCI_RL | SF_PCI_BOF, 4, 8, 3, 250, 0 }, { PCI_PRODUCT_SYMBIOS_820, 0x00, - "Symbios Logic 53c820 (fast wide scsi)", SF_PCI_RL | SF_CHIP_LS | SF_BUS_WIDE, 4, 8, 3, 250, 0 }, { PCI_PRODUCT_SYMBIOS_825, 0x00, - "Symbios Logic 53c825 (fast wide scsi)", SF_PCI_RL | SF_PCI_BOF | SF_BUS_WIDE, 4, 8, 3, 250, 0 }, { PCI_PRODUCT_SYMBIOS_825, 0x10, - "Symbios Logic 53c825a (fast wide scsi)", SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_LS | SF_CHIP_10REGS | SF_BUS_WIDE, @@ -94,7 +88,6 @@ const struct siop_product_desc siop_products[] = { }, { PCI_PRODUCT_SYMBIOS_860, 0x00, - "Symbios Logic 53c860 (ultra scsi)", SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_PF | SF_CHIP_LS | SF_BUS_ULTRA, @@ -102,7 +95,6 @@ const struct siop_product_desc siop_products[] = { }, { PCI_PRODUCT_SYMBIOS_875, 0x00, - "Symbios Logic 53c875 (ultra-wide scsi)", SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_LS | SF_CHIP_10REGS | SF_BUS_ULTRA | SF_BUS_WIDE, @@ -110,7 +102,6 @@ const struct siop_product_desc siop_products[] = { }, { PCI_PRODUCT_SYMBIOS_875, 0x02, - "Symbios Logic 53c875 (ultra-wide scsi)", SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_DBLR | SF_CHIP_LS | SF_CHIP_10REGS | @@ -119,7 +110,6 @@ const struct siop_product_desc siop_products[] = { }, { PCI_PRODUCT_SYMBIOS_875J, 0x00, - "Symbios Logic 53c875j (ultra-wide scsi)", SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_DBLR | SF_CHIP_LS | SF_CHIP_10REGS | @@ -128,7 +118,6 @@ const struct siop_product_desc siop_products[] = { }, { PCI_PRODUCT_SYMBIOS_885, 0x00, - "Symbios Logic 53c885 (ultra-wide scsi)", SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_DBLR | SF_CHIP_LS | SF_CHIP_10REGS | @@ -137,7 +126,6 @@ const struct siop_product_desc siop_products[] = { }, { PCI_PRODUCT_SYMBIOS_895, 0x00, - "Symbios Logic 53c895 (ultra2-wide scsi)", SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_QUAD | SF_CHIP_LS | SF_CHIP_10REGS | @@ -146,7 +134,6 @@ const struct siop_product_desc siop_products[] = { }, { PCI_PRODUCT_SYMBIOS_896, 0x00, - "Symbios Logic 53c896 (ultra2-wide scsi)", SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_QUAD | SF_CHIP_LS | SF_CHIP_10REGS | @@ -155,7 +142,6 @@ const struct siop_product_desc siop_products[] = { }, { PCI_PRODUCT_SYMBIOS_895A, 0x00, - "Symbios Logic 53c895a (ultra2-wide scsi)", SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_QUAD | SF_CHIP_LS | SF_CHIP_10REGS | @@ -164,7 +150,6 @@ const struct siop_product_desc siop_products[] = { }, { PCI_PRODUCT_SYMBIOS_1510D, 0x00, - "Symbios Logic 53c1510d (ultra2-wide scsi)", SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_QUAD | SF_CHIP_LS | SF_CHIP_10REGS | @@ -173,7 +158,6 @@ const struct siop_product_desc siop_products[] = { }, { 0, 0x00, - NULL, 0x00, 0, 0, 0, 0, 0 }, @@ -190,7 +174,7 @@ siop_lookup_product(id, rev) if (PCI_VENDOR(id) != PCI_VENDOR_SYMBIOS) return NULL; - for (pp = siop_products; pp->name != NULL; pp++) { + for (pp = siop_products; pp->product != 0; pp++) { if (PCI_PRODUCT(id) == pp->product && pp->revision <= rev) if (rp == NULL || pp->revision > rp->revision) rp = pp; @@ -227,7 +211,6 @@ siop_pci_attach_common(sc, pa) sc->siop.ram_size = sc->sc_pp->ram_size; sc->siop.sc_reset = siop_pci_reset; - printf(": %s\n", sc->sc_pp->name); sc->sc_pc = pc; sc->sc_tag = tag; sc->siop.sc_dmat = pa->pa_dmat; @@ -255,7 +238,7 @@ siop_pci_attach_common(sc, pa) sc->siop.sc_rh = ioh; sc->siop.sc_raddr = ioaddr; } else { - printf("%s: unable to map device registers\n", + printf("\n%s: unable to map device registers\n", sc->siop.sc_dev.dv_xname); return 0; } @@ -272,37 +255,33 @@ siop_pci_attach_common(sc, pa) } if (pci_mapreg_map(pa, bar, memtype, 0, &sc->siop.sc_ramt, &sc->siop.sc_ramh, - &sc->siop.sc_scriptaddr, NULL) == 0) { - printf("%s: using on-board RAM\n", - sc->siop.sc_dev.dv_xname); - } else { - printf("%s: can't map on-board RAM\n", - sc->siop.sc_dev.dv_xname); + &sc->siop.sc_scriptaddr, NULL) != 0) sc->siop.features &= ~SF_CHIP_RAM; - } } if (pci_intr_map(pa->pa_pc, pa->pa_intrtag, pa->pa_intrpin, pa->pa_intrline, &intrhandle)) { - printf("%s: couldn't map interrupt\n", + printf("\n%s: couldn't map interrupt\n", sc->siop.sc_dev.dv_xname); return 0; } intrstr = pci_intr_string(pa->pa_pc, intrhandle); sc->sc_ih = pci_intr_establish(pa->pa_pc, intrhandle, IPL_BIO, siop_intr, &sc->siop, sc->siop.sc_dev.dv_xname); - if (sc->sc_ih != NULL) { - printf("%s: interrupting at %s\n", - sc->siop.sc_dev.dv_xname, - intrstr ? intrstr : "unknown interrupt"); - } else { - printf("%s: couldn't establish interrupt", + if (sc->sc_ih != NULL) + printf(": %s, ", (intrstr != NULL) ? intrstr : "irq ?"); + else { + printf("\n%s: couldn't establish interrupt", sc->siop.sc_dev.dv_xname); if (intrstr != NULL) printf(" at %s", intrstr); printf("\n"); return 0; } + + if (sc->siop.features & SF_CHIP_RAM) + printf("has RAM\n"); + return 1; } diff --git a/sys/dev/pci/siop_pci_common.h b/sys/dev/pci/siop_pci_common.h index cc53d21bf53..641b36c7f79 100644 --- a/sys/dev/pci/siop_pci_common.h +++ b/sys/dev/pci/siop_pci_common.h @@ -1,4 +1,4 @@ -/* $OpenBSD: siop_pci_common.h,v 1.1 2001/02/15 04:07:58 krw Exp $ */ +/* $OpenBSD: siop_pci_common.h,v 1.2 2001/02/20 00:32:30 krw Exp $ */ /* $NetBSD: siop_pci_common.h,v 1.2 2000/10/23 14:57:23 bouyer Exp $ */ /* @@ -36,7 +36,6 @@ struct siop_product_desc { u_int32_t product; int revision; - const char *name; int features; /* features are defined in siopvar.h */ u_int8_t maxburst; u_int8_t maxoff; /* maximum supported offset */ -- cgit v1.2.3