aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan_dev.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-11-20 00:53:47 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-20 01:42:41 -0500
commit656299f706e52e0409733d704c2761f1b12d6954 (patch)
treefcf2013d86e552eda9e9576acc58a32912c616f4 /net/8021q/vlan_dev.c
parent5bc3eb7e2f0026f246d939851109df99e8e9f64a (diff)
vlan: convert to net_device_ops
Convert vlan devices and function pointers to net_device_ops. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan_dev.c')
-rw-r--r--net/8021q/vlan_dev.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index e4bf39f87032..71193a6b10e6 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -524,6 +524,7 @@ out:
524static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 524static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
525{ 525{
526 struct net_device *real_dev = vlan_dev_info(dev)->real_dev; 526 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
527 const struct net_device_ops *ops = real_dev->netdev_ops;
527 struct ifreq ifrr; 528 struct ifreq ifrr;
528 int err = -EOPNOTSUPP; 529 int err = -EOPNOTSUPP;
529 530
@@ -534,8 +535,8 @@ static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
534 case SIOCGMIIPHY: 535 case SIOCGMIIPHY:
535 case SIOCGMIIREG: 536 case SIOCGMIIREG:
536 case SIOCSMIIREG: 537 case SIOCSMIIREG:
537 if (real_dev->do_ioctl && netif_device_present(real_dev)) 538 if (netif_device_present(real_dev) && ops->ndo_do_ioctl)
538 err = real_dev->do_ioctl(real_dev, &ifrr, cmd); 539 err = ops->ndo_do_ioctl(real_dev, &ifrr, cmd);
539 break; 540 break;
540 } 541 }
541 542
@@ -697,6 +698,20 @@ static const struct ethtool_ops vlan_ethtool_ops = {
697 .get_flags = vlan_ethtool_get_flags, 698 .get_flags = vlan_ethtool_get_flags,
698}; 699};
699 700
701static const struct net_device_ops vlan_netdev_ops = {
702 .ndo_change_mtu = vlan_dev_change_mtu,
703 .ndo_init = vlan_dev_init,
704 .ndo_uninit = vlan_dev_uninit,
705 .ndo_open = vlan_dev_open,
706 .ndo_stop = vlan_dev_stop,
707 .ndo_validate_addr = eth_validate_addr,
708 .ndo_set_mac_address = vlan_dev_set_mac_address,
709 .ndo_set_rx_mode = vlan_dev_set_rx_mode,
710 .ndo_set_multicast_list = vlan_dev_set_rx_mode,
711 .ndo_change_rx_flags = vlan_dev_change_rx_flags,
712 .ndo_do_ioctl = vlan_dev_ioctl,
713};
714
700void vlan_setup(struct net_device *dev) 715void vlan_setup(struct net_device *dev)
701{ 716{
702 ether_setup(dev); 717 ether_setup(dev);
@@ -704,16 +719,7 @@ void vlan_setup(struct net_device *dev)
704 dev->priv_flags |= IFF_802_1Q_VLAN; 719 dev->priv_flags |= IFF_802_1Q_VLAN;
705 dev->tx_queue_len = 0; 720 dev->tx_queue_len = 0;
706 721
707 dev->change_mtu = vlan_dev_change_mtu; 722 dev->netdev_ops = &vlan_netdev_ops;
708 dev->init = vlan_dev_init;
709 dev->uninit = vlan_dev_uninit;
710 dev->open = vlan_dev_open;
711 dev->stop = vlan_dev_stop;
712 dev->set_mac_address = vlan_dev_set_mac_address;
713 dev->set_rx_mode = vlan_dev_set_rx_mode;
714 dev->set_multicast_list = vlan_dev_set_rx_mode;
715 dev->change_rx_flags = vlan_dev_change_rx_flags;
716 dev->do_ioctl = vlan_dev_ioctl;
717 dev->destructor = free_netdev; 723 dev->destructor = free_netdev;
718 dev->ethtool_ops = &vlan_ethtool_ops; 724 dev->ethtool_ops = &vlan_ethtool_ops;
719 725