summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2013-03-25 11:00:28 -0700
committerRobert Love <robert.w.love@intel.com>2013-03-25 16:03:03 -0700
commit0807619d3c64d935c257a377ac86982c777f969c (patch)
tree694bc549a00c1128ba304c362504ed5c73848ed5 /drivers
parent8a9a71381208b2364a2d12b0d257ae333917a1bc (diff)
downloadtalos-obmc-linux-0807619d3c64d935c257a377ac86982c777f969c.tar.gz
talos-obmc-linux-0807619d3c64d935c257a377ac86982c777f969c.zip
libfc, fcoe, bnx2fc: Split fc_disc_init into fc_disc_{init, config}
Split discovery initialization in code that is setup once (fcoe_disc_init) and code that can be re-configured (fcoe_disc_config). Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Jack Morgan <jack.morgan@intel.com> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c3
-rw-r--r--drivers/scsi/fcoe/fcoe_ctlr.c3
-rw-r--r--drivers/scsi/libfc/fc_disc.c25
3 files changed, 21 insertions, 10 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index b867b1bfa908..90bc7bd00966 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -939,7 +939,8 @@ static int bnx2fc_libfc_config(struct fc_lport *lport)
fc_elsct_init(lport);
fc_exch_init(lport);
fc_rport_init(lport);
- fc_disc_init(lport, lport);
+ fc_disc_init(lport);
+ fc_disc_config(lport, lport);
return 0;
}
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index ba2f977a6e1d..34ee56cf4bcc 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -2847,7 +2847,8 @@ int fcoe_libfc_config(struct fc_lport *lport, struct fcoe_ctlr *fip,
priv = fip;
}
- fc_disc_init(lport, priv);
+ fc_disc_init(lport);
+ fc_disc_config(lport, priv);
return 0;
}
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 141c54b97082..880a9068ca12 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -712,13 +712,13 @@ static void fc_disc_stop_final(struct fc_lport *lport)
}
/**
- * fc_disc_init() - Initialize the discovery layer for a local port
- * @lport: The local port that needs the discovery layer to be initialized
+ * fc_disc_config() - Configure the discovery layer for a local port
+ * @lport: The local port that needs the discovery layer to be configured
* @priv: Private data structre for users of the discovery layer
*/
-int fc_disc_init(struct fc_lport *lport, void *priv)
+void fc_disc_config(struct fc_lport *lport, void *priv)
{
- struct fc_disc *disc;
+ struct fc_disc *disc = &lport->disc;
if (!lport->tt.disc_start)
lport->tt.disc_start = fc_disc_start;
@@ -733,12 +733,21 @@ int fc_disc_init(struct fc_lport *lport, void *priv)
lport->tt.disc_recv_req = fc_disc_recv_req;
disc = &lport->disc;
- INIT_DELAYED_WORK(&disc->disc_work, fc_disc_timeout);
- mutex_init(&disc->disc_mutex);
- INIT_LIST_HEAD(&disc->rports);
disc->priv = priv;
+}
+EXPORT_SYMBOL(fc_disc_config);
- return 0;
+/**
+ * fc_disc_init() - Initialize the discovery layer for a local port
+ * @lport: The local port that needs the discovery layer to be initialized
+ */
+void fc_disc_init(struct fc_lport *lport)
+{
+ struct fc_disc *disc = &lport->disc;
+
+ INIT_DELAYED_WORK(&disc->disc_work, fc_disc_timeout);
+ mutex_init(&disc->disc_mutex);
+ INIT_LIST_HEAD(&disc->rports);
}
EXPORT_SYMBOL(fc_disc_init);
OpenPOWER on IntegriCloud