[Open-FCoE] [RFC PATCH 15/28] libfc: remove RPORT_ST_PLOGI_RECV and RPORT_ST_ERROR

Robert Love robert.w.love at intel.com
Thu Sep 11 23:36:29 UTC 2008


PLOGI_RECV was specifically for target mode. Since we're not
supporting target mode at this point, we don't want this state.

ERROR is unnecessary now that we're just failing and reporting
to the callback function to take action.

Signed-off-by: Robert Love <robert.w.love at intel.com>
---

 drivers/scsi/libfc/fc_rport.c |   18 ++----------------
 include/scsi/libfc/libfc.h    |    2 --
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 45e614d..b4070ff 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -57,11 +57,9 @@ static const char *fc_rport_state_names[] = {
 	[RPORT_ST_NONE] = "None",
 	[RPORT_ST_INIT] = "Init",
 	[RPORT_ST_PLOGI] = "PLOGI",
-	[RPORT_ST_PLOGI_RECV] = "PLOGI recv",
 	[RPORT_ST_PRLI] = "PRLI",
 	[RPORT_ST_RTV] = "RTV",
 	[RPORT_ST_READY] = "Ready",
-	[RPORT_ST_ERROR] = "Error",
 	[RPORT_ST_LOGO] = "LOGO",
 };
 
@@ -370,8 +368,6 @@ static void fc_rport_reject(struct fc_rport *rport)
 		break;
 	case RPORT_ST_NONE:
 	case RPORT_ST_READY:
-	case RPORT_ST_ERROR:
-	case RPORT_ST_PLOGI_RECV:
 	case RPORT_ST_INIT:
 		BUG();
 		break;
@@ -410,11 +406,9 @@ static void fc_rport_timeout(struct work_struct *work)
 		fc_rport_enter_logo(rport);
 		break;
 	case RPORT_ST_READY:
-	case RPORT_ST_ERROR:
 	case RPORT_ST_INIT:
 		break;
 	case RPORT_ST_NONE:
-	case RPORT_ST_PLOGI_RECV:
 		BUG();
 		break;
 	}
@@ -669,8 +663,7 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
 		fc_rport_enter_rtv(rport);
 
 	} else {
-		FC_DBG("bad ELS response\n");
-		fc_rport_state_enter(rport, RPORT_ST_ERROR);
+		FC_DBG("Bad ELS response\n");
 		if (rdata->event_callback)
 			rdata->event_callback(lport, rport,
 					      LPORT_EV_RPORT_FAILED);
@@ -722,8 +715,7 @@ static void fc_rport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
 		fc_rport_enter_rtv(rport);
 
 	} else {
-		FC_DBG("bad ELS response\n");
-		fc_rport_state_enter(rport, RPORT_ST_ERROR);
+		FC_DBG("Bad ELS response\n");
 
 		if (rdata->event_callback)
 			rdata->event_callback(lport, rport,
@@ -1062,7 +1054,6 @@ static void fc_rport_recv_plogi_req(struct fc_rport *rport,
 			reject = ELS_RJT_INPROG;
 		break;
 	case RPORT_ST_PRLI:
-	case RPORT_ST_ERROR:
 	case RPORT_ST_READY:
 		if (fc_rp_debug)
 			FC_DBG("incoming PLOGI from %x in logged-in state %d "
@@ -1114,9 +1105,6 @@ static void fc_rport_recv_plogi_req(struct fc_rport *rport,
 			lport->tt.seq_send(lport, sp, fp, f_ctl);
 			if (rdata->rp_state == RPORT_ST_PLOGI)
 				fc_rport_enter_prli(rport);
-			else
-				fc_rport_state_enter(rport,
-						     RPORT_ST_PLOGI_RECV);
 		}
 	}
 }
@@ -1163,7 +1151,6 @@ static void fc_rport_recv_prli_req(struct fc_rport *rport,
 		       fc_rport_state(rport));
 
 	switch (rdata->rp_state) {
-	case RPORT_ST_PLOGI_RECV:
 	case RPORT_ST_PRLI:
 	case RPORT_ST_READY:
 		reason = ELS_RJT_NONE;
@@ -1259,7 +1246,6 @@ static void fc_rport_recv_prli_req(struct fc_rport *rport,
 		 * Get lock and re-check state.
 		 */
 		switch (rdata->rp_state) {
-		case RPORT_ST_PLOGI_RECV:
 		case RPORT_ST_PRLI:
 			fc_rport_enter_ready(rport);
 			break;
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 66fb5af..a924762 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -111,10 +111,8 @@ enum fc_rport_state {
 	RPORT_ST_NONE = 0,
 	RPORT_ST_INIT,		/* initialized */
 	RPORT_ST_PLOGI,		/* waiting for PLOGI completion */
-	RPORT_ST_PLOGI_RECV,	/* received PLOGI (as target) */
 	RPORT_ST_PRLI,		/* waiting for PRLI completion */
 	RPORT_ST_RTV,		/* waiting for RTV completion */
-	RPORT_ST_ERROR,		/* error */
 	RPORT_ST_READY,		/* ready for use */
 	RPORT_ST_LOGO,		/* port logout sent */
 };




More information about the devel mailing list