Skip to contentSkip to conversation

PATCH [6/15] qla2xxx: Track error-state of SBRs

PATCH Andrew Vasquez 1 participant 1 message Mar 14, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

ChangeSet
1.1662 04/03/01 09:39:39 [email protected] +3 -0 Consistenly track the error-state of a failed SRB.

drivers/scsi/qla2xxx/qla_os.c
1.10 04/03/01 09:37:21 [email protected] +30 -13 Set the error-state of a failed SRB.

drivers/scsi/qla2xxx/qla_isr.c
1.7 04/03/01 09:37:21 [email protected] +4 -0 Set the error-state of a failed SRB.

drivers/scsi/qla2xxx/qla_def.h
1.9 04/03/01 09:37:21 [email protected] +4 -0 Add error-state definitions.

 drivers/scsi/qla2xxx/qla_def.h |    4 +++
 drivers/scsi/qla2xxx/qla_isr.c |    4 +++
 drivers/scsi/qla2xxx/qla_os.c  |   43 ++++++++++++++++++++++++++++-------------
 3 files changed, 38 insertions(+), 13 deletions(-)

ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.00.00b11k/15_track_srb_state.patch

drivers/scsi/qla2xxx/qla_def.h +4 -0
diff -Nru a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
@@ -265,6 +265,10 @@
 	/* Raw completion info for use by failover ? */
 	uint8_t	fo_retry_cnt;		/* Retry count this request */
 	uint8_t	err_id;			/* error id */
+#define SRB_ERR_PORT	1		/* Request failed -- "port down" */
+#define SRB_ERR_LOOP	2		/* Request failed -- "loop down" */
+#define SRB_ERR_DEVICE	3		/* Request failed -- "device error" */
+#define SRB_ERR_OTHER	4
 
 	/* Segment/entries counts */
 	uint16_t	req_cnt;	/* !0 indicates counts determined */
drivers/scsi/qla2xxx/qla_isr.c +4 -0
diff -Nru a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
@@ -1139,6 +1139,10 @@
 		if ((sp->flags & SRB_IOCTL) ||
 		    atomic_read(&fcport->state) == FCS_DEVICE_DEAD) {
 			cp->result = DID_NO_CONNECT << 16;
+			if (atomic_read(&ha->loop_state) == LOOP_DOWN) 
+				sp->err_id = SRB_ERR_LOOP;
+			else
+				sp->err_id = SRB_ERR_PORT;
 			add_to_done_queue(ha, sp);
 		} else {
 			qla2x00_extend_timeout(cp, EXTEND_CMD_TIMEOUT);
drivers/scsi/qla2xxx/qla_os.c +30 -13

92 lines not on this page · raw message