summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/isp_sbus.c
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1997-09-17 06:47:23 +0000
committerJason Downs <downsj@cvs.openbsd.org>1997-09-17 06:47:23 +0000
commita53c76d8206c35d6e769479df16512e32cecd314 (patch)
treed859e8328321d144b06be62b083047a6c9bf62b7 /sys/arch/sparc/dev/isp_sbus.c
parent98c6f7749315311376108135d25b0d86a7f8320a (diff)
NETBSD_CURRENT_970916. Lot's just ID changes, since changes don't apply to
us. Includes some pmap changes, for which I don't have the original commit message(s) handy.
Diffstat (limited to 'sys/arch/sparc/dev/isp_sbus.c')
-rw-r--r--sys/arch/sparc/dev/isp_sbus.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/sys/arch/sparc/dev/isp_sbus.c b/sys/arch/sparc/dev/isp_sbus.c
index 24fcb5caec2..a2d846f7b94 100644
--- a/sys/arch/sparc/dev/isp_sbus.c
+++ b/sys/arch/sparc/dev/isp_sbus.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: isp_sbus.c,v 1.1 1997/08/08 08:25:15 downsj Exp $ */
-/* $NetBSD: isp_sbus.c,v 1.6 1997/06/08 06:35:45 thorpej Exp $ */
+/* $OpenBSD: isp_sbus.c,v 1.2 1997/09/17 06:47:10 downsj Exp $ */
+/* $NetBSD: isp_sbus.c,v 1.8 1997/08/27 11:24:19 bouyer Exp $ */
/*
* SBus specific probe and attach routines for Qlogic ISP SCSI adapters.
@@ -57,9 +57,9 @@
static u_int16_t isp_sbus_rd_reg __P((struct ispsoftc *, int));
static void isp_sbus_wr_reg __P((struct ispsoftc *, int, u_int16_t));
static int isp_sbus_mbxdma __P((struct ispsoftc *));
-static int isp_sbus_dmasetup __P((struct ispsoftc *, struct scsi_xfer *,
+static int isp_sbus_dmasetup __P((struct ispsoftc *, struct scsipi_xfer *,
ispreq_t *, u_int8_t *, u_int8_t));
-static void isp_sbus_dmateardown __P((struct ispsoftc *, struct scsi_xfer *,
+static void isp_sbus_dmateardown __P((struct ispsoftc *, struct scsipi_xfer *,
u_int32_t));
static struct ispmdvec mdvec = {
@@ -70,19 +70,23 @@ static struct ispmdvec mdvec = {
isp_sbus_dmateardown,
NULL,
NULL,
+ NULL,
ISP_RISC_CODE,
ISP_CODE_LENGTH,
ISP_CODE_ORG,
+ ISP_CODE_VERSION,
+ 0,
0
};
struct isp_sbussoftc {
struct ispsoftc sbus_isp;
+ sdparam sbus_dev;
struct intrhand sbus_ih;
volatile u_char *sbus_reg;
int sbus_node;
int sbus_pri;
- vm_offset_t sbus_kdma_allocs[RQUEST_QUEUE_LEN];
+ vm_offset_t sbus_kdma_allocs[MAXISPREQUEST];
};
@@ -137,6 +141,9 @@ isp_sbus_attach(parent, self, aux)
sbc->sbus_node = ca->ca_ra.ra_node;
sbc->sbus_isp.isp_mdvec = &mdvec;
+ sbc->sbus_isp.isp_type = ISP_HA_SCSI_UNKNOWN;
+ sbc->sbus_isp.isp_param = &sbc->sbus_dev;
+ bzero(sbc->sbus_isp.isp_param, sizeof (sdparam));
isp_reset(&sbc->sbus_isp);
if (sbc->sbus_isp.isp_state != ISP_RESETSTATE) {
return;
@@ -224,7 +231,7 @@ isp_sbus_mbxdma(isp)
/*
* Allocate and map the request queue.
*/
- len = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN);
+ len = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp));
isp->isp_rquest = (volatile caddr_t)malloc(len, M_DEVBUF, M_NOWAIT);
if (isp->isp_rquest == 0)
return (1);
@@ -236,7 +243,7 @@ isp_sbus_mbxdma(isp)
/*
* Allocate and map the result queue.
*/
- len = ISP_QUEUE_SIZE(RESULT_QUEUE_LEN);
+ len = ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp));
isp->isp_result = (volatile caddr_t)malloc(len, M_DEVBUF, M_NOWAIT);
if (isp->isp_result == 0)
return (1);
@@ -266,11 +273,11 @@ isp_sbus_dmasetup(isp, xs, rq, iptrp, optr)
if (xs->datalen == 0) {
rq->req_seg_count = 1;
- rq->req_flags |= REQFLAG_DATA_IN;
return (0);
}
- if (rq->req_handle >= RQUEST_QUEUE_LEN) {
+ if (rq->req_handle > RQUEST_QUEUE_LEN(isp) ||
+ rq->req_handle < 1) {
panic("%s: bad handle (%d) in isp_sbus_dmasetup\n",
isp->isp_name, rq->req_handle);
/* NOTREACHED */
@@ -285,11 +292,11 @@ isp_sbus_dmasetup(isp, xs, rq, iptrp, optr)
kdvma = (vm_offset_t) xs->data;
}
- if (sbc->sbus_kdma_allocs[rq->req_handle] != (vm_offset_t) 0) {
+ if (sbc->sbus_kdma_allocs[rq->req_handle - 1] != (vm_offset_t) 0) {
panic("%s: kdma handle already allocated\n", isp->isp_name);
/* NOTREACHED */
}
- sbc->sbus_kdma_allocs[rq->req_handle] = kdvma;
+ sbc->sbus_kdma_allocs[rq->req_handle - 1] = kdvma;
if (xs->flags & SCSI_DATA_IN) {
rq->req_flags |= REQFLAG_DATA_IN;
} else {
@@ -314,7 +321,7 @@ isp_sbus_dmateardown(isp, xs, handle)
cpuinfo.cache_flush(xs->data, xs->datalen - xs->resid);
}
- if (handle >= RQUEST_QUEUE_LEN) {
+ if (handle >= RQUEST_QUEUE_LEN(isp)) {
panic("%s: bad handle (%d) in isp_sbus_dmateardown\n",
isp->isp_name, handle);
/* NOTREACHED */