diff options
Diffstat (limited to 'net/8021q/vlan_dev.c')
-rw-r--r-- | net/8021q/vlan_dev.c | 30 |
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: | |||
524 | static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | 524 | static 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 | ||
701 | static 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 | |||
700 | void vlan_setup(struct net_device *dev) | 715 | void 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 | ||