]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
fcoe: add support to the get_netdev() for fcoe_interface
authorYi Zou <yi.zou@intel.com>
Thu, 6 Dec 2012 06:23:43 +0000 (06:23 +0000)
committerRobert Love <robert.w.love@intel.com>
Fri, 14 Dec 2012 18:38:55 +0000 (10:38 -0800)
Adds support to fcoe_port's newly added get_netdev fucntion pointer.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Cc: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Tested-by: Marcus Dennis <marcusx.e.dennis@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
drivers/scsi/fcoe/fcoe.c
include/scsi/libfcoe.h

index 21927f7952d8c17c7e7313d46f10c87ab7625b00..4cec9ddc03ba4a4f889b57a3c346824819f9b679 100644 (file)
@@ -1118,6 +1118,7 @@ static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe,
        port = lport_priv(lport);
        port->lport = lport;
        port->priv = fcoe;
+       port->get_netdev = fcoe_netdev;
        port->max_queue_depth = FCOE_MAX_QUEUE_DEPTH;
        port->min_queue_depth = FCOE_MIN_QUEUE_DEPTH;
        INIT_WORK(&port->destroy_work, fcoe_destroy_work);
index 52bba71380697a69a0fb62bcffde78a13a35d4d6..746bc587ae344a62cb0a51f902b3f65372655d1d 100644 (file)
@@ -353,6 +353,18 @@ struct fcoe_port {
        u8                    data_src_addr[ETH_ALEN];
        struct net_device * (*get_netdev)(const struct fc_lport *lport);
 };
+
+/**
+ * fcoe_get_netdev() - Return the net device associated with a local port
+ * @lport: The local port to get the net device from
+ */
+static inline struct net_device *fcoe_get_netdev(const struct fc_lport *lport)
+{
+       struct fcoe_port *port = ((struct fcoe_port *)lport_priv(lport));
+
+       return (port->get_netdev) ? port->get_netdev(lport) : NULL;
+}
+
 void fcoe_clean_pending_queue(struct fc_lport *);
 void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb);
 void fcoe_queue_timer(ulong lport);