int fcoe_libfc_config(struct fc_lport *lport, struct fcoe_ctlr *fip,
const struct libfc_function_template *tt, int init_fcp)
{
+ void *priv = lport;
+
/* Set the function pointers set by the LLDD */
memcpy(&lport->tt, tt, sizeof(*tt));
if (init_fcp && fc_fcp_init(lport))
lport->tt.disc_start = fcoe_ctlr_disc_start;
lport->tt.disc_stop = fcoe_ctlr_disc_stop;
lport->tt.disc_stop_final = fcoe_ctlr_disc_stop_final;
- mutex_init(&lport->disc.disc_mutex);
- INIT_LIST_HEAD(&lport->disc.rports);
- lport->disc.priv = fip;
- } else {
- fc_disc_init(lport);
+ priv = fip;
}
+
+ fc_disc_init(lport, priv);
+
return 0;
}
EXPORT_SYMBOL_GPL(fcoe_libfc_config);
/**
* fc_disc_init() - Initialize the discovery layer for a local port
* @lport: The local port that needs the discovery layer to be initialized
+ * @priv: Private data structre for users of the discovery layer
*/
-int fc_disc_init(struct fc_lport *lport)
+int fc_disc_init(struct fc_lport *lport, void *priv)
{
struct fc_disc *disc;
mutex_init(&disc->disc_mutex);
INIT_LIST_HEAD(&disc->rports);
- disc->priv = lport;
+ disc->priv = priv;
return 0;
}
/*
* DISCOVERY LAYER
*****************************/
-int fc_disc_init(struct fc_lport *);
+int fc_disc_init(struct fc_lport *, void *);
static inline struct fc_lport *fc_disc_lport(struct fc_disc *disc)
{