summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp_library.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-11-30 21:37:22 +0000
committermav <mav@FreeBSD.org>2015-11-30 21:37:22 +0000
commitd293293f6c10a65571fdd26d677924c1e7fba125 (patch)
treefeb91741af14ae68f4c305e10d147fa50dbb6aae /sys/dev/isp/isp_library.c
parent93803f9b80b5a92f9d83877435a9fdd625c2e4ac (diff)
downloadFreeBSD-src-d293293f6c10a65571fdd26d677924c1e7fba125.zip
FreeBSD-src-d293293f6c10a65571fdd26d677924c1e7fba125.tar.gz
MFC r290993, r290994: Unify and cleanup FC ports scan.
Diffstat (limited to 'sys/dev/isp/isp_library.c')
-rw-r--r--sys/dev/isp/isp_library.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c
index f0a0322..73f50a7 100644
--- a/sys/dev/isp/isp_library.c
+++ b/sys/dev/isp/isp_library.c
@@ -400,31 +400,24 @@ isp_fc_runstate(ispsoftc_t *isp, int chan, int tval)
if (fcp->role == ISP_ROLE_NONE) {
return (0);
}
- if (fcp->isp_fwstate < FW_READY || fcp->isp_loopstate < LOOP_PDB_RCVD) {
- if (isp_control(isp, ISPCTL_FCLINK_TEST, chan, tval) != 0) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: linktest failed for channel %d", chan);
- return (-1);
- }
- if (fcp->isp_fwstate != FW_READY || fcp->isp_loopstate < LOOP_PDB_RCVD) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: f/w not ready for channel %d", chan);
- return (-1);
- }
+ if (isp_control(isp, ISPCTL_FCLINK_TEST, chan, tval) != 0) {
+ isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: linktest failed for channel %d", chan);
+ return (-1);
}
-
if (isp_control(isp, ISPCTL_SCAN_LOOP, chan) != 0) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: scan loop fails on channel %d", chan);
- return (LOOP_PDB_RCVD);
+ isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: scan loop failed on channel %d", chan);
+ return (LOOP_LTEST_DONE);
}
if (isp_control(isp, ISPCTL_SCAN_FABRIC, chan) != 0) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: scan fabric fails on channel %d", chan);
+ isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: scan fabric failed on channel %d", chan);
return (LOOP_LSCAN_DONE);
}
if (isp_control(isp, ISPCTL_PDB_SYNC, chan) != 0) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: pdb_sync fails on channel %d", chan);
+ isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: pdb_sync failed on channel %d", chan);
return (LOOP_FSCAN_DONE);
}
- if (fcp->isp_fwstate != FW_READY || fcp->isp_loopstate != LOOP_READY) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: f/w not ready again on channel %d", chan);
+ if (fcp->isp_loopstate != LOOP_READY) {
+ isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: not ready again on channel %d", chan);
return (-1);
}
return (0);
@@ -536,7 +529,7 @@ isp_fc_fw_statename(int state)
{
switch (state) {
case FW_CONFIG_WAIT: return "Config Wait";
- case FW_WAIT_AL_PA: return "Waiting for AL_PA";
+ case FW_WAIT_LINK: return "Wait Link";
case FW_WAIT_LOGIN: return "Wait Login";
case FW_READY: return "Ready";
case FW_LOSS_OF_SYNC: return "Loss Of Sync";
@@ -552,9 +545,9 @@ isp_fc_loop_statename(int state)
{
switch (state) {
case LOOP_NIL: return "NIL";
- case LOOP_LIP_RCVD: return "LIP Received";
- case LOOP_PDB_RCVD: return "PDB Received";
- case LOOP_SCANNING_LOOP: return "Scanning";
+ case LOOP_TESTING_LINK: return "Testing Link";
+ case LOOP_LTEST_DONE: return "Link Test Done";
+ case LOOP_SCANNING_LOOP: return "Scanning Loop";
case LOOP_LSCAN_DONE: return "Loop Scan Done";
case LOOP_SCANNING_FABRIC: return "Scanning Fabric";
case LOOP_FSCAN_DONE: return "Fabric Scan Done";
@@ -568,7 +561,7 @@ const char *
isp_fc_toponame(fcparam *fcp)
{
- if (fcp->isp_fwstate != FW_READY) {
+ if (fcp->isp_loopstate < LOOP_LTEST_DONE) {
return "Unavailable";
}
switch (fcp->isp_topo) {
@@ -2527,7 +2520,8 @@ isp_find_chan_by_did(ispsoftc_t *isp, uint32_t did, uint16_t *cp)
*cp = ISP_NOCHAN;
for (chan = 0; chan < isp->isp_nchan; chan++) {
fcparam *fcp = FCPARAM(isp, chan);
- if ((fcp->role & ISP_ROLE_TARGET) == 0 || fcp->isp_fwstate != FW_READY || fcp->isp_loopstate < LOOP_PDB_RCVD) {
+ if ((fcp->role & ISP_ROLE_TARGET) == 0 ||
+ fcp->isp_loopstate < LOOP_LTEST_DONE) {
continue;
}
if (fcp->isp_portid == did) {
OpenPOWER on IntegriCloud