summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/isp_sbus.c
diff options
context:
space:
mode:
authormjacob <mjacob@cvs.openbsd.org>2000-02-20 21:24:20 +0000
committermjacob <mjacob@cvs.openbsd.org>2000-02-20 21:24:20 +0000
commiteac3d63ea115546cf1b764d16f8e6347f3ed2a00 (patch)
tree47604d0d8833ce8ea1815fb953d2dd8a67a1f2a8 /sys/arch/sparc/dev/isp_sbus.c
parent843be39a687253a9894847550ed56ea58510c179 (diff)
Add support for CDBs > 12 bytes.
Diffstat (limited to 'sys/arch/sparc/dev/isp_sbus.c')
-rw-r--r--sys/arch/sparc/dev/isp_sbus.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/sys/arch/sparc/dev/isp_sbus.c b/sys/arch/sparc/dev/isp_sbus.c
index e78e40272a4..01ea23d09da 100644
--- a/sys/arch/sparc/dev/isp_sbus.c
+++ b/sys/arch/sparc/dev/isp_sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp_sbus.c,v 1.10 2000/01/09 22:43:18 mjacob Exp $ */
+/* $OpenBSD: isp_sbus.c,v 1.11 2000/02/20 21:24:19 mjacob Exp $ */
/* release_03_25_99 */
/*
* SBus specific probe and attach routines for Qlogic ISP SCSI adapters.
@@ -120,7 +120,7 @@ isp_match(parent, cfarg, aux)
#ifdef DEBUG
if (rv && oneshot) {
oneshot = 0;
- printf("Qlogic ISP Driver, NetBSD (sbus) Platform Version "
+ printf("Qlogic ISP Driver, OpenBSD (sbus) Platform Version "
"%d.%d Core Version %d.%d\n",
ISP_PLATFORM_VERSION_MAJOR, ISP_PLATFORM_VERSION_MINOR,
ISP_CORE_VERSION_MAJOR, ISP_CORE_VERSION_MINOR);
@@ -358,6 +358,7 @@ isp_sbus_dmasetup(isp, xs, rq, iptrp, optr)
u_int16_t optr;
{
struct isp_sbussoftc *sbc = (struct isp_sbussoftc *) isp;
+ ispcontreq_t *crq;
vaddr_t kdvma;
int dosleep = (xs->flags & SCSI_NOSLEEP) != 0;
@@ -365,6 +366,17 @@ isp_sbus_dmasetup(isp, xs, rq, iptrp, optr)
rq->req_seg_count = 1;
goto mbxsync;
}
+ if (XS_CDBLEN(xs) > 12) {
+ crq = (ispcontreq_t *) ISP_QUEUE_ENTRY(isp->isp_rquest, *iptrp);
+ *iptrp = (*iptrp + 1) & (RQUEST_QUEUE_LEN - 1);
+ if (*iptrp == optr) {
+ printf("%s: Request Queue Overflow++\n", isp->isp_name);
+ XS_SETERR(xs, HBA_BOTCH);
+ return (CMD_COMPLETE);
+ }
+ } else {
+ crq = NULL;
+ }
assert(rq->req_handle != 0 && rq->req_handle <= isp->isp_maxcmds);
if (CPU_ISSUN4M) {
@@ -388,9 +400,19 @@ isp_sbus_dmasetup(isp, xs, rq, iptrp, optr)
} else {
rq->req_flags |= REQFLAG_DATA_OUT;
}
- rq->req_dataseg[0].ds_count = xs->datalen;
- rq->req_dataseg[0].ds_base = (u_int32_t) kdvma;
- rq->req_seg_count = 1;
+ if (crq) {
+ rq->req_seg_count = 2;
+ bzero((void *)crq, sizeof (*crq));
+ crq->req_header.rqs_entry_count = 1;
+ crq->req_header.rqs_entry_type = RQSTYPE_DATASEG;
+ crq->req_dataseg[0].ds_count = xs->datalen;
+ crq->req_dataseg[0].ds_base = (u_int32_t) kdvma;
+ ISP_SWIZZLE_CONTINUATION(isp, crq);
+ } else {
+ rq->req_dataseg[0].ds_count = xs->datalen;
+ rq->req_dataseg[0].ds_base = (u_int32_t) kdvma;
+ rq->req_seg_count = 1;
+ }
mbxsync:
ISP_SWIZZLE_REQUEST(isp, rq);