diff options
author | mjacob <mjacob@FreeBSD.org> | 2003-09-13 01:58:26 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2003-09-13 01:58:26 +0000 |
commit | 52ffcfe4b524f3c227254994fb0bc6390af22de9 (patch) | |
tree | c35b0715dfcc4dbb79e97cae0c1614b7f3b3332b /sys/dev/isp | |
parent | bed4d9c166fed8b431ae7ee49d7671250c7ad5ff (diff) | |
download | FreeBSD-src-52ffcfe4b524f3c227254994fb0bc6390af22de9.zip FreeBSD-src-52ffcfe4b524f3c227254994fb0bc6390af22de9.tar.gz |
Some ridiculous target mode botches- like having the wrong definitions
for messages. Some spelling fixes. Some target mode structure cleanups
to reflect reality.
Diffstat (limited to 'sys/dev/isp')
-rw-r--r-- | sys/dev/isp/isp_target.c | 24 | ||||
-rw-r--r-- | sys/dev/isp/isp_target.h | 42 |
2 files changed, 34 insertions, 32 deletions
diff --git a/sys/dev/isp/isp_target.c b/sys/dev/isp/isp_target.c index 9d23805..4f7d599 100644 --- a/sys/dev/isp/isp_target.c +++ b/sys/dev/isp/isp_target.c @@ -363,7 +363,7 @@ isp_target_put_entry(struct ispsoftc *isp, void *ap) return (-1); } - ISP_TDQE(isp, "isp_target_put_entry", (int) optr, ap);; + ISP_TDQE(isp, "isp_target_put_entry", (int) optr, ap); ISP_ADD_REQUEST(isp, nxti); return (0); } @@ -539,6 +539,11 @@ isp_target_async(struct ispsoftc *isp, int bus, int event) msg.nt_msg[0] = MSG_BUS_DEV_RESET; (void) isp_async(isp, ISPASYNC_TARGET_MESSAGE, &msg); break; + case ASYNC_CTIO_DONE: + evt.ev_bus = bus; + evt.ev_event = event; + (void) isp_async(isp, ISPASYNC_TARGET_EVENT, &evt); + return (0); default: isp_prt(isp, ISP_LOGERR, "isp_target_async: unknown event 0x%x", event); @@ -611,14 +616,18 @@ isp_got_msg_fc(struct ispsoftc *isp, int bus, in_fcentry_t *inp) msg.nt_tagval = inp->in_seqid; msg.nt_lun = lun; - if (inp->in_task_flags & TASK_FLAGS_ABORT_TASK) { - isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK", + if (inp->in_task_flags & TASK_FLAGS_ABORT_TASK_SET) { + isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK SET", inp->in_iid, lun, inp->in_seqid); - msg.nt_msg[0] = MSG_ABORT_TAG; + msg.nt_msg[0] = MSG_ABORT; } else if (inp->in_task_flags & TASK_FLAGS_CLEAR_TASK_SET) { isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET", inp->in_iid, lun, inp->in_seqid); msg.nt_msg[0] = MSG_CLEAR_QUEUE; + } else if (inp->in_task_flags & TASK_FLAGS_LUN_RESET) { + isp_prt(isp, ISP_LOGINFO, f1, "LUN RESET", + inp->in_iid, lun, inp->in_seqid); + msg.nt_msg[0] = MSG_LUN_RESET; } else if (inp->in_task_flags & TASK_FLAGS_TARGET_RESET) { isp_prt(isp, ISP_LOGINFO, f1, "TARGET RESET", inp->in_iid, lun, inp->in_seqid); @@ -626,12 +635,7 @@ isp_got_msg_fc(struct ispsoftc *isp, int bus, in_fcentry_t *inp) } else if (inp->in_task_flags & TASK_FLAGS_CLEAR_ACA) { isp_prt(isp, ISP_LOGINFO, f1, "CLEAR ACA", inp->in_iid, lun, inp->in_seqid); - /* ???? */ msg.nt_msg[0] = MSG_REL_RECOVERY; - } else if (inp->in_task_flags & TASK_FLAGS_TERMINATE_TASK) { - isp_prt(isp, ISP_LOGINFO, f1, "TERMINATE TASK", - inp->in_iid, lun, inp->in_seqid); - msg.nt_msg[0] = MSG_TERM_IO_PROC; } else { isp_prt(isp, ISP_LOGWARN, f2, "task flag", inp->in_status, lun, inp->in_iid, @@ -1091,7 +1095,7 @@ isp_handle_ctio2(struct ispsoftc *isp, ct2_entry_t *ct) /* * CTIO rejected by the firmware - invalid data direction. */ - isp_prt(isp, ISP_LOGERR, "CTIO2 had wrong data directiond"); + isp_prt(isp, ISP_LOGERR, "CTIO2 had wrong data direction"); break; case CT_RSELTMO: diff --git a/sys/dev/isp/isp_target.h b/sys/dev/isp/isp_target.h index c59e59a..c0bbc89 100644 --- a/sys/dev/isp/isp_target.h +++ b/sys/dev/isp/isp_target.h @@ -36,11 +36,8 @@ #ifndef _ISP_TARGET_H #define _ISP_TARGET_H -/* - * Defines for all entry types - */ +#define QLTM_SENSELEN 18 /* non-FC cards only */ #define QLTM_SVALID 0x80 -#define QLTM_SENSELEN 18 /* * Structure for Enable Lun and Modify Lun queue entries @@ -141,28 +138,33 @@ typedef struct { /* * Values for the in_task_flags field- should only get one at a time! */ -#define TASK_FLAGS_ABORT_TASK (1<<9) -#define TASK_FLAGS_CLEAR_TASK_SET (1<<10) -#define TASK_FLAGS_TARGET_RESET (1<<13) #define TASK_FLAGS_CLEAR_ACA (1<<14) -#define TASK_FLAGS_TERMINATE_TASK (1<<15) +#define TASK_FLAGS_TARGET_RESET (1<<13) +#define TASK_FLAGS_LUN_RESET (1<<12) +#define TASK_FLAGS_CLEAR_TASK_SET (1<<10) +#define TASK_FLAGS_ABORT_TASK_SET (1<<9) +#ifndef MSG_ABORT +#define MSG_ABORT 0x06 +#endif +#ifndef MSG_BUS_DEV_RESET +#define MSG_BUS_DEV_RESET 0x0c +#endif #ifndef MSG_ABORT_TAG -#define MSG_ABORT_TAG 0x06 +#define MSG_ABORT_TAG 0x0d #endif #ifndef MSG_CLEAR_QUEUE #define MSG_CLEAR_QUEUE 0x0e #endif -#ifndef MSG_BUS_DEV_RESET -#define MSG_BUS_DEV_RESET 0x0b -#endif #ifndef MSG_REL_RECOVERY #define MSG_REL_RECOVERY 0x10 #endif #ifndef MSG_TERM_IO_PROC #define MSG_TERM_IO_PROC 0x11 #endif - +#ifndef MSG_LUN_RESET +#define MSG_LUN_RESET 0x17 +#endif /* * Notify Acknowledge Entry structure @@ -274,7 +276,7 @@ typedef struct { u_int16_t at_rxid; /* response ID */ u_int16_t at_flags; u_int16_t at_status; /* firmware status */ - u_int8_t at_reserved1; + u_int8_t at_crn; /* command reference number */ u_int8_t at_taskcodes; u_int8_t at_taskflags; u_int8_t at_execodes; @@ -296,6 +298,9 @@ typedef struct { #define ATIO2_TC_ATTR_ACAQ 4 #define ATIO2_TC_ATTR_UNTAGGED 5 +#define ATIO2_EX_WRITE 0x1 +#define ATIO2_EX_READ 0x2 + /* * Continue Target I/O Entry structure * Request from driver. The response from the @@ -461,14 +466,6 @@ typedef struct { u_int32_t ct_datalen; ispds_t ct_fcp_rsp_iudata; } m2; - /* - * CTIO2 returned from F/W... - */ - struct { - u_int32_t _reserved[4]; - u_int16_t ct_scsi_status; - u_int8_t ct_sense[QLTM_SENSELEN]; - } fw; } rsp; } ct2_entry_t; @@ -485,6 +482,7 @@ typedef struct { #define CT2_DATAMASK CT_DATAMASK #define CT2_CCINCR 0x0100 #define CT2_FASTPOST 0x0200 +#define CT2_TERMINATE 0x4000 #define CT2_SENDSTATUS 0x8000 /* |