[Open-FCoE] [RFC PATCH 21/28] libfc: remove dns_stop state

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


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

 drivers/scsi/libfc/fc_lport.c |   24 +-----------------------
 drivers/scsi/libfc/fc_ns.c    |   22 ----------------------
 include/scsi/libfc/libfc.h    |    3 ---
 3 files changed, 1 insertions(+), 48 deletions(-)

diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 9bbae01..356e1f0 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -52,7 +52,6 @@ static const char *fc_lport_state_names[] = {
 	[LPORT_ST_REG_FT] =   "REG_FT",
 	[LPORT_ST_SCR] =      "SCR",
 	[LPORT_ST_READY] =    "Ready",
-	[LPORT_ST_DNS_STOP] = "stop",
 	[LPORT_ST_LOGO] =     "LOGO",
 	[LPORT_ST_RESET] =    "reset",
 };
@@ -393,28 +392,9 @@ EXPORT_SYMBOL(fc_unpause);
 int fc_fabric_logoff(struct fc_lport *lp)
 {
 	fc_lport_lock(lp);
-	switch (lp->state) {
-	case LPORT_ST_NONE:
-		break;
-	case LPORT_ST_FLOGI:
-	case LPORT_ST_LOGO:
-	case LPORT_ST_RESET:
-		fc_lport_enter_reset(lp);
-		break;
-	case LPORT_ST_DNS:
-	case LPORT_ST_DNS_STOP:
-		fc_lport_enter_logo(lp);
-		break;
-	case LPORT_ST_REG_PN:
-	case LPORT_ST_REG_FT:
-	case LPORT_ST_SCR:
-	case LPORT_ST_READY:
-		lp->tt.disc_stop(lp);
-		break;
-	}
+	fc_lport_enter_logo(lp);
 	fc_lport_unlock(lp);
 	lp->tt.scsi_cleanup(lp);
-
 	return 0;
 }
 EXPORT_SYMBOL(fc_fabric_logoff);
@@ -492,7 +472,6 @@ static void fc_lport_enter_retry(struct fc_lport *lp)
 	case LPORT_ST_NONE:
 	case LPORT_ST_READY:
 	case LPORT_ST_RESET:
-	case LPORT_ST_DNS_STOP:
 		WARN_ON(1);
 		break;
 	case LPORT_ST_FLOGI:
@@ -529,7 +508,6 @@ static void fc_lport_enter_reject(struct fc_lport *lp)
 	case LPORT_ST_REG_PN:
 	case LPORT_ST_REG_FT:
 	case LPORT_ST_SCR:
-	case LPORT_ST_DNS_STOP:
 	case LPORT_ST_DNS:
 	case LPORT_ST_FLOGI:
 	case LPORT_ST_LOGO:
diff --git a/drivers/scsi/libfc/fc_ns.c b/drivers/scsi/libfc/fc_ns.c
index 41ea422..844c2f2 100644
--- a/drivers/scsi/libfc/fc_ns.c
+++ b/drivers/scsi/libfc/fc_ns.c
@@ -627,25 +627,6 @@ out:
 	kfree(dp);
 }
 
-/*
- * Logoff DNS session.
- * We should get an event call when the session has been logged out.
- */
-static void fc_ns_enter_dns_stop(struct fc_lport *lp)
-{
-	struct fc_rport *rport = lp->dns_rp;
-
-	if (fc_ns_debug)
-		FC_DBG("Processing DNS_STOP state\n");
-
-	fc_lport_state_enter(lp, LPORT_ST_DNS_STOP);
-
-	if (rport)
-		lp->tt.rport_logout(rport);
-	else
-		lp->tt.lport_logout(lp);
-}
-
 int fc_ns_init(struct fc_lport *lp)
 {
 	INIT_DELAYED_WORK(&lp->ns_disc_work, fc_ns_timeout);
@@ -656,9 +637,6 @@ int fc_ns_init(struct fc_lport *lp)
 	if (!lp->tt.disc_recv_req)
 		lp->tt.disc_recv_req = fc_ns_recv_req;
 
-	if (!lp->tt.disc_stop)
-		lp->tt.disc_stop = fc_ns_enter_dns_stop;
-
 	return 0;
 }
 EXPORT_SYMBOL(fc_ns_init);
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 68ac8af..f454acb 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -96,7 +96,6 @@ enum fc_lport_state {
 	LPORT_ST_REG_FT,
 	LPORT_ST_SCR,
 	LPORT_ST_READY,
-	LPORT_ST_DNS_STOP,
 	LPORT_ST_LOGO,
 	LPORT_ST_RESET
 };
@@ -408,8 +407,6 @@ struct libfc_function_template {
 	 * Start discovery for a local port.
 	 */
 	int (*disc_start)(struct fc_lport *);
-
-	void (*disc_stop)(struct fc_lport *);
 };
 
 struct fc_lport {




More information about the devel mailing list