summaryrefslogtreecommitdiffstats
path: root/sys/scsi/worm.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-10-09 15:15:01 +0000
committerjoerg <joerg@FreeBSD.org>1995-10-09 15:15:01 +0000
commitbe110e87c8873066ed715a2b47fc226a507834fa (patch)
tree528f0d8ee4f1a3c9edf2330d9de3a1a175ba1e7d /sys/scsi/worm.c
parentd14a472e3c19071941d1325fe53e559d5afffae3 (diff)
downloadFreeBSD-src-be110e87c8873066ed715a2b47fc226a507834fa.zip
FreeBSD-src-be110e87c8873066ed715a2b47fc226a507834fa.tar.gz
Some bug fixes for the worm driver:
o don't use polled mode after the device probe phase o don't biodone() a NULL buffer pointer o increase the timeout for scsi_read_capacity(); WORMs are slooow o make WORMMs known to scsiconf at all This brings the driver in a state where it at least doesn't immediately panic, nor hangs the controller any more. Unfortunately, at least the YAMAHA CDR100 i've been testing with answered my write attempts with an "Incorrect command sequence" response. Perhaps other CD burners might work however. Reviewed by: dufault
Diffstat (limited to 'sys/scsi/worm.c')
-rw-r--r--sys/scsi/worm.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/scsi/worm.c b/sys/scsi/worm.c
index 9f5375d..8c5a2eb 100644
--- a/sys/scsi/worm.c
+++ b/sys/scsi/worm.c
@@ -37,7 +37,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: worm.c,v 1.6 1995/05/03 23:53:32 dufault Exp $
+ * $Id: worm.c,v 1.7 1995/05/30 08:13:58 rgrimes Exp $
*/
/* XXX This is PRELIMINARY.
@@ -101,14 +101,17 @@ struct scsi_device worm_switch =
worm_strategy,
};
-static int worm_size(struct scsi_link *sc_link)
+static int worm_size(struct scsi_link *sc_link, int flags)
{
int ret;
struct scsi_data *worm = sc_link->sd;
worm->n_blks = scsi_read_capacity(sc_link, &worm->blk_size,
- SCSI_NOSLEEP | SCSI_NOMASK);
+ flags);
+ if(worm->blk_size == 0)
+ /* XXX */
+ worm->blk_size = 2048;
if (worm->n_blks)
{
sc_link->flags |= SDEV_MEDIA_LOADED;
@@ -130,11 +133,10 @@ wormattach(struct scsi_link *sc_link)
printf("- UNTESTED ");
- if (worm_size(sc_link) == 0)
+ if (worm_size(sc_link, SCSI_NOSLEEP | SCSI_NOMASK) == 0)
printf("- can't get capacity.");
else
printf("with %ld %ld byte blocks.", worm->n_blks, worm->blk_size);
-
return 0;
}
@@ -241,9 +243,11 @@ wormstart(unit, flags)
} else {
badnews:
printf("worm%ld: oops not queued\n", unit);
- bp->b_flags |= B_ERROR;
- bp->b_error = EIO;
- biodone(bp);
+ if (bp) {
+ bp->b_flags |= B_ERROR;
+ bp->b_error = EIO;
+ biodone(bp);
+ }
}
} /* go back and see if we can cram more work in.. */
}
@@ -337,7 +341,7 @@ struct scsi_link *sc_link)
scsi_prevent(sc_link, PR_PREVENT, SCSI_SILENT);
- if (worm_size(sc_link) == 0) {
+ if (worm_size(sc_link, 0) == 0) {
scsi_stop_unit(sc_link, 0, SCSI_SILENT);
scsi_prevent(sc_link, PR_ALLOW, SCSI_SILENT);
sc_link->flags &= ~SDEV_OPEN;
OpenPOWER on IntegriCloud