summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2004-12-20 20:56:33 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2004-12-20 20:56:33 +0000
commit599e6dc3665a06e580c701c66e5732de173dbf8a (patch)
tree0dacb8e789ff261ed45ae613bbbd04eb360d3887 /sys/dev/ic
parentd13069623678a3b7fca87169db73232db87fc4f4 (diff)
Activate packetized status handling.
ok tdeval@.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/aic79xx.c4
-rw-r--r--sys/dev/ic/aic79xx_openbsd.c28
-rw-r--r--sys/dev/ic/aic79xx_openbsd.h3
3 files changed, 10 insertions, 25 deletions
diff --git a/sys/dev/ic/aic79xx.c b/sys/dev/ic/aic79xx.c
index 3ccc1c06112..979cd38b77a 100644
--- a/sys/dev/ic/aic79xx.c
+++ b/sys/dev/ic/aic79xx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic79xx.c,v 1.23 2004/12/19 06:17:54 krw Exp $ */
+/* $OpenBSD: aic79xx.c,v 1.24 2004/12/20 20:56:32 krw Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -8081,7 +8081,6 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
aic_set_transaction_status(scb, CAM_SCSI_STATUS_ERROR);
aic_set_scsi_status(scb, hscb->shared_data.istatus.scsi_status);
switch (hscb->shared_data.istatus.scsi_status) {
-#if 0
case STATUS_PKT_SENSE:
{
struct scsi_status_iu_header *siu;
@@ -8142,7 +8141,6 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
ahd_done(ahd, scb);
break;
}
-#endif
case SCSI_STATUS_CMD_TERMINATED:
case SCSI_STATUS_CHECK_COND:
{
diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c
index 2424c40979c..c89ea082ea0 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.14 2004/12/19 06:17:54 krw Exp $ */
+/* $OpenBSD: aic79xx_openbsd.c,v 1.15 2004/12/20 20:56:32 krw Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -286,30 +286,16 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
memcpy(&xs->sense, ahd_get_sense_buf(ahd, scb),
sizeof(struct scsi_sense_data));
xs->error = XS_SENSE;
-#if 0
} else if ((scb->flags & SCB_PKT_SENSE) != 0) {
struct scsi_status_iu_header *siu;
- u_int sense_len;
- int i;
-
- /*
- * Copy only the sense data into the provided buffer.
- */
- siu = (struct scsi_status_iu_header *)scb->sense_data;
- sense_len = MIN(scsi_4btoul(siu->sense_length),
- sizeof(struct scsi_sense_data));
- memset(&xs->sense, 0, &xs->sense);
- memcpy(&xs->sense,
- ahd_get_sense_buf(ahd, scb) + SIU_SENSE_OFFSET(siu),
- sense_len);
- printf("Copied %d bytes of sense data offset %d:", sense_len,
- SIU_SENSE_OFFSET(siu));
- for (i = 0; i < sense_len; i++)
- printf(" 0x%x", ((uint8_t *)&xs->sense)[i]);
- printf("\n");
+ u_int32_t len;
+ siu = (struct scsi_status_iu_header *)scb->sense_data;
+ len = SIU_SENSE_LENGTH(siu);
+ memset(&xs->sense, 0, sizeof(xs->sense));
+ memcpy(&xs->sense, SIU_SENSE_DATA(siu),
+ ulmin(len, sizeof(xs->sense)));
xs->error = XS_SENSE;
-#endif
}
#if 0 /* MU: no such settings in ahc */
if (scb->flags & SCB_REQUEUE)
diff --git a/sys/dev/ic/aic79xx_openbsd.h b/sys/dev/ic/aic79xx_openbsd.h
index 5e1599e2e71..630e2691a90 100644
--- a/sys/dev/ic/aic79xx_openbsd.h
+++ b/sys/dev/ic/aic79xx_openbsd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic79xx_openbsd.h,v 1.12 2004/12/18 18:29:56 krw Exp $ */
+/* $OpenBSD: aic79xx_openbsd.h,v 1.13 2004/12/20 20:56:32 krw Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -210,6 +210,7 @@ void ahd_flush_device_writes(struct ahd_softc *);
#define ahd_list_unlock(flags) splx(*(flags))
/****************************** OS Primitives *********************************/
+#define scsi_4btoul(b) (_4btol(b))
/************************** Transaction Operations ****************************/
#define aic_set_transaction_status(scb, status) (scb)->xs->error = (status)