summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2004-08-13 23:38:55 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2004-08-13 23:38:55 +0000
commit6230a02147b92e9f7ccc878a8af3016910aea345 (patch)
treee563464f15ccdf2f59cad8eddcba83451bbeedfc /sys/dev/ic
parentf3936768351d58355a1a0f35a1a36ea9d6b7d04b (diff)
Fix issue with auto request sense handling for both ahc and ahd.
Restore hppa functionality, add sgi functionality for ahc. ok deraadt@, plus marco@, mickey@, pefo@ for various bits.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/aic79xx_openbsd.c3
-rw-r--r--sys/dev/ic/aic7xxx.c45
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.c3
3 files changed, 46 insertions, 5 deletions
diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c
index cff4c967f9f..c527b5916a7 100644
--- a/sys/dev/ic/aic79xx_openbsd.c
+++ b/sys/dev/ic/aic79xx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic79xx_openbsd.c,v 1.6 2004/08/06 01:29:19 marco Exp $ */
+/* $OpenBSD: aic79xx_openbsd.c,v 1.7 2004/08/13 23:38:54 krw Exp $ */
/*
* Bus independent OpenBSD shim for the aic79xx based Adaptec SCSI controllers
*
@@ -195,6 +195,7 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
/* Translate the CAM status code to a SCSI error code. */
switch (xs->error) {
+ case CAM_SCSI_STATUS_ERROR:
case CAM_REQ_INPROG:
case CAM_REQ_CMP:
switch (xs->status) {
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c
index 11e5fc0b325..52496ee1724 100644
--- a/sys/dev/ic/aic7xxx.c
+++ b/sys/dev/ic/aic7xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx.c,v 1.58 2004/08/01 01:36:23 krw Exp $ */
+/* $OpenBSD: aic7xxx.c,v 1.59 2004/08/13 23:38:54 krw Exp $ */
/* $NetBSD: aic7xxx.c,v 1.108 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -40,7 +40,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: aic7xxx.c,v 1.58 2004/08/01 01:36:23 krw Exp $
+ * $Id: aic7xxx.c,v 1.59 2004/08/13 23:38:54 krw Exp $
*/
/*
* Ported from FreeBSD by Pascal Renauld, Network Storage Solutions, Inc. - April 2003
@@ -332,6 +332,33 @@ ahc_run_qoutfifo(struct ahc_softc *ahc)
while (ahc->qoutfifo[ahc->qoutfifonext] != SCB_LIST_NULL) {
scb_index = ahc->qoutfifo[ahc->qoutfifonext];
+#ifdef __sgi__
+ if ((ahc->qoutfifonext & 0x1f) == 0x1f) {
+ u_int modnext;
+ u_int32_t *nextp;
+
+ /*
+ * Clear 32 bytes of QOUTFIFO at a time
+ * so that we don't clobber an incoming
+ * byte DMA to the array on architectures
+ * non coherent caches.
+ */
+ modnext = ahc->qoutfifonext & ~0x1f;
+ nextp = (uint32_t *)(&ahc->qoutfifo[modnext]);
+ *nextp++ = 0xFFFFFFFFUL;
+ *nextp++ = 0xFFFFFFFFUL;
+ *nextp++ = 0xFFFFFFFFUL;
+ *nextp++ = 0xFFFFFFFFUL;
+ *nextp++ = 0xFFFFFFFFUL;
+ *nextp++ = 0xFFFFFFFFUL;
+ *nextp++ = 0xFFFFFFFFUL;
+ *nextp++ = 0xFFFFFFFFUL;
+ ahc_dmamap_sync(ahc, ahc->parent_dmat /*shared_data_dmat*/,
+ ahc->shared_data_dmamap,
+ /*offset*/modnext, /*len*/32,
+ BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
+ }
+#else
if ((ahc->qoutfifonext & 0x03) == 0x03) {
u_int modnext;
@@ -349,6 +376,7 @@ ahc_run_qoutfifo(struct ahc_softc *ahc)
/*offset*/modnext, /*len*/4,
BUS_DMASYNC_PREREAD);
}
+#endif
ahc->qoutfifonext++;
scb = ahc_lookup_scb(ahc, scb_index);
@@ -4538,8 +4566,11 @@ ahc_chip_init(struct ahc_softc *ahc)
/* All of our queues are empty */
for (i = 0; i < 256; i++)
ahc->qoutfifo[i] = SCB_LIST_NULL;
+#ifdef __sgi__
+ ahc_sync_qoutfifo(ahc, BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
+#else
ahc_sync_qoutfifo(ahc, BUS_DMASYNC_PREREAD);
-
+#endif
for (i = 0; i < 256; i++)
ahc->qinfifo[i] = SCB_LIST_NULL;
@@ -4752,7 +4783,11 @@ ahc_init(struct ahc_softc *ahc)
/* All target command blocks start out invalid. */
for (i = 0; i < AHC_TMODE_CMDS; i++)
ahc->targetcmds[i].cmd_valid = 0;
+#ifdef __sgi__
+ ahc_sync_tqinfifo(ahc, BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
+#else
ahc_sync_tqinfifo(ahc, BUS_DMASYNC_PREREAD);
+#endif
ahc->qoutfifo = (uint8_t *)&ahc->targetcmds[256];
}
ahc->qinfifo = &ahc->qoutfifo[256];
@@ -7206,7 +7241,11 @@ ahc_run_tqinfifo(struct ahc_softc *ahc, int paused)
ahc->shared_data_dmamap,
ahc_targetcmd_offset(ahc, ahc->tqinfifonext),
sizeof(struct target_cmd),
+#ifdef __sgi__
+ BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
+#else
BUS_DMASYNC_PREREAD);
+#endif
ahc->tqinfifonext++;
/*
diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c
index 1e18c4c3fe4..08d48fd875d 100644
--- a/sys/dev/ic/aic7xxx_openbsd.c
+++ b/sys/dev/ic/aic7xxx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.c,v 1.22 2004/08/01 01:36:23 krw Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.c,v 1.23 2004/08/13 23:38:54 krw Exp $ */
/* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -235,6 +235,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
/* Translate the CAM status code to a SCSI error code. */
switch (xs->error) {
+ case CAM_SCSI_STATUS_ERROR:
case CAM_REQ_INPROG:
case CAM_REQ_CMP:
switch (xs->status) {