diff options
-rw-r--r-- | include/linux/ethtool.h | 7 | ||||
-rw-r--r-- | net/core/ethtool.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index f6f961fefbe5..b33f316bb92e 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -61,6 +61,13 @@ struct ethtool_drvinfo { | |||
61 | /* For PCI devices, use pci_name(pci_dev). */ | 61 | /* For PCI devices, use pci_name(pci_dev). */ |
62 | char reserved1[32]; | 62 | char reserved1[32]; |
63 | char reserved2[12]; | 63 | char reserved2[12]; |
64 | /* | ||
65 | * Some struct members below are filled in | ||
66 | * using ops->get_sset_count(). Obtaining | ||
67 | * this info from ethtool_drvinfo is now | ||
68 | * deprecated; Use ETHTOOL_GSSET_INFO | ||
69 | * instead. | ||
70 | */ | ||
64 | __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ | 71 | __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ |
65 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ | 72 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ |
66 | __u32 testinfo_len; | 73 | __u32 testinfo_len; |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 70075c47ada8..33d2ded50f84 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
18 | #include <linux/ethtool.h> | 18 | #include <linux/ethtool.h> |
19 | #include <linux/netdevice.h> | 19 | #include <linux/netdevice.h> |
20 | #include <linux/bitops.h> | ||
20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
21 | 22 | ||
22 | /* | 23 | /* |
@@ -216,7 +217,7 @@ static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use | |||
216 | 217 | ||
217 | /* | 218 | /* |
218 | * this method of obtaining string set info is deprecated; | 219 | * this method of obtaining string set info is deprecated; |
219 | * consider using ETHTOOL_GSSET_INFO instead | 220 | * Use ETHTOOL_GSSET_INFO instead. |
220 | */ | 221 | */ |
221 | if (ops->get_sset_count) { | 222 | if (ops->get_sset_count) { |
222 | int rc; | 223 | int rc; |
@@ -265,9 +266,7 @@ static noinline int ethtool_get_sset_info(struct net_device *dev, | |||
265 | return 0; | 266 | return 0; |
266 | 267 | ||
267 | /* calculate size of return buffer */ | 268 | /* calculate size of return buffer */ |
268 | for (i = 0; i < 64; i++) | 269 | n_bits = hweight64(sset_mask); |
269 | if (sset_mask & (1ULL << i)) | ||
270 | n_bits++; | ||
271 | 270 | ||
272 | memset(&info, 0, sizeof(info)); | 271 | memset(&info, 0, sizeof(info)); |
273 | info.cmd = ETHTOOL_GSSET_INFO; | 272 | info.cmd = ETHTOOL_GSSET_INFO; |