diff options
author | mjacob <mjacob@FreeBSD.org> | 2003-06-02 00:37:42 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2003-06-02 00:37:42 +0000 |
commit | e0c52ae7b658a39221e5d05719a41515aba682a3 (patch) | |
tree | edf7ca9f98ab7dde8fb32039f850105f9f338b1d /sys | |
parent | f00e6d17daded665d13ee69b0ad13942b8ed294f (diff) | |
download | FreeBSD-src-e0c52ae7b658a39221e5d05719a41515aba682a3.zip FreeBSD-src-e0c52ae7b658a39221e5d05719a41515aba682a3.tar.gz |
Check in some months long pending minor debug output changes.
Clarify that the implicit fallthrough was *not* intentional (thanks, Poul!)
and reorganize the code so a correct fallthrough (with /* FALLTHROUGH */)
occurs.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/cam/scsi/scsi_sa.c | 73 |
1 files changed, 47 insertions, 26 deletions
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index e8027e1..74a3382 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -735,13 +735,17 @@ sastrategy(struct bio *bp) * Place it at the end of the queue. */ bioq_insert_tail(&softc->bio_queue, bp); - softc->queue_count++; - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("sastrategy: enqueuing a %d " - "%s byte %s queue count now %d\n", (int) bp->bio_bcount, - (softc->flags & SA_FLAG_FIXED)? "fixed" : "variable", - (bp->bio_cmd == BIO_READ)? "read" : "write", softc->queue_count)); - +#if 0 + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + ("sastrategy: queuing a %ld %s byte %s\n", bp->bio_bcount, + (softc->flags & SA_FLAG_FIXED)? "fixed" : "variable", + (bp->bio_cmd == BIO_READ)? "read" : "write")); +#endif + if (softc->queue_count > 1) { + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + ("sastrategy: queue count now %d\n", softc->queue_count)); + } splx(s); /* @@ -1507,7 +1511,7 @@ sastart(struct cam_periph *periph, union ccb *start_ccb) softc = (struct sa_softc *)periph->softc; - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("sastart")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sastart\n")); switch (softc->state) { @@ -1600,12 +1604,20 @@ again: biodone(bp); break; } - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("Fixed Record Count is %d\n", length)); +#if 0 + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO, + ("issuing a %d fixed record %s\n", + length, (bp->bio_cmd == BIO_READ)? "read" : + "write")); +#endif } else { length = bp->bio_bcount; +#if 0 CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("Variable Record Count is %d\n", length)); + ("issuing a %d variable byte %s\n", + length, (bp->bio_cmd == BIO_READ)? "read" : + "write")); +#endif } devstat_start_transaction_bio(softc->device_stats, bp); /* @@ -2780,6 +2792,21 @@ retry: * the saved value. */ switch (ccomp->hdr.pagecode & ~0x80) { + case SA_DEVICE_CONFIGURATION_PAGE: + { + struct scsi_dev_conf_page *dcp = &cpage->dconf; + if (calg == 0) { + dcp->sel_comp_alg = SA_COMP_NONE; + break; + } + if (calg != MT_COMP_ENABLE) { + dcp->sel_comp_alg = calg; + } else if (dcp->sel_comp_alg == SA_COMP_NONE && + softc->saved_comp_algorithm != 0) { + dcp->sel_comp_alg = softc->saved_comp_algorithm; + } + break; + } case SA_DATA_COMPRESSION_PAGE: if (ccomp->dcomp.dce_and_dcc & SA_DCP_DCC) { struct scsi_data_compression_page *dcp = &cpage->dcomp; @@ -2815,22 +2842,16 @@ retry: } break; } - /* XXX: fall-through intentional ? */ - case SA_DEVICE_CONFIGURATION_PAGE: - { - struct scsi_dev_conf_page *dcp = &cpage->dconf; - if (calg == 0) { - dcp->sel_comp_alg = SA_COMP_NONE; - break; - } - if (calg != MT_COMP_ENABLE) { - dcp->sel_comp_alg = calg; - } else if (dcp->sel_comp_alg == SA_COMP_NONE && - softc->saved_comp_algorithm != 0) { - dcp->sel_comp_alg = softc->saved_comp_algorithm; - } - break; - } + /* + * Compression does not appear to be supported- + * at least via the DATA COMPRESSION page. It + * would be too much to ask us to believe that + * the page itself is supported, but incorrectly + * reports an ability to manipulate data compression, + * so we'll assume that this device doesn't support + * compression. We can just fall through for that. + */ + /* FALLTHROUGH */ default: /* * The drive doesn't seem to support compression, |