Skip to content

Commit

Permalink
fcoe: add support to the get_netdev() for fcoe_interface
Browse files Browse the repository at this point in the history
Adds support to fcoe_port's newly added get_netdev fucntion pointer.

Signed-off-by: Yi Zou <[email protected]>
Cc: Bhanu Prakash Gollapudi <[email protected]>
Tested-by: Marcus Dennis <[email protected]>
Signed-off-by: Robert Love <[email protected]>
  • Loading branch information
yizou authored and Robert Love committed Dec 14, 2012
1 parent 8106fb4 commit 66524ec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 12 additions & 0 deletions include/scsi/libfcoe.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 66524ec

Please sign in to comment.