2 * net/core/ethtool.c - Ethtool ioctl handler
3 * Copyright (c) 2003 Matthew Wilcox <matthew@wil.cx>
5 * This file is where we call all the ethtool_ops commands to get
6 * the information ethtool needs.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
14 #include <linux/module.h>
15 #include <linux/types.h>
16 #include <linux/capability.h>
17 #include <linux/errno.h>
18 #include <linux/ethtool.h>
19 #include <linux/netdevice.h>
20 #include <asm/uaccess.h>
23 * Some useful ethtool_ops methods that're device independent.
24 * If we find that all drivers want to do the same thing here,
25 * we can turn these into dev_() function calls.
28 u32 ethtool_op_get_link(struct net_device *dev)
30 return netif_carrier_ok(dev) ? 1 : 0;
33 u32 ethtool_op_get_tx_csum(struct net_device *dev)
35 return (dev->features & NETIF_F_ALL_CSUM) != 0;
38 int ethtool_op_set_tx_csum(struct net_device *dev, u32 data)
41 dev->features |= NETIF_F_IP_CSUM;
43 dev->features &= ~NETIF_F_IP_CSUM;
48 int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data)
51 dev->features |= NETIF_F_HW_CSUM;
53 dev->features &= ~NETIF_F_HW_CSUM;
58 int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data)
61 dev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
63 dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
68 u32 ethtool_op_get_sg(struct net_device *dev)
70 return (dev->features & NETIF_F_SG) != 0;
73 int ethtool_op_set_sg(struct net_device *dev, u32 data)
76 dev->features |= NETIF_F_SG;
78 dev->features &= ~NETIF_F_SG;
83 u32 ethtool_op_get_tso(struct net_device *dev)
85 return (dev->features & NETIF_F_TSO) != 0;
88 int ethtool_op_set_tso(struct net_device *dev, u32 data)
91 dev->features |= NETIF_F_TSO;
93 dev->features &= ~NETIF_F_TSO;
98 u32 ethtool_op_get_ufo(struct net_device *dev)
100 return (dev->features & NETIF_F_UFO) != 0;
103 int ethtool_op_set_ufo(struct net_device *dev, u32 data)
106 dev->features |= NETIF_F_UFO;
108 dev->features &= ~NETIF_F_UFO;
112 /* the following list of flags are the same as their associated
113 * NETIF_F_xxx values in include/linux/netdevice.h
115 static const u32 flags_dup_features =
118 u32 ethtool_op_get_flags(struct net_device *dev)
120 /* in the future, this function will probably contain additional
121 * handling for flags which are not so easily handled
122 * by a simple masking operation
125 return dev->features & flags_dup_features;
128 int ethtool_op_set_flags(struct net_device *dev, u32 data)
130 if (data & ETH_FLAG_LRO)
131 dev->features |= NETIF_F_LRO;
133 dev->features &= ~NETIF_F_LRO;
138 /* Handlers for each ethtool command */
140 static int ethtool_get_settings(struct net_device *dev, void __user *useraddr)
142 struct ethtool_cmd cmd = { ETHTOOL_GSET };
145 if (!dev->ethtool_ops->get_settings)
148 err = dev->ethtool_ops->get_settings(dev, &cmd);
152 if (copy_to_user(useraddr, &cmd, sizeof(cmd)))
157 static int ethtool_set_settings(struct net_device *dev, void __user *useraddr)
159 struct ethtool_cmd cmd;
161 if (!dev->ethtool_ops->set_settings)
164 if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
167 return dev->ethtool_ops->set_settings(dev, &cmd);
170 static int ethtool_get_drvinfo(struct net_device *dev, void __user *useraddr)
172 struct ethtool_drvinfo info;
173 const struct ethtool_ops *ops = dev->ethtool_ops;
175 if (!ops->get_drvinfo)
178 memset(&info, 0, sizeof(info));
179 info.cmd = ETHTOOL_GDRVINFO;
180 ops->get_drvinfo(dev, &info);
182 if (ops->get_sset_count) {
185 rc = ops->get_sset_count(dev, ETH_SS_TEST);
187 info.testinfo_len = rc;
188 rc = ops->get_sset_count(dev, ETH_SS_STATS);
192 /* code path for obsolete hooks */
194 if (ops->self_test_count)
195 info.testinfo_len = ops->self_test_count(dev);
196 if (ops->get_stats_count)
197 info.n_stats = ops->get_stats_count(dev);
199 if (ops->get_regs_len)
200 info.regdump_len = ops->get_regs_len(dev);
201 if (ops->get_eeprom_len)
202 info.eedump_len = ops->get_eeprom_len(dev);
204 if (copy_to_user(useraddr, &info, sizeof(info)))
209 static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
211 struct ethtool_regs regs;
212 const struct ethtool_ops *ops = dev->ethtool_ops;
216 if (!ops->get_regs || !ops->get_regs_len)
219 if (copy_from_user(®s, useraddr, sizeof(regs)))
222 reglen = ops->get_regs_len(dev);
223 if (regs.len > reglen)
226 regbuf = kmalloc(reglen, GFP_USER);
230 ops->get_regs(dev, ®s, regbuf);
233 if (copy_to_user(useraddr, ®s, sizeof(regs)))
235 useraddr += offsetof(struct ethtool_regs, data);
236 if (copy_to_user(useraddr, regbuf, regs.len))
245 static int ethtool_get_wol(struct net_device *dev, char __user *useraddr)
247 struct ethtool_wolinfo wol = { ETHTOOL_GWOL };
249 if (!dev->ethtool_ops->get_wol)
252 dev->ethtool_ops->get_wol(dev, &wol);
254 if (copy_to_user(useraddr, &wol, sizeof(wol)))
259 static int ethtool_set_wol(struct net_device *dev, char __user *useraddr)
261 struct ethtool_wolinfo wol;
263 if (!dev->ethtool_ops->set_wol)
266 if (copy_from_user(&wol, useraddr, sizeof(wol)))
269 return dev->ethtool_ops->set_wol(dev, &wol);
272 static int ethtool_get_msglevel(struct net_device *dev, char __user *useraddr)
274 struct ethtool_value edata = { ETHTOOL_GMSGLVL };
276 if (!dev->ethtool_ops->get_msglevel)
279 edata.data = dev->ethtool_ops->get_msglevel(dev);
281 if (copy_to_user(useraddr, &edata, sizeof(edata)))
286 static int ethtool_set_msglevel(struct net_device *dev, char __user *useraddr)
288 struct ethtool_value edata;
290 if (!dev->ethtool_ops->set_msglevel)
293 if (copy_from_user(&edata, useraddr, sizeof(edata)))
296 dev->ethtool_ops->set_msglevel(dev, edata.data);
300 static int ethtool_nway_reset(struct net_device *dev)
302 if (!dev->ethtool_ops->nway_reset)
305 return dev->ethtool_ops->nway_reset(dev);
308 static int ethtool_get_link(struct net_device *dev, void __user *useraddr)
310 struct ethtool_value edata = { ETHTOOL_GLINK };
312 if (!dev->ethtool_ops->get_link)
315 edata.data = dev->ethtool_ops->get_link(dev);
317 if (copy_to_user(useraddr, &edata, sizeof(edata)))
322 static int ethtool_get_eeprom(struct net_device *dev, void __user *useraddr)
324 struct ethtool_eeprom eeprom;
325 const struct ethtool_ops *ops = dev->ethtool_ops;
329 if (!ops->get_eeprom || !ops->get_eeprom_len)
332 if (copy_from_user(&eeprom, useraddr, sizeof(eeprom)))
335 /* Check for wrap and zero */
336 if (eeprom.offset + eeprom.len <= eeprom.offset)
339 /* Check for exceeding total eeprom len */
340 if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev))
343 data = kmalloc(eeprom.len, GFP_USER);
348 if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len))
351 ret = ops->get_eeprom(dev, &eeprom, data);
356 if (copy_to_user(useraddr, &eeprom, sizeof(eeprom)))
358 if (copy_to_user(useraddr + sizeof(eeprom), data, eeprom.len))
367 static int ethtool_set_eeprom(struct net_device *dev, void __user *useraddr)
369 struct ethtool_eeprom eeprom;
370 const struct ethtool_ops *ops = dev->ethtool_ops;
374 if (!ops->set_eeprom || !ops->get_eeprom_len)
377 if (copy_from_user(&eeprom, useraddr, sizeof(eeprom)))
380 /* Check for wrap and zero */
381 if (eeprom.offset + eeprom.len <= eeprom.offset)
384 /* Check for exceeding total eeprom len */
385 if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev))
388 data = kmalloc(eeprom.len, GFP_USER);
393 if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len))
396 ret = ops->set_eeprom(dev, &eeprom, data);
400 if (copy_to_user(useraddr + sizeof(eeprom), data, eeprom.len))
408 static int ethtool_get_coalesce(struct net_device *dev, void __user *useraddr)
410 struct ethtool_coalesce coalesce = { ETHTOOL_GCOALESCE };
412 if (!dev->ethtool_ops->get_coalesce)
415 dev->ethtool_ops->get_coalesce(dev, &coalesce);
417 if (copy_to_user(useraddr, &coalesce, sizeof(coalesce)))
422 static int ethtool_set_coalesce(struct net_device *dev, void __user *useraddr)
424 struct ethtool_coalesce coalesce;
426 if (!dev->ethtool_ops->set_coalesce)
429 if (copy_from_user(&coalesce, useraddr, sizeof(coalesce)))
432 return dev->ethtool_ops->set_coalesce(dev, &coalesce);
435 static int ethtool_get_ringparam(struct net_device *dev, void __user *useraddr)
437 struct ethtool_ringparam ringparam = { ETHTOOL_GRINGPARAM };
439 if (!dev->ethtool_ops->get_ringparam)
442 dev->ethtool_ops->get_ringparam(dev, &ringparam);
444 if (copy_to_user(useraddr, &ringparam, sizeof(ringparam)))
449 static int ethtool_set_ringparam(struct net_device *dev, void __user *useraddr)
451 struct ethtool_ringparam ringparam;
453 if (!dev->ethtool_ops->set_ringparam)
456 if (copy_from_user(&ringparam, useraddr, sizeof(ringparam)))
459 return dev->ethtool_ops->set_ringparam(dev, &ringparam);
462 static int ethtool_get_pauseparam(struct net_device *dev, void __user *useraddr)
464 struct ethtool_pauseparam pauseparam = { ETHTOOL_GPAUSEPARAM };
466 if (!dev->ethtool_ops->get_pauseparam)
469 dev->ethtool_ops->get_pauseparam(dev, &pauseparam);
471 if (copy_to_user(useraddr, &pauseparam, sizeof(pauseparam)))
476 static int ethtool_set_pauseparam(struct net_device *dev, void __user *useraddr)
478 struct ethtool_pauseparam pauseparam;
480 if (!dev->ethtool_ops->set_pauseparam)
483 if (copy_from_user(&pauseparam, useraddr, sizeof(pauseparam)))
486 return dev->ethtool_ops->set_pauseparam(dev, &pauseparam);
489 static int ethtool_get_rx_csum(struct net_device *dev, char __user *useraddr)
491 struct ethtool_value edata = { ETHTOOL_GRXCSUM };
493 if (!dev->ethtool_ops->get_rx_csum)
496 edata.data = dev->ethtool_ops->get_rx_csum(dev);
498 if (copy_to_user(useraddr, &edata, sizeof(edata)))
503 static int ethtool_set_rx_csum(struct net_device *dev, char __user *useraddr)
505 struct ethtool_value edata;
507 if (!dev->ethtool_ops->set_rx_csum)
510 if (copy_from_user(&edata, useraddr, sizeof(edata)))
513 dev->ethtool_ops->set_rx_csum(dev, edata.data);
517 static int ethtool_get_tx_csum(struct net_device *dev, char __user *useraddr)
519 struct ethtool_value edata = { ETHTOOL_GTXCSUM };
521 if (!dev->ethtool_ops->get_tx_csum)
524 edata.data = dev->ethtool_ops->get_tx_csum(dev);
526 if (copy_to_user(useraddr, &edata, sizeof(edata)))
531 static int __ethtool_set_sg(struct net_device *dev, u32 data)
535 if (!data && dev->ethtool_ops->set_tso) {
536 err = dev->ethtool_ops->set_tso(dev, 0);
541 if (!data && dev->ethtool_ops->set_ufo) {
542 err = dev->ethtool_ops->set_ufo(dev, 0);
546 return dev->ethtool_ops->set_sg(dev, data);
549 static int ethtool_set_tx_csum(struct net_device *dev, char __user *useraddr)
551 struct ethtool_value edata;
554 if (!dev->ethtool_ops->set_tx_csum)
557 if (copy_from_user(&edata, useraddr, sizeof(edata)))
560 if (!edata.data && dev->ethtool_ops->set_sg) {
561 err = __ethtool_set_sg(dev, 0);
566 return dev->ethtool_ops->set_tx_csum(dev, edata.data);
569 static int ethtool_get_sg(struct net_device *dev, char __user *useraddr)
571 struct ethtool_value edata = { ETHTOOL_GSG };
573 if (!dev->ethtool_ops->get_sg)
576 edata.data = dev->ethtool_ops->get_sg(dev);
578 if (copy_to_user(useraddr, &edata, sizeof(edata)))
583 static int ethtool_set_sg(struct net_device *dev, char __user *useraddr)
585 struct ethtool_value edata;
587 if (!dev->ethtool_ops->set_sg)
590 if (copy_from_user(&edata, useraddr, sizeof(edata)))
594 !(dev->features & NETIF_F_ALL_CSUM))
597 return __ethtool_set_sg(dev, edata.data);
600 static int ethtool_get_tso(struct net_device *dev, char __user *useraddr)
602 struct ethtool_value edata = { ETHTOOL_GTSO };
604 if (!dev->ethtool_ops->get_tso)
607 edata.data = dev->ethtool_ops->get_tso(dev);
609 if (copy_to_user(useraddr, &edata, sizeof(edata)))
614 static int ethtool_set_tso(struct net_device *dev, char __user *useraddr)
616 struct ethtool_value edata;
618 if (!dev->ethtool_ops->set_tso)
621 if (copy_from_user(&edata, useraddr, sizeof(edata)))
624 if (edata.data && !(dev->features & NETIF_F_SG))
627 return dev->ethtool_ops->set_tso(dev, edata.data);
630 static int ethtool_get_ufo(struct net_device *dev, char __user *useraddr)
632 struct ethtool_value edata = { ETHTOOL_GUFO };
634 if (!dev->ethtool_ops->get_ufo)
636 edata.data = dev->ethtool_ops->get_ufo(dev);
637 if (copy_to_user(useraddr, &edata, sizeof(edata)))
642 static int ethtool_set_ufo(struct net_device *dev, char __user *useraddr)
644 struct ethtool_value edata;
646 if (!dev->ethtool_ops->set_ufo)
648 if (copy_from_user(&edata, useraddr, sizeof(edata)))
650 if (edata.data && !(dev->features & NETIF_F_SG))
652 if (edata.data && !(dev->features & NETIF_F_HW_CSUM))
654 return dev->ethtool_ops->set_ufo(dev, edata.data);
657 static int ethtool_get_gso(struct net_device *dev, char __user *useraddr)
659 struct ethtool_value edata = { ETHTOOL_GGSO };
661 edata.data = dev->features & NETIF_F_GSO;
662 if (copy_to_user(useraddr, &edata, sizeof(edata)))
667 static int ethtool_set_gso(struct net_device *dev, char __user *useraddr)
669 struct ethtool_value edata;
671 if (copy_from_user(&edata, useraddr, sizeof(edata)))
674 dev->features |= NETIF_F_GSO;
676 dev->features &= ~NETIF_F_GSO;
680 static int ethtool_self_test(struct net_device *dev, char __user *useraddr)
682 struct ethtool_test test;
683 const struct ethtool_ops *ops = dev->ethtool_ops;
689 if (!ops->get_sset_count && !ops->self_test_count)
692 if (ops->get_sset_count)
693 test_len = ops->get_sset_count(dev, ETH_SS_TEST);
695 /* code path for obsolete hook */
696 test_len = ops->self_test_count(dev);
699 WARN_ON(test_len == 0);
701 if (copy_from_user(&test, useraddr, sizeof(test)))
705 data = kmalloc(test_len * sizeof(u64), GFP_USER);
709 ops->self_test(dev, &test, data);
712 if (copy_to_user(useraddr, &test, sizeof(test)))
714 useraddr += sizeof(test);
715 if (copy_to_user(useraddr, data, test.len * sizeof(u64)))
724 static int ethtool_get_strings(struct net_device *dev, void __user *useraddr)
726 struct ethtool_gstrings gstrings;
727 const struct ethtool_ops *ops = dev->ethtool_ops;
731 if (!ops->get_strings)
734 if (copy_from_user(&gstrings, useraddr, sizeof(gstrings)))
737 if (ops->get_sset_count) {
738 ret = ops->get_sset_count(dev, gstrings.string_set);
744 /* code path for obsolete hooks */
746 switch (gstrings.string_set) {
748 if (!ops->self_test_count)
750 gstrings.len = ops->self_test_count(dev);
753 if (!ops->get_stats_count)
755 gstrings.len = ops->get_stats_count(dev);
762 data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER);
766 ops->get_strings(dev, gstrings.string_set, data);
769 if (copy_to_user(useraddr, &gstrings, sizeof(gstrings)))
771 useraddr += sizeof(gstrings);
772 if (copy_to_user(useraddr, data, gstrings.len * ETH_GSTRING_LEN))
781 static int ethtool_phys_id(struct net_device *dev, void __user *useraddr)
783 struct ethtool_value id;
785 if (!dev->ethtool_ops->phys_id)
788 if (copy_from_user(&id, useraddr, sizeof(id)))
791 return dev->ethtool_ops->phys_id(dev, id.data);
794 static int ethtool_get_stats(struct net_device *dev, void __user *useraddr)
796 struct ethtool_stats stats;
797 const struct ethtool_ops *ops = dev->ethtool_ops;
801 if (!ops->get_ethtool_stats)
803 if (!ops->get_sset_count && !ops->get_stats_count)
806 if (ops->get_sset_count)
807 n_stats = ops->get_sset_count(dev, ETH_SS_STATS);
809 /* code path for obsolete hook */
810 n_stats = ops->get_stats_count(dev);
813 WARN_ON(n_stats == 0);
815 if (copy_from_user(&stats, useraddr, sizeof(stats)))
818 stats.n_stats = n_stats;
819 data = kmalloc(n_stats * sizeof(u64), GFP_USER);
823 ops->get_ethtool_stats(dev, &stats, data);
826 if (copy_to_user(useraddr, &stats, sizeof(stats)))
828 useraddr += sizeof(stats);
829 if (copy_to_user(useraddr, data, stats.n_stats * sizeof(u64)))
838 static int ethtool_get_perm_addr(struct net_device *dev, void __user *useraddr)
840 struct ethtool_perm_addr epaddr;
842 if (copy_from_user(&epaddr, useraddr, sizeof(epaddr)))
845 if (epaddr.size < dev->addr_len)
847 epaddr.size = dev->addr_len;
849 if (copy_to_user(useraddr, &epaddr, sizeof(epaddr)))
851 useraddr += sizeof(epaddr);
852 if (copy_to_user(useraddr, dev->perm_addr, epaddr.size))
857 static int ethtool_get_flags(struct net_device *dev, char __user *useraddr)
859 struct ethtool_value edata = { ETHTOOL_GFLAGS };
861 if (!dev->ethtool_ops->get_flags)
864 edata.data = dev->ethtool_ops->get_flags(dev);
866 if (copy_to_user(useraddr, &edata, sizeof(edata)))
871 static int ethtool_set_flags(struct net_device *dev, char __user *useraddr)
873 struct ethtool_value edata;
875 if (!dev->ethtool_ops->set_flags)
878 if (copy_from_user(&edata, useraddr, sizeof(edata)))
881 return dev->ethtool_ops->set_flags(dev, edata.data);
884 /* The main entry point in this file. Called from net/core/dev.c */
886 int dev_ethtool(struct ifreq *ifr)
888 struct net_device *dev = __dev_get_by_name(ifr->ifr_name);
889 void __user *useraddr = ifr->ifr_data;
892 unsigned long old_features;
894 if (!dev || !netif_device_present(dev))
897 if (!dev->ethtool_ops)
900 if (copy_from_user(ðcmd, useraddr, sizeof (ethcmd)))
903 /* Allow some commands to be done by anyone */
905 case ETHTOOL_GDRVINFO:
906 case ETHTOOL_GMSGLVL:
907 case ETHTOOL_GCOALESCE:
908 case ETHTOOL_GRINGPARAM:
909 case ETHTOOL_GPAUSEPARAM:
910 case ETHTOOL_GRXCSUM:
911 case ETHTOOL_GTXCSUM:
913 case ETHTOOL_GSTRINGS:
915 case ETHTOOL_GPERMADDR:
920 if (!capable(CAP_NET_ADMIN))
924 if (dev->ethtool_ops->begin)
925 if ((rc = dev->ethtool_ops->begin(dev)) < 0)
928 old_features = dev->features;
932 rc = ethtool_get_settings(dev, useraddr);
935 rc = ethtool_set_settings(dev, useraddr);
937 case ETHTOOL_GDRVINFO:
938 rc = ethtool_get_drvinfo(dev, useraddr);
941 rc = ethtool_get_regs(dev, useraddr);
944 rc = ethtool_get_wol(dev, useraddr);
947 rc = ethtool_set_wol(dev, useraddr);
949 case ETHTOOL_GMSGLVL:
950 rc = ethtool_get_msglevel(dev, useraddr);
952 case ETHTOOL_SMSGLVL:
953 rc = ethtool_set_msglevel(dev, useraddr);
955 case ETHTOOL_NWAY_RST:
956 rc = ethtool_nway_reset(dev);
959 rc = ethtool_get_link(dev, useraddr);
961 case ETHTOOL_GEEPROM:
962 rc = ethtool_get_eeprom(dev, useraddr);
964 case ETHTOOL_SEEPROM:
965 rc = ethtool_set_eeprom(dev, useraddr);
967 case ETHTOOL_GCOALESCE:
968 rc = ethtool_get_coalesce(dev, useraddr);
970 case ETHTOOL_SCOALESCE:
971 rc = ethtool_set_coalesce(dev, useraddr);
973 case ETHTOOL_GRINGPARAM:
974 rc = ethtool_get_ringparam(dev, useraddr);
976 case ETHTOOL_SRINGPARAM:
977 rc = ethtool_set_ringparam(dev, useraddr);
979 case ETHTOOL_GPAUSEPARAM:
980 rc = ethtool_get_pauseparam(dev, useraddr);
982 case ETHTOOL_SPAUSEPARAM:
983 rc = ethtool_set_pauseparam(dev, useraddr);
985 case ETHTOOL_GRXCSUM:
986 rc = ethtool_get_rx_csum(dev, useraddr);
988 case ETHTOOL_SRXCSUM:
989 rc = ethtool_set_rx_csum(dev, useraddr);
991 case ETHTOOL_GTXCSUM:
992 rc = ethtool_get_tx_csum(dev, useraddr);
994 case ETHTOOL_STXCSUM:
995 rc = ethtool_set_tx_csum(dev, useraddr);
998 rc = ethtool_get_sg(dev, useraddr);
1001 rc = ethtool_set_sg(dev, useraddr);
1004 rc = ethtool_get_tso(dev, useraddr);
1007 rc = ethtool_set_tso(dev, useraddr);
1010 rc = ethtool_self_test(dev, useraddr);
1012 case ETHTOOL_GSTRINGS:
1013 rc = ethtool_get_strings(dev, useraddr);
1015 case ETHTOOL_PHYS_ID:
1016 rc = ethtool_phys_id(dev, useraddr);
1018 case ETHTOOL_GSTATS:
1019 rc = ethtool_get_stats(dev, useraddr);
1021 case ETHTOOL_GPERMADDR:
1022 rc = ethtool_get_perm_addr(dev, useraddr);
1025 rc = ethtool_get_ufo(dev, useraddr);
1028 rc = ethtool_set_ufo(dev, useraddr);
1031 rc = ethtool_get_gso(dev, useraddr);
1034 rc = ethtool_set_gso(dev, useraddr);
1036 case ETHTOOL_GFLAGS:
1037 rc = ethtool_get_flags(dev, useraddr);
1039 case ETHTOOL_SFLAGS:
1040 rc = ethtool_set_flags(dev, useraddr);
1046 if (dev->ethtool_ops->complete)
1047 dev->ethtool_ops->complete(dev);
1049 if (old_features != dev->features)
1050 netdev_features_change(dev);
1055 EXPORT_SYMBOL(ethtool_op_get_link);
1056 EXPORT_SYMBOL(ethtool_op_get_sg);
1057 EXPORT_SYMBOL(ethtool_op_get_tso);
1058 EXPORT_SYMBOL(ethtool_op_get_tx_csum);
1059 EXPORT_SYMBOL(ethtool_op_set_sg);
1060 EXPORT_SYMBOL(ethtool_op_set_tso);
1061 EXPORT_SYMBOL(ethtool_op_set_tx_csum);
1062 EXPORT_SYMBOL(ethtool_op_set_tx_hw_csum);
1063 EXPORT_SYMBOL(ethtool_op_set_tx_ipv6_csum);
1064 EXPORT_SYMBOL(ethtool_op_set_ufo);
1065 EXPORT_SYMBOL(ethtool_op_get_ufo);
1066 EXPORT_SYMBOL(ethtool_op_set_flags);
1067 EXPORT_SYMBOL(ethtool_op_get_flags);