aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2009-08-31 08:31:55 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-01 04:24:23 -0400
commit0af46d997fcbfd25a9e166c2431bfebc03720a36 (patch)
tree9516091be48bed458de11e9c6da529c16c2dffc3 /net
parentcb45439977d3602b91dd0aca2d94fa3b32aebba6 (diff)
vlan: Add support for net_devices_ops.ndo_fcoe_enable/_disable to VLAN
This adds implementation of the net_devices_ops.ndo_fcoe_enable/_disable to the VLAN driver. It checks if the real_dev has support for ndo_fcoe_enable/ ndo_fcoe_disable and if so, passes on to call the associated real_dev. Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlan_dev.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 84a2be43185f..53f84c743928 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -587,6 +587,28 @@ static int vlan_dev_fcoe_ddp_done(struct net_device *dev, u16 xid)
587 587
588 return len; 588 return len;
589} 589}
590
591static int vlan_dev_fcoe_enable(struct net_device *dev)
592{
593 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
594 const struct net_device_ops *ops = real_dev->netdev_ops;
595 int rc = -EINVAL;
596
597 if (ops->ndo_fcoe_enable)
598 rc = ops->ndo_fcoe_enable(real_dev);
599 return rc;
600}
601
602static int vlan_dev_fcoe_disable(struct net_device *dev)
603{
604 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
605 const struct net_device_ops *ops = real_dev->netdev_ops;
606 int rc = -EINVAL;
607
608 if (ops->ndo_fcoe_disable)
609 rc = ops->ndo_fcoe_disable(real_dev);
610 return rc;
611}
590#endif 612#endif
591 613
592static void vlan_dev_change_rx_flags(struct net_device *dev, int change) 614static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
@@ -750,6 +772,8 @@ static const struct net_device_ops vlan_netdev_ops = {
750#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) 772#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
751 .ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup, 773 .ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup,
752 .ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done, 774 .ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done,
775 .ndo_fcoe_enable = vlan_dev_fcoe_enable,
776 .ndo_fcoe_disable = vlan_dev_fcoe_disable,
753#endif 777#endif
754}; 778};
755 779
@@ -770,6 +794,8 @@ static const struct net_device_ops vlan_netdev_accel_ops = {
770#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) 794#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
771 .ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup, 795 .ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup,
772 .ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done, 796 .ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done,
797 .ndo_fcoe_enable = vlan_dev_fcoe_enable,
798 .ndo_fcoe_disable = vlan_dev_fcoe_disable,
773#endif 799#endif
774}; 800};
775 801