summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1999-01-14 05:57:32 +0000
committergibbs <gibbs@FreeBSD.org>1999-01-14 05:57:32 +0000
commit72ef32f317c8c60457b4cdca1b9bf7f0b26b6ec1 (patch)
tree6e6b3abdc500bbf7a0fa347ead390decb7fa1fb2 /sys/cam
parent8f6fb7db78e6149ac87c3cb61409a506eb88ce0b (diff)
downloadFreeBSD-src-72ef32f317c8c60457b4cdca1b9bf7f0b26b6ec1.zip
FreeBSD-src-72ef32f317c8c60457b4cdca1b9bf7f0b26b6ec1.tar.gz
Properly handle transfers that only consume partial buffers.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_target.c16
1 files 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 <stddef.h> /* 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);
OpenPOWER on IntegriCloud