aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/8021q/vlan_dev.c')
-rw-r--r--net/8021q/vlan_dev.c54
1 files changed, 40 insertions, 14 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 8883e9c8a223..71193a6b10e6 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -163,8 +163,6 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
163 goto err_unlock; 163 goto err_unlock;
164 } 164 }
165 165
166 skb->dev->last_rx = jiffies;
167
168 stats = &skb->dev->stats; 166 stats = &skb->dev->stats;
169 stats->rx_packets++; 167 stats->rx_packets++;
170 stats->rx_bytes += skb->len; 168 stats->rx_bytes += skb->len;
@@ -526,6 +524,7 @@ out:
526static 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)
527{ 525{
528 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;
529 struct ifreq ifrr; 528 struct ifreq ifrr;
530 int err = -EOPNOTSUPP; 529 int err = -EOPNOTSUPP;
531 530
@@ -536,8 +535,8 @@ static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
536 case SIOCGMIIPHY: 535 case SIOCGMIIPHY:
537 case SIOCGMIIREG: 536 case SIOCGMIIREG:
538 case SIOCSMIIREG: 537 case SIOCSMIIREG:
539 if (real_dev->do_ioctl && netif_device_present(real_dev)) 538 if (netif_device_present(real_dev) && ops->ndo_do_ioctl)
540 err = real_dev->do_ioctl(real_dev, &ifrr, cmd); 539 err = ops->ndo_do_ioctl(real_dev, &ifrr, cmd);
541 break; 540 break;
542 } 541 }
543 542
@@ -648,6 +647,26 @@ static void vlan_dev_uninit(struct net_device *dev)
648 } 647 }
649} 648}
650 649
650static int vlan_ethtool_get_settings(struct net_device *dev,
651 struct ethtool_cmd *cmd)
652{
653 const struct vlan_dev_info *vlan = vlan_dev_info(dev);
654 struct net_device *real_dev = vlan->real_dev;
655
656 if (!real_dev->ethtool_ops->get_settings)
657 return -EOPNOTSUPP;
658
659 return real_dev->ethtool_ops->get_settings(real_dev, cmd);
660}
661
662static void vlan_ethtool_get_drvinfo(struct net_device *dev,
663 struct ethtool_drvinfo *info)
664{
665 strcpy(info->driver, vlan_fullname);
666 strcpy(info->version, vlan_version);
667 strcpy(info->fw_version, "N/A");
668}
669
651static u32 vlan_ethtool_get_rx_csum(struct net_device *dev) 670static u32 vlan_ethtool_get_rx_csum(struct net_device *dev)
652{ 671{
653 const struct vlan_dev_info *vlan = vlan_dev_info(dev); 672 const struct vlan_dev_info *vlan = vlan_dev_info(dev);
@@ -672,11 +691,27 @@ static u32 vlan_ethtool_get_flags(struct net_device *dev)
672} 691}
673 692
674static const struct ethtool_ops vlan_ethtool_ops = { 693static const struct ethtool_ops vlan_ethtool_ops = {
694 .get_settings = vlan_ethtool_get_settings,
695 .get_drvinfo = vlan_ethtool_get_drvinfo,
675 .get_link = ethtool_op_get_link, 696 .get_link = ethtool_op_get_link,
676 .get_rx_csum = vlan_ethtool_get_rx_csum, 697 .get_rx_csum = vlan_ethtool_get_rx_csum,
677 .get_flags = vlan_ethtool_get_flags, 698 .get_flags = vlan_ethtool_get_flags,
678}; 699};
679 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
680void vlan_setup(struct net_device *dev) 715void vlan_setup(struct net_device *dev)
681{ 716{
682 ether_setup(dev); 717 ether_setup(dev);
@@ -684,16 +719,7 @@ void vlan_setup(struct net_device *dev)
684 dev->priv_flags |= IFF_802_1Q_VLAN; 719 dev->priv_flags |= IFF_802_1Q_VLAN;
685 dev->tx_queue_len = 0; 720 dev->tx_queue_len = 0;
686 721
687 dev->change_mtu = vlan_dev_change_mtu; 722 dev->netdev_ops = &vlan_netdev_ops;
688 dev->init = vlan_dev_init;
689 dev->uninit = vlan_dev_uninit;
690 dev->open = vlan_dev_open;
691 dev->stop = vlan_dev_stop;
692 dev->set_mac_address = vlan_dev_set_mac_address;
693 dev->set_rx_mode = vlan_dev_set_rx_mode;
694 dev->set_multicast_list = vlan_dev_set_rx_mode;
695 dev->change_rx_flags = vlan_dev_change_rx_flags;
696 dev->do_ioctl = vlan_dev_ioctl;
697 dev->destructor = free_netdev; 723 dev->destructor = free_netdev;
698 dev->ethtool_ops = &vlan_ethtool_ops; 724 dev->ethtool_ops = &vlan_ethtool_ops;
699 725