summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/isp/isp.c16
-rw-r--r--sys/dev/isp/isp_library.c5
-rw-r--r--sys/dev/isp/ispvar.h17
3 files changed, 24 insertions, 14 deletions
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c
index dd8112f..01d7cbb 100644
--- a/sys/dev/isp/isp.c
+++ b/sys/dev/isp/isp.c
@@ -3011,7 +3011,6 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
return (0);
isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC link test", chan);
- fcp->isp_loopstate = LOOP_TESTING_LINK;
/*
* Wait up to N microseconds for F/W to go to a ready state.
@@ -3022,7 +3021,7 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
if (fcp->isp_fwstate == FW_READY) {
break;
}
- if (fcp->isp_loopstate < LOOP_TESTING_LINK)
+ if (fcp->isp_loopstate < LOOP_HAVE_LINK)
goto abort;
GET_NANOTIME(&hrb);
if ((NANOTIME_SUB(&hrb, &hra) / 1000 + 1000 >= usdelay))
@@ -3077,6 +3076,11 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
fcp->isp_loopid = i;
}
+#if 0
+ fcp->isp_loopstate = LOOP_HAVE_ADDR;
+#endif
+ fcp->isp_loopstate = LOOP_TESTING_LINK;
+
if (fcp->isp_topo == TOPO_F_PORT || fcp->isp_topo == TOPO_FL_PORT) {
nphdl = IS_24XX(isp) ? NPH_FL_ID : FL_ID;
r = isp_getpdb(isp, chan, nphdl, &pdb);
@@ -6138,7 +6142,7 @@ isp_handle_other_response(ispsoftc_t *isp, int type, isphdr_t *hp, uint32_t *opt
{
isp_ridacq_t rid;
int chan, c;
- uint32_t hdl;
+ uint32_t hdl, portid;
void *ptr;
switch (type) {
@@ -6150,6 +6154,8 @@ isp_handle_other_response(ispsoftc_t *isp, int type, isphdr_t *hp, uint32_t *opt
return (1);
case RQSTYPE_RPT_ID_ACQ:
isp_get_ridacq(isp, (isp_ridacq_t *)hp, &rid);
+ portid = (uint32_t)rid.ridacq_vp_port_hi << 16 |
+ rid.ridacq_vp_port_lo;
if (rid.ridacq_format == 0) {
for (chan = 0; chan < isp->isp_nchan; chan++) {
fcparam *fcp = FCPARAM(isp, chan);
@@ -6171,7 +6177,9 @@ isp_handle_other_response(ispsoftc_t *isp, int type, isphdr_t *hp, uint32_t *opt
fcparam *fcp = FCPARAM(isp, rid.ridacq_vp_index);
if (rid.ridacq_vp_status == RIDACQ_STS_COMPLETE ||
rid.ridacq_vp_status == RIDACQ_STS_CHANGED) {
- fcp->isp_loopstate = LOOP_HAVE_LINK;
+ fcp->isp_topo = (rid.ridacq_map[0] >> 9) & 0x7;
+ fcp->isp_portid = portid;
+ fcp->isp_loopstate = LOOP_HAVE_ADDR;
isp_async(isp, ISPASYNC_CHANGE_NOTIFY,
rid.ridacq_vp_index, ISPASYNC_CHANGE_OTHER);
} else {
diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c
index c7bce2d..48e0535 100644
--- a/sys/dev/isp/isp_library.c
+++ b/sys/dev/isp/isp_library.c
@@ -532,6 +532,7 @@ isp_fc_loop_statename(int state)
switch (state) {
case LOOP_NIL: return "NIL";
case LOOP_HAVE_LINK: return "Have Link";
+ case LOOP_HAVE_ADDR: return "Have Address";
case LOOP_TESTING_LINK: return "Testing Link";
case LOOP_LTEST_DONE: return "Link Test Done";
case LOOP_SCANNING_LOOP: return "Scanning Loop";
@@ -548,7 +549,7 @@ const char *
isp_fc_toponame(fcparam *fcp)
{
- if (fcp->isp_loopstate < LOOP_LTEST_DONE) {
+ if (fcp->isp_loopstate < LOOP_HAVE_ADDR) {
return "Unavailable";
}
switch (fcp->isp_topo) {
@@ -2329,7 +2330,7 @@ isp_find_chan_by_did(ispsoftc_t *isp, uint32_t did, uint16_t *cp)
for (chan = 0; chan < isp->isp_nchan; chan++) {
fcparam *fcp = FCPARAM(isp, chan);
if ((fcp->role & ISP_ROLE_TARGET) == 0 ||
- fcp->isp_loopstate < LOOP_LTEST_DONE) {
+ fcp->isp_loopstate < LOOP_HAVE_ADDR) {
continue;
}
if (fcp->isp_portid == did) {
diff --git a/sys/dev/isp/ispvar.h b/sys/dev/isp/ispvar.h
index 104782b..a97a04f 100644
--- a/sys/dev/isp/ispvar.h
+++ b/sys/dev/isp/ispvar.h
@@ -490,14 +490,15 @@ typedef struct {
#define LOOP_NIL 0
#define LOOP_HAVE_LINK 1
-#define LOOP_TESTING_LINK 2
-#define LOOP_LTEST_DONE 3
-#define LOOP_SCANNING_LOOP 4
-#define LOOP_LSCAN_DONE 5
-#define LOOP_SCANNING_FABRIC 6
-#define LOOP_FSCAN_DONE 7
-#define LOOP_SYNCING_PDB 8
-#define LOOP_READY 9
+#define LOOP_HAVE_ADDR 2
+#define LOOP_TESTING_LINK 3
+#define LOOP_LTEST_DONE 4
+#define LOOP_SCANNING_LOOP 5
+#define LOOP_LSCAN_DONE 6
+#define LOOP_SCANNING_FABRIC 7
+#define LOOP_FSCAN_DONE 8
+#define LOOP_SYNCING_PDB 9
+#define LOOP_READY 10
#define TOPO_NL_PORT 0
#define TOPO_FL_PORT 1
OpenPOWER on IntegriCloud