From 72ef32f317c8c60457b4cdca1b9bf7f0b26b6ec1 Mon Sep 17 00:00:00 2001 From: gibbs Date: Thu, 14 Jan 1999 05:57:32 +0000 Subject: Properly handle transfers that only consume partial buffers. --- sys/cam/scsi/scsi_target.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index c7244d8..1095829 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -1,7 +1,7 @@ /* * Implementation of a simple Target Mode SCSI Proccessor Target driver for CAM. * - * Copyright (c) 1998 Justin T. Gibbs. + * Copyright (c) 1998, 1999 Justin T. Gibbs. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_target.c,v 1.5 1998/12/15 08:15:15 gibbs Exp $ + * $Id: scsi_target.c,v 1.6 1998/12/17 00:03:14 gibbs Exp $ */ #include /* For offsetof */ @@ -1439,16 +1439,20 @@ targdone(struct cam_periph *periph, union ccb *done_ccb) break; } - if (desc->bp != NULL) - panic("targ%d: desc->bp should be NULL", - periph->unit_number); - /* Queue us up for another buffer */ if (atio->cdb_io.cdb_bytes[0] == SEND) { + if (desc->bp != NULL) + TAILQ_INSERT_HEAD( + &softc->snd_buf_queue.queue, + bp, b_act); TAILQ_INSERT_HEAD(&softc->snd_ccb_queue, &atio->ccb_h, periph_links.tqe); } else { + if (desc->bp != NULL) + TAILQ_INSERT_HEAD( + &softc->rcv_buf_queue.queue, + bp, b_act); TAILQ_INSERT_HEAD(&softc->rcv_ccb_queue, &atio->ccb_h, periph_links.tqe); -- cgit v1.1