Add the fcoe_ctlr pointer as an unused (for now) argument to
fcoe_libfc_config().

Add a new function fcoe_disc_init() to initialize just the
discovery portion of libfcoe for VN2VN mode.
For now it just calls fc_disc_init().

This simplifies the future patch for VN2VN mode for review by
isolating the fcoe and fnic portions of the change.
It can be merged in with the main VN2VN patch after review.

Signed-off-by: Joe Eykholt <[email protected]>
---
 drivers/scsi/fcoe/fcoe.c      |    2 +-
 drivers/scsi/fcoe/libfcoe.c   |   16 ++++++++++++++--
 drivers/scsi/fnic/fnic_main.c |    2 +-
 include/scsi/libfcoe.h        |    4 +++-
 4 files changed, 19 insertions(+), 5 deletions(-)


diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index bfe2a5e..1dd3b9a 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -966,7 +966,7 @@ static struct fc_lport *fcoe_if_create(struct 
fcoe_interface *fcoe,
        }
 
        /* Initialize the library */
-       rc = fcoe_libfc_config(lport, &fcoe_libfc_fcn_templ);
+       rc = fcoe_libfc_config(lport, &fcoe->ctlr, &fcoe_libfc_fcn_templ);
        if (rc) {
                FCOE_NETDEV_DBG(netdev, "Could not configure libfc for the "
                                "interface\n");
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 7763f01..0a51a57 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -1375,14 +1375,26 @@ u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN],
 EXPORT_SYMBOL_GPL(fcoe_wwn_from_mac);
 
 /**
+ * fcoe_disc_init() - initialize libfc or libfcoe remote port discovery
+ * @lp: The local port to configure libfc for
+ * @fip: The FCoE controller in use by the local port
+ */
+void fcoe_disc_init(struct fc_lport *lport, struct fcoe_ctlr *fip)
+{
+       fc_disc_init(lport);
+}
+EXPORT_SYMBOL_GPL(fcoe_disc_init);
+
+/**
  * fcoe_libfc_config() - Sets up libfc related properties for local port
  * @lp: The local port to configure libfc for
+ * @fip: The FCoE controller in use by the local port
  * @tt: The libfc function template
  *
  * Returns : 0 for success
  */
-int fcoe_libfc_config(struct fc_lport *lport,
-                     struct libfc_function_template *tt)
+int fcoe_libfc_config(struct fc_lport *lport, struct fcoe_ctlr *fip,
+                     const struct libfc_function_template *tt)
 {
        /* Set the function pointers set by the LLDD */
        memcpy(&lport->tt, tt, sizeof(*tt));
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index d0fe1c3..6bae2ff 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -693,7 +693,7 @@ static int __devinit fnic_probe(struct pci_dev *pdev,
        fc_exch_init(lp);
        fc_elsct_init(lp);
        fc_rport_init(lp);
-       fc_disc_init(lp);
+       fcoe_disc_init(lp, &fnic->ctlr);
 
        if (!fc_exch_mgr_alloc(lp, FC_CLASS_3, FCPIO_HOST_EXCH_RANGE_START,
                               FCPIO_HOST_EXCH_RANGE_END, NULL)) {
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 6dc273a..a5a9aa6 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -177,6 +177,8 @@ int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *, struct 
fc_lport *,
 
 /* libfcoe funcs */
 u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int);
-int fcoe_libfc_config(struct fc_lport *, struct libfc_function_template *);
+int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *,
+                     const struct libfc_function_template *);
+void fcoe_disc_init(struct fc_lport *, struct fcoe_ctlr *);
 
 #endif /* _LIBFCOE_H */


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

Reply via email to