[Open-FCoE] [PATCH 21/28] libfc: remove lport_login/logout() from the libfc_function_template

Robert Love robert.w.love at intel.com
Tue Sep 30 18:26:40 UTC 2008


The other blocks shouldn't be determining what the lport is doing.
We just want to send rport events to the lport and allow the lport
to determine if it should be logging in or out.

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

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

diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 908859b..85a0131 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -412,7 +412,7 @@ void fc_linkup(struct fc_lport *lp)
 		lp->link_status |= FC_LINK_UP;
 		fc_lport_lock(lp);
 		if (lp->state == LPORT_ST_RESET)
-			lp->tt.lport_login(lp);
+			fc_lport_enter_flogi(lp);
 		fc_lport_unlock(lp);
 	}
 }
@@ -1093,15 +1093,6 @@ static void fc_lport_enter_logo(struct fc_lport *lp)
 			      FC_FC_SEQ_INIT | FC_FC_END_SEQ);
 }
 
-static int fc_lport_logout(struct fc_lport *lp)
-{
-	fc_lport_lock(lp);
-	if (lp->state != LPORT_ST_LOGO)
-		fc_lport_enter_logo(lp);
-	fc_lport_unlock(lp);
-	return 0;
-}
-
 /*
  * Handle incoming ELS FLOGI response.
  * Save parameters of remote switch.  Finish exchange.
@@ -1233,15 +1224,9 @@ int fc_lport_init(struct fc_lport *lp)
 	if (!lp->tt.lport_recv)
 		lp->tt.lport_recv = fc_lport_recv;
 
-	if (!lp->tt.lport_login)
-		lp->tt.lport_login = fc_lport_enter_reset;
-
 	if (!lp->tt.lport_reset)
 		lp->tt.lport_reset = fc_lport_enter_reset;
 
-	if (!lp->tt.lport_logout)
-		lp->tt.lport_logout = fc_lport_logout;
-
 	if (!lp->tt.event_callback)
 		lp->tt.event_callback = fc_lport_rport_event;
 
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index ef9e68b..d115aa6 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -347,9 +347,7 @@ struct libfc_function_template {
 	void (*lport_recv)(struct fc_lport *lp, struct fc_seq *sp,
 			   struct fc_frame *fp);
 
-	int (*lport_login)(struct fc_lport *);
 	int (*lport_reset)(struct fc_lport *);
-	int (*lport_logout)(struct fc_lport *);
 
 	void (*event_callback)(struct fc_lport *, u32,
 			       enum fc_lport_event);




More information about the devel mailing list