sdparam *sdp_chan0, *sdp_chan1;
mbreg_t mbs;
+ isp->isp_state = ISP_INITSTATE;
+
sdp_chan0 = SDPARAM(isp, 0);
sdp_chan1 = sdp_chan0;
if (IS_DUALBUS(isp)) {
}
}
- isp->isp_state = ISP_INITSTATE;
+ isp->isp_state = ISP_RUNSTATE;
}
static void
* We only support one channel on non-24XX cards
*/
fcp = FCPARAM(isp, 0);
- if (fcp->role == ISP_ROLE_NONE) {
- isp->isp_state = ISP_INITSTATE;
+ if (fcp->role == ISP_ROLE_NONE)
return;
- }
+ isp->isp_state = ISP_INITSTATE;
ISP_MEMZERO(icbp, sizeof (*icbp));
icbp->icb_version = ICB_VERSION1;
icbp->icb_fwoptions = fcp->isp_fwoptions;
/*
* Whatever happens, we're now committed to being here.
*/
- isp->isp_state = ISP_INITSTATE;
+ isp->isp_state = ISP_RUNSTATE;
}
static void
}
if (chan == isp->isp_nchan) {
isp_prt(isp, ISP_LOG_WARN1, "all %d channels with role 'none'", chan);
- isp->isp_state = ISP_INITSTATE;
return;
}
+ isp->isp_state = ISP_INITSTATE;
+
/*
* Start with channel 0.
*/
/*
* Whatever happens, we're now committed to being here.
*/
- isp->isp_state = ISP_INITSTATE;
+ isp->isp_state = ISP_RUNSTATE;
}
static void
XS_INITERR(xs);
isp = XS_ISP(xs);
- /*
- * Now make sure we're running.
- */
-
- if (isp->isp_state != ISP_RUNSTATE) {
- isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE");
- XS_SETERR(xs, HBA_BOTCH);
- return (CMD_COMPLETE);
- }
-
/*
* Check command CDB length, etc.. We really are limited to 16 bytes
* for Fibre Channel, but can do up to 44 bytes in parallel SCSI,
return (CMD_COMPLETE);
}
+ if (isp->isp_state != ISP_RUNSTATE) {
+ isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE");
+ XS_SETERR(xs, HBA_BOTCH);
+ return (CMD_COMPLETE);
+ }
+
/*
* Try again later.
*/
XS_SETERR(xs, HBA_SELTIMEOUT);
return (CMD_COMPLETE);
}
+
+ if (isp->isp_state != ISP_RUNSTATE) {
+ isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE");
+ XS_SETERR(xs, HBA_BOTCH);
+ return (CMD_COMPLETE);
+ }
+
if (sdp->update) {
isp_spi_update(isp, XS_CHANNEL(xs));
}
{
int i, res = 0;
- isp_reset(isp, do_load_defaults);
+ if (isp->isp_state != ISP_RESETSTATE)
+ isp_reset(isp, do_load_defaults);
if (isp->isp_state != ISP_RESETSTATE) {
res = EIO;
isp_prt(isp, ISP_LOGERR, "%s: cannot reset card", __func__);
}
isp_init(isp);
- if (isp->isp_state == ISP_INITSTATE) {
- isp->isp_state = ISP_RUNSTATE;
- }
-
- if (isp->isp_state != ISP_RUNSTATE) {
+ if (isp->isp_state > ISP_RESETSTATE &&
+ isp->isp_state != ISP_RUNSTATE) {
res = EIO;
-#ifndef ISP_TARGET_MODE
- isp_prt(isp, ISP_LOGWARN, "%s: not at runstate", __func__);
-#endif
+ isp_prt(isp, ISP_LOGERR, "%s: cannot init card", __func__);
ISP_DISABLE_INTS(isp);
if (IS_FC(isp)) {
/*