aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/isp/isp_target.c
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>2006-01-23 06:23:37 +0000
committerMatt Jacob <mjacob@FreeBSD.org>2006-01-23 06:23:37 +0000
commite52652370759dcf5500b7b9828e62f080ec77759 (patch)
treec610435fa91dd49869b88e957e07d5db355f11a9 /sys/dev/isp/isp_target.c
parent5f9df00649875d2ac84310914b10206171dc9727 (diff)
downloadsrc-e52652370759dcf5500b7b9828e62f080ec77759.tar.gz
src-e52652370759dcf5500b7b9828e62f080ec77759.zip
First of several commits as this driver is dusted off and maybe brought
up to date. Principle changes for this reelase is to support 2K Port Login firmware. This allows us to support the 2322 (and 2422 4Gb) cards which only come with the 2K Port Login firmware. The 2322 should now work- but we don't have firmware sets for it in ispfw (as the change to load 2K Port Login f/w hasn't been made- that f/w is so big it has to be loaded in more than one chunk). Other changes are the beginnings of cleaning up some long standing target mode issues. The next changes here will incorporate a lot of bug fixes from others. Finally, some copyright cleanup and attempts to make the parts of the driver that are FreeBSD specific start conforming more to FreeBSD style. MFC after: 1 month
Notes
Notes: svn path=/head/; revision=154704
Diffstat (limited to 'sys/dev/isp/isp_target.c')
-rw-r--r--sys/dev/isp/isp_target.c341
1 files changed, 216 insertions, 125 deletions
diff --git a/sys/dev/isp/isp_target.c b/sys/dev/isp/isp_target.c
index 1d4b397bbad5..f561cd90b75e 100644
--- a/sys/dev/isp/isp_target.c
+++ b/sys/dev/isp/isp_target.c
@@ -1,10 +1,8 @@
-/* $FreeBSD$ */
/*-
* Machine and OS Independent Target Mode Code for the Qlogic SCSI/FC adapters.
*
- * Copyright (c) 1999, 2000, 2001 by Matthew Jacob
+ * Copyright (c) 1997-2006 by Matthew Jacob
* All rights reserved.
- * mjacob@feral.com
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -40,6 +38,9 @@
#include <dev/ic/isp_netbsd.h>
#endif
#ifdef __FreeBSD__
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <dev/isp/isp_freebsd.h>
#endif
#ifdef __OpenBSD__
@@ -57,9 +58,8 @@ static const char atior[] =
"ATIO returned on for lun %d on from IID %d because a Bus Reset occurred "
"on bus %d";
-static void isp_got_msg(struct ispsoftc *, int, in_entry_t *);
-static void isp_got_msg_fc(struct ispsoftc *, int, in_fcentry_t *);
-static void isp_notify_ack(struct ispsoftc *, void *);
+static void isp_got_msg(struct ispsoftc *, in_entry_t *);
+static void isp_got_msg_fc(struct ispsoftc *, in_fcentry_t *);
static void isp_handle_atio(struct ispsoftc *, at_entry_t *);
static void isp_handle_atio2(struct ispsoftc *, at2_entry_t *);
static void isp_handle_ctio(struct ispsoftc *, ct_entry_t *);
@@ -118,24 +118,32 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
union {
at_entry_t *atiop;
at2_entry_t *at2iop;
+ at2e_entry_t *at2eiop;
ct_entry_t *ctiop;
ct2_entry_t *ct2iop;
+ ct2e_entry_t *ct2eiop;
lun_entry_t *lunenp;
in_entry_t *inotp;
in_fcentry_t *inot_fcp;
+ in_fcentry_e_t *inote_fcp;
na_entry_t *nackp;
na_fcentry_t *nack_fcp;
+ na_fcentry_e_t *nacke_fcp;
isphdr_t *hp;
void * *vp;
#define atiop unp.atiop
#define at2iop unp.at2iop
+#define at2eiop unp.at2eiop
#define ctiop unp.ctiop
#define ct2iop unp.ct2iop
+#define ct2eiop unp.ct2eiop
#define lunenp unp.lunenp
#define inotp unp.inotp
#define inot_fcp unp.inot_fcp
+#define inote_fcp unp.inote_fcp
#define nackp unp.nackp
#define nack_fcp unp.nack_fcp
+#define nacke_fcp unp.nacke_fcp
#define hdrp unp.hp
} unp;
u_int8_t local[QENTRY_LEN];
@@ -156,12 +164,18 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
isp_handle_ctio(isp, (ct_entry_t *) local);
break;
case RQSTYPE_ATIO2:
- isp_get_atio2(isp, at2iop, (at2_entry_t *) local);
+ if (IS_2KLOGIN(isp))
+ isp_get_atio2e(isp, at2eiop, (at2e_entry_t *) local);
+ else
+ isp_get_atio2(isp, at2iop, (at2_entry_t *) local);
isp_handle_atio2(isp, (at2_entry_t *) local);
break;
case RQSTYPE_CTIO3:
case RQSTYPE_CTIO2:
- isp_get_ctio2(isp, ct2iop, (ct2_entry_t *) local);
+ if (IS_2KLOGIN(isp))
+ isp_get_ctio2e(isp, ct2eiop, (ct2e_entry_t *) local);
+ else
+ isp_get_ctio2(isp, ct2iop, (ct2_entry_t *) local);
isp_handle_ctio2(isp, (ct2_entry_t *) local);
break;
case RQSTYPE_ENABLE_LUN:
@@ -180,7 +194,9 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
*/
bus = 0;
if (IS_FC(isp)) {
- isp_get_notify_fc(isp, inot_fcp, (in_fcentry_t *)local);
+ if (IS_2KLOGIN(isp))
+ isp_get_notify_fc_e(isp, inote_fcp, (in_fcentry_e_t *)local);
+ isp_get_notify_fc(isp, inot_fcp, (in_fcentry_t *)local);
inot_fcp = (in_fcentry_t *) local;
status = inot_fcp->in_status;
seqid = inot_fcp->in_seqid;
@@ -198,24 +214,21 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
"Immediate Notify On Bus %d, status=0x%x seqid=0x%x",
bus, status, seqid);
- /*
- * ACK it right away.
- */
- isp_notify_ack(isp, (status == IN_RESET)? NULL : local);
switch (status) {
- case IN_RESET:
- (void) isp_async(isp, ISPASYNC_BUS_RESET, &bus);
- break;
case IN_MSG_RECEIVED:
case IN_IDE_RECEIVED:
if (IS_FC(isp)) {
- isp_got_msg_fc(isp, bus, (in_fcentry_t *)local);
+ isp_got_msg_fc(isp, (in_fcentry_t *)local);
} else {
- isp_got_msg(isp, bus, (in_entry_t *)local);
+ isp_got_msg(isp, (in_entry_t *)local);
}
break;
case IN_RSRC_UNAVAIL:
isp_prt(isp, ISP_LOGWARN, "Firmware out of ATIOs");
+ isp_notify_ack(isp, local);
+ break;
+ case IN_RESET:
+ isp_target_async(isp, 0, ASYNC_BUS_RESET);
break;
case IN_PORT_LOGOUT:
case IN_ABORT_TASK:
@@ -226,6 +239,7 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
default:
isp_prt(isp, ISP_LOGERR,
"bad status (0x%x) in isp_target_notify", status);
+ isp_notify_ack(isp, local);
break;
}
break;
@@ -236,8 +250,12 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
* Immediate Notify entry for some asynchronous event.
*/
if (IS_FC(isp)) {
- isp_get_notify_ack_fc(isp, nack_fcp,
- (na_fcentry_t *)local);
+ if (IS_2KLOGIN(isp))
+ isp_get_notify_ack_fc_e(isp, nacke_fcp,
+ (na_fcentry_e_t *)local);
+ else
+ isp_get_notify_ack_fc(isp, nack_fcp,
+ (na_fcentry_t *)local);
nack_fcp = (na_fcentry_t *)local;
isp_prt(isp, ISP_LOGTDEBUG1,
"Notify Ack status=0x%x seqid 0x%x",
@@ -258,13 +276,17 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
}
#undef atiop
#undef at2iop
+#undef at2eiop
#undef ctiop
#undef ct2iop
+#undef ct2eiop
#undef lunenp
#undef inotp
#undef inot_fcp
+#undef inote_fcp
#undef nackp
#undef nack_fcp
+#undef nacke_fcp
#undef hdrp
return (rval);
}
@@ -375,6 +397,7 @@ isp_target_put_atio(struct ispsoftc *isp, void *arg)
union {
at_entry_t _atio;
at2_entry_t _atio2;
+ at2e_entry_t _atio2e;
} atun;
MEMZERO(&atun, sizeof atun);
@@ -387,7 +410,11 @@ isp_target_put_atio(struct ispsoftc *isp, void *arg)
} else {
atun._atio2.at_lun = (u_int8_t) aep->at_lun;
}
- atun._atio2.at_iid = aep->at_iid;
+ if (IS_2KLOGIN(isp)) {
+ atun._atio2e.at_iid = ((at2e_entry_t *)aep)->at_iid;
+ } else {
+ atun._atio2.at_iid = aep->at_iid;
+ }
atun._atio2.at_rxid = aep->at_rxid;
atun._atio2.at_status = CT_OK;
} else {
@@ -431,6 +458,7 @@ isp_endcmd(struct ispsoftc *isp, void *arg, u_int32_t code, u_int16_t hdl)
union {
ct_entry_t _ctio;
ct2_entry_t _ctio2;
+ ct2e_entry_t _ctio2e;
} un;
MEMZERO(&un, sizeof un);
@@ -442,10 +470,14 @@ isp_endcmd(struct ispsoftc *isp, void *arg, u_int32_t code, u_int16_t hdl)
cto->ct_header.rqs_entry_type = RQSTYPE_CTIO2;
cto->ct_header.rqs_entry_count = 1;
- cto->ct_iid = aep->at_iid;
if ((FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) == 0) {
cto->ct_lun = aep->at_lun;
}
+ if (IS_2KLOGIN(isp)) {
+ un._ctio2e.ct_iid = ((at2e_entry_t *)aep)->at_iid;
+ } else {
+ cto->ct_iid = aep->at_iid;
+ }
cto->ct_rxid = aep->at_rxid;
cto->rsp.m1.ct_scsi_status = sts;
cto->ct_flags = CT2_SENDSTATUS | CT2_NO_DATA | CT2_FLAG_MODE1;
@@ -494,65 +526,74 @@ isp_endcmd(struct ispsoftc *isp, void *arg, u_int32_t code, u_int16_t hdl)
int
isp_target_async(struct ispsoftc *isp, int bus, int event)
{
- tmd_event_t evt;
- tmd_msg_t msg;
+ tmd_notify_t notify;
+
+ MEMZERO(&notify, sizeof (tmd_notify_t));
+ notify.nt_hba = isp;
+ /* nt_str set in outer layers */
+ notify.nt_iid = INI_ANY;
+ /* nt_tgt set in outer layers */
+ notify.nt_lun = LUN_ANY;
+ notify.nt_tagval = TAG_ANY;
+
+ if (IS_SCSI(isp)) {
+ TAG_INSERT_BUS(notify.nt_tagval, bus);
+ }
switch (event) {
- /*
- * These three we handle here to propagate an effective bus reset
- * upstream, but these do not require any immediate notify actions
- * so we return when done.
- */
- case ASYNC_LIP_F8:
- case ASYNC_LIP_OCCURRED:
case ASYNC_LOOP_UP:
+ case ASYNC_PTPMODE:
+ notify.nt_ncode = NT_LINK_UP;
+ (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, &notify);
+ break;
case ASYNC_LOOP_DOWN:
+ notify.nt_ncode = NT_LINK_DOWN;
+ (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, &notify);
+ break;
+ case ASYNC_LIP_F8:
+ case ASYNC_LIP_OCCURRED:
case ASYNC_LOOP_RESET:
- case ASYNC_PTPMODE:
- /*
- * These don't require any immediate notify actions. We used
- * treat them like SCSI Bus Resets, but that was just plain
- * wrong. Let the normal CTIO completion report what occurred.
- */
- return (0);
-
+ notify.nt_ncode = NT_LIP_RESET;
+ (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, &notify);
+ break;
case ASYNC_BUS_RESET:
- case ASYNC_TIMEOUT_RESET:
- if (IS_FC(isp)) {
- return (0); /* we'll be getting an inotify instead */
- }
- evt.ev_bus = bus;
- evt.ev_event = event;
- (void) isp_async(isp, ISPASYNC_TARGET_EVENT, &evt);
+ case ASYNC_TIMEOUT_RESET: /* XXX: where does this come from ? */
+ notify.nt_ncode = NT_BUS_RESET;
+ (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, &notify);
break;
case ASYNC_DEVICE_RESET:
- /*
- * Bus Device Reset resets a specific target, so
- * we pass this as a synthesized message.
- */
- MEMZERO(&msg, sizeof msg);
+ notify.nt_ncode = NT_TARGET_RESET;
+ (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, &notify);
+ break;
+ case ASYNC_CTIO_DONE:
+ {
+ uint8_t storage[QENTRY_LEN];
+ memset(storage, 0, QENTRY_LEN);
if (IS_FC(isp)) {
- msg.nt_iid = FCPARAM(isp)->isp_loopid;
+ ct2_entry_t *ct = (ct2_entry_t *) storage;
+ ct->ct_header.rqs_entry_type = RQSTYPE_CTIO2;
+ ct->ct_status = CT_OK;
+ ct->ct_syshandle = bus;
+ ct->ct_flags = CT2_SENDSTATUS|CT2_FASTPOST;
} else {
- msg.nt_iid = SDPARAM(isp)->isp_initiator_id;
+ ct_entry_t *ct = (ct_entry_t *) storage;
+ ct->ct_header.rqs_entry_type = RQSTYPE_CTIO;
+ ct->ct_status = CT_OK;
+ ct->ct_fwhandle = bus;
+ ct->ct_flags = CT_SENDSTATUS;
}
- msg.nt_bus = bus;
- 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);
+ (void) isp_async(isp, ISPASYNC_TARGET_ACTION, storage);
return (0);
+ }
default:
isp_prt(isp, ISP_LOGERR,
"isp_target_async: unknown event 0x%x", event);
+ if (isp->isp_state == ISP_RUNSTATE) {
+ isp_notify_ack(isp, NULL);
+ }
break;
}
- if (isp->isp_state == ISP_RUNSTATE)
- isp_notify_ack(isp, NULL);
- return(0);
+ return (0);
}
@@ -565,25 +606,54 @@ isp_target_async(struct ispsoftc *isp, int bus, int event)
*/
static void
-isp_got_msg(struct ispsoftc *isp, int bus, in_entry_t *inp)
+isp_got_msg(struct ispsoftc *isp, in_entry_t *inp)
{
+ tmd_notify_t nt;
u_int8_t status = inp->in_status & ~QLTM_SVALID;
+ MEMZERO(&nt, sizeof (nt));
+ nt.nt_hba = isp;
+ /* nt_str set in outer layers */
+ nt.nt_iid = GET_IID_VAL(inp->in_iid);
+ nt.nt_tgt = inp->in_tgt;
+ nt.nt_lun = inp->in_lun;
+ IN_MAKE_TAGID(nt.nt_tagval, 0, inp);
+ nt.nt_lreserved = inp;
+
if (status == IN_IDE_RECEIVED || status == IN_MSG_RECEIVED) {
- tmd_msg_t msg;
-
- MEMZERO(&msg, sizeof (msg));
- msg.nt_bus = bus;
- msg.nt_iid = inp->in_iid;
- msg.nt_tgt = inp->in_tgt;
- msg.nt_lun = inp->in_lun;
- msg.nt_tagtype = inp->in_tag_type;
- IN_MAKE_TAGID(msg.nt_tagval, 0, inp);
- MEMCPY(msg.nt_msg, inp->in_msg, IN_MSGLEN);
- (void) isp_async(isp, ISPASYNC_TARGET_MESSAGE, &msg);
+ switch (inp->in_msg[0]) {
+ case MSG_ABORT:
+ nt.nt_ncode = NT_ABORT_TASK_SET;
+ break;
+ case MSG_BUS_DEV_RESET:
+ nt.nt_ncode = NT_TARGET_RESET;
+ break;
+ case MSG_ABORT_TAG:
+ nt.nt_ncode = NT_ABORT_TASK;
+ break;
+ case MSG_CLEAR_QUEUE:
+ nt.nt_ncode = NT_CLEAR_TASK_SET;
+ break;
+ case MSG_REL_RECOVERY:
+ nt.nt_ncode = NT_CLEAR_ACA;
+ break;
+ case MSG_TERM_IO_PROC:
+ nt.nt_ncode = NT_ABORT_TASK;
+ break;
+ case MSG_LUN_RESET:
+ nt.nt_ncode = NT_LUN_RESET;
+ break;
+ default:
+ isp_prt(isp, ISP_LOGERR,
+ "unhandled message 0x%x", inp->in_msg[0]);
+ isp_notify_ack(isp, inp);
+ return;
+ }
+ (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, &nt);
} else {
isp_prt(isp, ISP_LOGERR,
"unknown immediate notify status 0x%x", inp->in_status);
+ isp_notify_ack(isp, inp);
}
}
@@ -591,64 +661,71 @@ isp_got_msg(struct ispsoftc *isp, int bus, in_entry_t *inp)
* Synthesize a message from the task management flags in a FCP_CMND_IU.
*/
static void
-isp_got_msg_fc(struct ispsoftc *isp, int bus, in_fcentry_t *inp)
+isp_got_msg_fc(struct ispsoftc *isp, in_fcentry_t *inp)
{
- int lun;
- static const char f1[] = "%s from iid %d lun %d seq 0x%x";
+ tmd_notify_t nt;
+ static const char f1[] = "%s from iid 0x%08x%08x lun %d seq 0x%x";
static const char f2[] =
- "unknown %s 0x%x lun %d iid %d task flags 0x%x seq 0x%x\n";
+ "unknown %s 0x%x lun %d iid 0x%08x%08x task flags 0x%x seq 0x%x\n";
+ MEMZERO(&nt, sizeof (tmd_notify_t));
+ nt.nt_hba = isp;
+ /*
+ * XXX: LOOK UP TRANSLATION IN CURRENT LPORTDB
+ */
+ if (IS_2KLOGIN(isp)) {
+ nt.nt_iid = ((in_fcentry_e_t *)inp)->in_iid;
+ } else {
+ nt.nt_iid = inp->in_iid; /* possibly reset in outer layer */
+ }
+ /* nt_tgt set in outer layers */
if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) {
- lun = inp->in_scclun;
+ nt.nt_lun = inp->in_scclun;
} else {
- lun = inp->in_lun;
+ nt.nt_lun = inp->in_lun;
}
+ IN_FC_MAKE_TAGID(nt.nt_tagval, 0, inp);
+ nt.nt_lreserved = inp;
if (inp->in_status != IN_MSG_RECEIVED) {
isp_prt(isp, ISP_LOGINFO, f2, "immediate notify status",
- inp->in_status, lun, inp->in_iid,
+ inp->in_status, nt.nt_lun, (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid,
inp->in_task_flags, inp->in_seqid);
+ isp_notify_ack(isp, inp);
+ return;
+ }
+
+ if (inp->in_task_flags & TASK_FLAGS_ABORT_TASK_SET) {
+ isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK SET",
+ (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
+ nt.nt_ncode = NT_ABORT_TASK_SET;
+ } else if (inp->in_task_flags & TASK_FLAGS_CLEAR_TASK_SET) {
+ isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET",
+ (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
+ nt.nt_ncode = NT_CLEAR_TASK_SET;
+ } else if (inp->in_task_flags & TASK_FLAGS_LUN_RESET) {
+ isp_prt(isp, ISP_LOGINFO, f1, "LUN RESET",
+ (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
+ nt.nt_ncode = NT_LUN_RESET;
+ } else if (inp->in_task_flags & TASK_FLAGS_TARGET_RESET) {
+ isp_prt(isp, ISP_LOGINFO, f1, "TARGET RESET",
+ (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
+ nt.nt_ncode = NT_TARGET_RESET;
+ } else if (inp->in_task_flags & TASK_FLAGS_CLEAR_ACA) {
+ isp_prt(isp, ISP_LOGINFO, f1, "CLEAR ACA",
+ (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid);
+ nt.nt_ncode = NT_CLEAR_ACA;
} else {
- tmd_msg_t msg;
-
- MEMZERO(&msg, sizeof (msg));
- msg.nt_bus = bus;
- msg.nt_iid = inp->in_iid;
- IN_FC_MAKE_TAGID(msg.nt_tagval, 0, inp);
- msg.nt_lun = lun;
-
- 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;
- } 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);
- msg.nt_msg[0] = MSG_BUS_DEV_RESET;
- } 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 {
- isp_prt(isp, ISP_LOGWARN, f2, "task flag",
- inp->in_status, lun, inp->in_iid,
- inp->in_task_flags, inp->in_seqid);
- }
- if (msg.nt_msg[0]) {
- (void) isp_async(isp, ISPASYNC_TARGET_MESSAGE, &msg);
- }
+ isp_prt(isp, ISP_LOGWARN, f2, "task flag",
+ inp->in_status, nt.nt_lun, (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid,
+ inp->in_task_flags, inp->in_seqid);
+ isp_notify_ack(isp, inp);
+ return;
}
+ (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, &nt);
}
-static void
+void
isp_notify_ack(struct ispsoftc *isp, void *arg)
{
char storage[QENTRY_LEN];
@@ -668,7 +745,11 @@ isp_notify_ack(struct ispsoftc *isp, void *arg)
if (arg) {
in_fcentry_t *inp = arg;
MEMCPY(storage, arg, sizeof (isphdr_t));
- na->na_iid = inp->in_iid;
+ if (IS_2KLOGIN(isp)) {
+ ((na_fcentry_e_t *)na)->na_iid = ((in_fcentry_e_t *)inp)->in_iid;
+ } else {
+ na->na_iid = inp->in_iid;
+ }
if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) {
na->na_lun = inp->in_scclun;
} else {
@@ -686,7 +767,11 @@ isp_notify_ack(struct ispsoftc *isp, void *arg)
}
na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK;
na->na_header.rqs_entry_count = 1;
- isp_put_notify_ack_fc(isp, na, (na_fcentry_t *)outp);
+ if (IS_2KLOGIN(isp)) {
+ isp_put_notify_ack_fc_e(isp, (na_fcentry_e_t *) na, (na_fcentry_e_t *)outp);
+ } else {
+ isp_put_notify_ack_fc(isp, na, (na_fcentry_t *)outp);
+ }
} else {
na_entry_t *na = (na_entry_t *) storage;
if (arg) {
@@ -794,7 +879,7 @@ isp_handle_atio(struct ispsoftc *isp, at_entry_t *aep)
static void
isp_handle_atio2(struct ispsoftc *isp, at2_entry_t *aep)
{
- int lun;
+ int lun, iid;
if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) {
lun = aep->at_scclun;
@@ -802,6 +887,12 @@ isp_handle_atio2(struct ispsoftc *isp, at2_entry_t *aep)
lun = aep->at_lun;
}
+ if (IS_2KLOGIN(isp)) {
+ iid = ((at2e_entry_t *)aep)->at_iid;
+ } else {
+ iid = aep->at_iid;
+ }
+
/*
* The firmware status (except for the QLTM_SVALID bit) indicates
* why this ATIO was sent to us.
@@ -861,14 +952,14 @@ isp_handle_atio2(struct ispsoftc *isp, at2_entry_t *aep)
* Ignore it because the async event will clear things
* up for us.
*/
- isp_prt(isp, ISP_LOGERR, atior, lun, aep->at_iid, 0);
+ isp_prt(isp, ISP_LOGERR, atior, lun, iid, 0);
break;
default:
isp_prt(isp, ISP_LOGERR,
"Unknown ATIO2 status 0x%x from initiator %d for lun %d",
- aep->at_status, aep->at_iid, lun);
+ aep->at_status, iid, lun);
(void) isp_target_put_atio(isp, aep);
break;
}