On 11/16/2012 03:42 PM, Yi Zou wrote:
fcoe_netdev() gets to the underlying private per fcoe transport's private

I think you meant fcoe_get_netdev() since the function name has changed.
structure, e.g., fcoe_interface for fcoe and returns the associated netdev. The
similar logic exists in other fcoe drivers, e.g., bnx2fc, so we add a function
pointer into the common fcoe_port struct to allow individual fcoe transport
implementaion (fcoe and bnx2fc) to get the corresponding netdev associated with
a give lport.

This allows fcoe_netdev() be used regardless of the individual fcoe transport
Same here.

driver, and also allows move more common code such as fcoe_link_speed_update or
fcoe_ctlr_get_lesb to be in libfcoe, rather than specific to fcoe.

This patch is a prep work that adds aforementioned fucntion pointer, and
followed by the actual code changes to make use of it.

Signed-off-by: Yi Zou <yi....@intel.com>
Cc: Bhanu Prakash Gollapudi <bprak...@broadcom.com>
---

  include/scsi/libfcoe.h |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 8742d85..37ead4d 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -347,6 +347,7 @@ struct fcoe_port {
        struct timer_list     timer;
        struct work_struct    destroy_work;
        u8                    data_src_addr[ETH_ALEN];
+       struct net_device * (*get_netdev)(const struct fc_lport *lport);
  };
  void fcoe_clean_pending_queue(struct fc_lport *);
  void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb);





_______________________________________________
devel mailing list
devel@open-fcoe.org
https://lists.open-fcoe.org/mailman/listinfo/devel

Reply via email to