diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-03 07:07:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-04 14:10:28 -0500 |
commit | 6cfb5e759d47f037cbd0953ec2c3ceb220ed9e96 (patch) | |
tree | 7102ec0fd5d43b77343144c06bf743de7320fb79 /net/core | |
parent | 8db182f4a8a6e2dcb8b65905ea4af56210e65430 (diff) |
ethtool: Remove ethtool_ops::set_rx_ntuple operation
All implementations have been converted to implement set_rxnfc
instead.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/ethtool.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index e88b80d41f73..921aa2b4b415 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -631,58 +631,6 @@ out: | |||
631 | return ret; | 631 | return ret; |
632 | } | 632 | } |
633 | 633 | ||
634 | /* | ||
635 | * ethtool does not (or did not) set masks for flow parameters that are | ||
636 | * not specified, so if both value and mask are 0 then this must be | ||
637 | * treated as equivalent to a mask with all bits set. Implement that | ||
638 | * here rather than in drivers. | ||
639 | */ | ||
640 | static void rx_ntuple_fix_masks(struct ethtool_rx_ntuple_flow_spec *fs) | ||
641 | { | ||
642 | struct ethtool_tcpip4_spec *entry = &fs->h_u.tcp_ip4_spec; | ||
643 | struct ethtool_tcpip4_spec *mask = &fs->m_u.tcp_ip4_spec; | ||
644 | |||
645 | if (fs->flow_type != TCP_V4_FLOW && | ||
646 | fs->flow_type != UDP_V4_FLOW && | ||
647 | fs->flow_type != SCTP_V4_FLOW) | ||
648 | return; | ||
649 | |||
650 | if (!(entry->ip4src | mask->ip4src)) | ||
651 | mask->ip4src = htonl(0xffffffff); | ||
652 | if (!(entry->ip4dst | mask->ip4dst)) | ||
653 | mask->ip4dst = htonl(0xffffffff); | ||
654 | if (!(entry->psrc | mask->psrc)) | ||
655 | mask->psrc = htons(0xffff); | ||
656 | if (!(entry->pdst | mask->pdst)) | ||
657 | mask->pdst = htons(0xffff); | ||
658 | if (!(entry->tos | mask->tos)) | ||
659 | mask->tos = 0xff; | ||
660 | if (!(fs->vlan_tag | fs->vlan_tag_mask)) | ||
661 | fs->vlan_tag_mask = 0xffff; | ||
662 | if (!(fs->data | fs->data_mask)) | ||
663 | fs->data_mask = 0xffffffffffffffffULL; | ||
664 | } | ||
665 | |||
666 | static noinline_for_stack int ethtool_set_rx_ntuple(struct net_device *dev, | ||
667 | void __user *useraddr) | ||
668 | { | ||
669 | struct ethtool_rx_ntuple cmd; | ||
670 | const struct ethtool_ops *ops = dev->ethtool_ops; | ||
671 | |||
672 | if (!ops->set_rx_ntuple) | ||
673 | return -EOPNOTSUPP; | ||
674 | |||
675 | if (!(dev->features & NETIF_F_NTUPLE)) | ||
676 | return -EINVAL; | ||
677 | |||
678 | if (copy_from_user(&cmd, useraddr, sizeof(cmd))) | ||
679 | return -EFAULT; | ||
680 | |||
681 | rx_ntuple_fix_masks(&cmd.fs); | ||
682 | |||
683 | return ops->set_rx_ntuple(dev, &cmd); | ||
684 | } | ||
685 | |||
686 | static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) | 634 | static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) |
687 | { | 635 | { |
688 | struct ethtool_regs regs; | 636 | struct ethtool_regs regs; |
@@ -1495,9 +1443,6 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
1495 | case ETHTOOL_RESET: | 1443 | case ETHTOOL_RESET: |
1496 | rc = ethtool_reset(dev, useraddr); | 1444 | rc = ethtool_reset(dev, useraddr); |
1497 | break; | 1445 | break; |
1498 | case ETHTOOL_SRXNTUPLE: | ||
1499 | rc = ethtool_set_rx_ntuple(dev, useraddr); | ||
1500 | break; | ||
1501 | case ETHTOOL_GSSET_INFO: | 1446 | case ETHTOOL_GSSET_INFO: |
1502 | rc = ethtool_get_sset_info(dev, useraddr); | 1447 | rc = ethtool_get_sset_info(dev, useraddr); |
1503 | break; | 1448 | break; |