Change isp_target_async to a function returning an integer.

Roll most immediate notifies into something the platform has to handle.
This commit is contained in:
Matt Jacob 2002-06-16 04:56:07 +00:00
parent 9dba6a4ecb
commit e63442b6c1

View File

@ -139,7 +139,7 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
#define hdrp unp.hp
} unp;
u_int8_t local[QENTRY_LEN];
int bus, type, rval = 0;
int bus, type, rval = 1;
type = isp_get_response_type(isp, (isphdr_t *)vptr);
unp.vp = vptr;
@ -216,24 +216,11 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
case IN_RSRC_UNAVAIL:
isp_prt(isp, ISP_LOGWARN, "Firmware out of ATIOs");
break;
case IN_ABORT_TASK:
isp_prt(isp, ISP_LOGWARN,
"Abort Task from IID %d RX_ID 0x%x",
inot_fcp->in_iid, seqid);
(void) isp_async(isp, ISPASYNC_TARGET_ACTION, &bus);
break;
case IN_PORT_LOGOUT:
isp_prt(isp, ISP_LOGWARN,
"Port Logout for Initiator %d RX_ID 0x%x",
inot_fcp->in_iid, seqid);
break;
case IN_ABORT_TASK:
case IN_PORT_CHANGED:
isp_prt(isp, ISP_LOGWARN,
"Port Changed for Initiator %d RX_ID 0x%x",
inot_fcp->in_iid, seqid);
break;
case IN_GLOBAL_LOGO:
isp_prt(isp, ISP_LOGWARN, "All ports logged out");
(void) isp_async(isp, ISPASYNC_TARGET_ACTION, &local);
break;
default:
isp_prt(isp, ISP_LOGERR,
@ -265,7 +252,7 @@ isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp)
default:
isp_prt(isp, ISP_LOGERR,
"Unknown entry type 0x%x in isp_target_notify", type);
rval = -1;
rval = 0;
break;
}
#undef atiop
@ -501,7 +488,7 @@ isp_endcmd(struct ispsoftc *isp, void *arg, u_int32_t code, u_int16_t hdl)
return (isp_target_put_entry(isp, &un));
}
void
int
isp_target_async(struct ispsoftc *isp, int bus, int event)
{
tmd_event_t evt;
@ -524,12 +511,12 @@ isp_target_async(struct ispsoftc *isp, int bus, int event)
* treat them like SCSI Bus Resets, but that was just plain
* wrong. Let the normal CTIO completion report what occurred.
*/
return;
return (0);
case ASYNC_BUS_RESET:
case ASYNC_TIMEOUT_RESET:
if (IS_FC(isp)) {
return; /* we'll be getting an inotify instead */
return (0); /* we'll be getting an inotify instead */
}
evt.ev_bus = bus;
evt.ev_event = event;
@ -557,6 +544,7 @@ isp_target_async(struct ispsoftc *isp, int bus, int event)
}
if (isp->isp_state == ISP_RUNSTATE)
isp_notify_ack(isp, NULL);
return(0);
}