We want to know when an rport has successfully logged in
or not. The lport needs to know if the NS's rport is READY
or not. If it's not READY then the lport needs to decide
what it wants to do. The rport and NS shouldn't be
making decisions for the lport.

Signed-off-by: Robert Love <[EMAIL PROTECTED]>
---

 drivers/scsi/libfc/fc_lport.c |    9 +++++++++
 include/scsi/libfc/libfc.h    |    7 +++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index baddaf5..079cc56 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -58,6 +58,12 @@ static int fc_frame_drop(struct fc_lport *lp, struct 
fc_frame *fp)
        return 0;
 }
 
+static int fc_lport_event_callback(struct fc_lport *lp, struct fc_rport *rp,
+                                  enum fc_lport_event event)
+{
+       return 0;
+}
+
 static const char *fc_lport_state(struct fc_lport *lp)
 {
        const char *cp;
@@ -908,6 +914,9 @@ int fc_lport_init(struct fc_lport *lp)
 
        if (!lp->tt.lport_logout)
                lp->tt.lport_logout = fc_lport_logout;
+       
+       if (!lp->tt.lport_event_callback)
+               lp->tt.lport_event_callback = fc_lport_event_callback;
 
        return 0;
 }
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 085c71c..607a7f4 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -100,6 +100,11 @@ enum fc_lport_state {
        LPORT_ST_RESET
 };
 
+enum fc_lport_event {
+       LPORT_EV_RPORT_SUCCESS = 0,
+       LPORT_EV_RPORT_FAILURE
+};
+
 enum fc_rport_state {
        RPORT_ST_NONE = 0,
        RPORT_ST_INIT,          /* initialized */
@@ -328,6 +333,8 @@ struct libfc_function_template {
        int (*lport_login)(struct fc_lport *);
        int (*lport_reset)(struct fc_lport *);
        int (*lport_logout)(struct fc_lport *);
+       int (*lport_event_callback)(struct fc_lport *, struct fc_rport *,
+                                   enum fc_lport_event);
 
        /**
         * Remote Port interfaces

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to