aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/ethtool.c')
-rw-r--r--net/core/ethtool.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 33ce7ed6afc6..27ce1683caf5 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -614,6 +614,29 @@ static int ethtool_set_ufo(struct net_device *dev, char __user *useraddr)
614 return dev->ethtool_ops->set_ufo(dev, edata.data); 614 return dev->ethtool_ops->set_ufo(dev, edata.data);
615} 615}
616 616
617static int ethtool_get_gso(struct net_device *dev, char __user *useraddr)
618{
619 struct ethtool_value edata = { ETHTOOL_GGSO };
620
621 edata.data = dev->features & NETIF_F_GSO;
622 if (copy_to_user(useraddr, &edata, sizeof(edata)))
623 return -EFAULT;
624 return 0;
625}
626
627static int ethtool_set_gso(struct net_device *dev, char __user *useraddr)
628{
629 struct ethtool_value edata;
630
631 if (copy_from_user(&edata, useraddr, sizeof(edata)))
632 return -EFAULT;
633 if (edata.data)
634 dev->features |= NETIF_F_GSO;
635 else
636 dev->features &= ~NETIF_F_GSO;
637 return 0;
638}
639
617static int ethtool_self_test(struct net_device *dev, char __user *useraddr) 640static int ethtool_self_test(struct net_device *dev, char __user *useraddr)
618{ 641{
619 struct ethtool_test test; 642 struct ethtool_test test;
@@ -905,6 +928,12 @@ int dev_ethtool(struct ifreq *ifr)
905 case ETHTOOL_SUFO: 928 case ETHTOOL_SUFO:
906 rc = ethtool_set_ufo(dev, useraddr); 929 rc = ethtool_set_ufo(dev, useraddr);
907 break; 930 break;
931 case ETHTOOL_GGSO:
932 rc = ethtool_get_gso(dev, useraddr);
933 break;
934 case ETHTOOL_SGSO:
935 rc = ethtool_set_gso(dev, useraddr);
936 break;
908 default: 937 default:
909 rc = -EOPNOTSUPP; 938 rc = -EOPNOTSUPP;
910 } 939 }