diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-08-17 05:31:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-17 05:31:15 -0400 |
commit | 01414802054c382072b6cb9a1bdc6e243c74b2d5 (patch) | |
tree | f09b05eb9fff16a69d83ec28653992d1bae8d74c /drivers/net/pcmcia | |
parent | bb8a10bbd10a45db0eb45bac520489bdbc0917ef (diff) |
ethtool: Provide a default implementation of ethtool_ops::get_drvinfo
The driver name and bus address for a net_device can normally be found
through the driver model now. Instead of requiring drivers to provide
this information redundantly through the ethtool_ops::get_drvinfo
operation, use the driver model to do so if the driver does not define
the operation. Since ETHTOOL_GDRVINFO no longer requires the driver
to implement any operations, do not require net_device::ethtool_ops to
be set either.
Remove implementations of get_drvinfo and ethtool_ops that provide
only this information.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 13 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 13 | ||||
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 13 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 16 |
4 files changed, 0 insertions, 55 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index c683f77c6f42..9a1840b67e78 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -83,7 +83,6 @@ earlier 3Com products. | |||
83 | #include <linux/skbuff.h> | 83 | #include <linux/skbuff.h> |
84 | #include <linux/if_arp.h> | 84 | #include <linux/if_arp.h> |
85 | #include <linux/ioport.h> | 85 | #include <linux/ioport.h> |
86 | #include <linux/ethtool.h> | ||
87 | #include <linux/bitops.h> | 86 | #include <linux/bitops.h> |
88 | #include <linux/mii.h> | 87 | #include <linux/mii.h> |
89 | 88 | ||
@@ -238,7 +237,6 @@ static int el3_rx(struct net_device *dev, int worklimit); | |||
238 | static int el3_close(struct net_device *dev); | 237 | static int el3_close(struct net_device *dev); |
239 | static void el3_tx_timeout(struct net_device *dev); | 238 | static void el3_tx_timeout(struct net_device *dev); |
240 | static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 239 | static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
241 | static const struct ethtool_ops netdev_ethtool_ops; | ||
242 | static void set_rx_mode(struct net_device *dev); | 240 | static void set_rx_mode(struct net_device *dev); |
243 | static void set_multicast_list(struct net_device *dev); | 241 | static void set_multicast_list(struct net_device *dev); |
244 | 242 | ||
@@ -285,7 +283,6 @@ static int tc574_probe(struct pcmcia_device *link) | |||
285 | link->conf.ConfigIndex = 1; | 283 | link->conf.ConfigIndex = 1; |
286 | 284 | ||
287 | dev->netdev_ops = &el3_netdev_ops; | 285 | dev->netdev_ops = &el3_netdev_ops; |
288 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | ||
289 | dev->watchdog_timeo = TX_TIMEOUT; | 286 | dev->watchdog_timeo = TX_TIMEOUT; |
290 | 287 | ||
291 | return tc574_config(link); | 288 | return tc574_config(link); |
@@ -1065,16 +1062,6 @@ static int el3_rx(struct net_device *dev, int worklimit) | |||
1065 | return worklimit; | 1062 | return worklimit; |
1066 | } | 1063 | } |
1067 | 1064 | ||
1068 | static void netdev_get_drvinfo(struct net_device *dev, | ||
1069 | struct ethtool_drvinfo *info) | ||
1070 | { | ||
1071 | strcpy(info->driver, "3c574_cs"); | ||
1072 | } | ||
1073 | |||
1074 | static const struct ethtool_ops netdev_ethtool_ops = { | ||
1075 | .get_drvinfo = netdev_get_drvinfo, | ||
1076 | }; | ||
1077 | |||
1078 | /* Provide ioctl() calls to examine the MII xcvr state. */ | 1065 | /* Provide ioctl() calls to examine the MII xcvr state. */ |
1079 | static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | 1066 | static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) |
1080 | { | 1067 | { |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 5f05ffb240cc..a6e37b29e3bf 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/timer.h> | 32 | #include <linux/timer.h> |
33 | #include <linux/delay.h> | 33 | #include <linux/delay.h> |
34 | #include <linux/spinlock.h> | 34 | #include <linux/spinlock.h> |
35 | #include <linux/ethtool.h> | ||
36 | #include <linux/netdevice.h> | 35 | #include <linux/netdevice.h> |
37 | #include <linux/etherdevice.h> | 36 | #include <linux/etherdevice.h> |
38 | #include <linux/crc32.h> | 37 | #include <linux/crc32.h> |
@@ -86,7 +85,6 @@ static netdev_tx_t axnet_start_xmit(struct sk_buff *skb, | |||
86 | static struct net_device_stats *get_stats(struct net_device *dev); | 85 | static struct net_device_stats *get_stats(struct net_device *dev); |
87 | static void set_multicast_list(struct net_device *dev); | 86 | static void set_multicast_list(struct net_device *dev); |
88 | static void axnet_tx_timeout(struct net_device *dev); | 87 | static void axnet_tx_timeout(struct net_device *dev); |
89 | static const struct ethtool_ops netdev_ethtool_ops; | ||
90 | static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); | 88 | static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); |
91 | static void ei_watchdog(u_long arg); | 89 | static void ei_watchdog(u_long arg); |
92 | static void axnet_reset_8390(struct net_device *dev); | 90 | static void axnet_reset_8390(struct net_device *dev); |
@@ -171,7 +169,6 @@ static int axnet_probe(struct pcmcia_device *link) | |||
171 | 169 | ||
172 | dev->netdev_ops = &axnet_netdev_ops; | 170 | dev->netdev_ops = &axnet_netdev_ops; |
173 | 171 | ||
174 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | ||
175 | dev->watchdog_timeo = TX_TIMEOUT; | 172 | dev->watchdog_timeo = TX_TIMEOUT; |
176 | 173 | ||
177 | return axnet_config(link); | 174 | return axnet_config(link); |
@@ -658,16 +655,6 @@ reschedule: | |||
658 | add_timer(&info->watchdog); | 655 | add_timer(&info->watchdog); |
659 | } | 656 | } |
660 | 657 | ||
661 | static void netdev_get_drvinfo(struct net_device *dev, | ||
662 | struct ethtool_drvinfo *info) | ||
663 | { | ||
664 | strcpy(info->driver, "axnet_cs"); | ||
665 | } | ||
666 | |||
667 | static const struct ethtool_ops netdev_ethtool_ops = { | ||
668 | .get_drvinfo = netdev_get_drvinfo, | ||
669 | }; | ||
670 | |||
671 | /*====================================================================*/ | 658 | /*====================================================================*/ |
672 | 659 | ||
673 | static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | 660 | static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index b0d06a3d962f..cbcda123b1bf 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -52,7 +52,6 @@ | |||
52 | #include <linux/string.h> | 52 | #include <linux/string.h> |
53 | #include <linux/timer.h> | 53 | #include <linux/timer.h> |
54 | #include <linux/module.h> | 54 | #include <linux/module.h> |
55 | #include <linux/ethtool.h> | ||
56 | #include <linux/netdevice.h> | 55 | #include <linux/netdevice.h> |
57 | #include <linux/trdevice.h> | 56 | #include <linux/trdevice.h> |
58 | #include <linux/ibmtr.h> | 57 | #include <linux/ibmtr.h> |
@@ -107,16 +106,6 @@ typedef struct ibmtr_dev_t { | |||
107 | struct tok_info *ti; | 106 | struct tok_info *ti; |
108 | } ibmtr_dev_t; | 107 | } ibmtr_dev_t; |
109 | 108 | ||
110 | static void netdev_get_drvinfo(struct net_device *dev, | ||
111 | struct ethtool_drvinfo *info) | ||
112 | { | ||
113 | strcpy(info->driver, "ibmtr_cs"); | ||
114 | } | ||
115 | |||
116 | static const struct ethtool_ops netdev_ethtool_ops = { | ||
117 | .get_drvinfo = netdev_get_drvinfo, | ||
118 | }; | ||
119 | |||
120 | static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) { | 109 | static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) { |
121 | ibmtr_dev_t *info = dev_id; | 110 | ibmtr_dev_t *info = dev_id; |
122 | struct net_device *dev = info->dev; | 111 | struct net_device *dev = info->dev; |
@@ -159,8 +148,6 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link) | |||
159 | 148 | ||
160 | info->dev = dev; | 149 | info->dev = dev; |
161 | 150 | ||
162 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | ||
163 | |||
164 | return ibmtr_config(link); | 151 | return ibmtr_config(link); |
165 | } /* ibmtr_attach */ | 152 | } /* ibmtr_attach */ |
166 | 153 | ||
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index c3edfe4c2651..2e1348c0033e 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/string.h> | 35 | #include <linux/string.h> |
36 | #include <linux/timer.h> | 36 | #include <linux/timer.h> |
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/ethtool.h> | ||
39 | #include <linux/netdevice.h> | 38 | #include <linux/netdevice.h> |
40 | #include <linux/log2.h> | 39 | #include <linux/log2.h> |
41 | #include <linux/etherdevice.h> | 40 | #include <linux/etherdevice.h> |
@@ -100,7 +99,6 @@ static void pcnet_release(struct pcmcia_device *link); | |||
100 | static int pcnet_open(struct net_device *dev); | 99 | static int pcnet_open(struct net_device *dev); |
101 | static int pcnet_close(struct net_device *dev); | 100 | static int pcnet_close(struct net_device *dev); |
102 | static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 101 | static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
103 | static const struct ethtool_ops netdev_ethtool_ops; | ||
104 | static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); | 102 | static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); |
105 | static void ei_watchdog(u_long arg); | 103 | static void ei_watchdog(u_long arg); |
106 | static void pcnet_reset_8390(struct net_device *dev); | 104 | static void pcnet_reset_8390(struct net_device *dev); |
@@ -628,8 +626,6 @@ static int pcnet_config(struct pcmcia_device *link) | |||
628 | ei_status.word16 = 1; | 626 | ei_status.word16 = 1; |
629 | ei_status.reset_8390 = &pcnet_reset_8390; | 627 | ei_status.reset_8390 = &pcnet_reset_8390; |
630 | 628 | ||
631 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | ||
632 | |||
633 | if (info->flags & (IS_DL10019|IS_DL10022)) | 629 | if (info->flags & (IS_DL10019|IS_DL10022)) |
634 | mii_phy_probe(dev); | 630 | mii_phy_probe(dev); |
635 | 631 | ||
@@ -1143,18 +1139,6 @@ reschedule: | |||
1143 | 1139 | ||
1144 | /*====================================================================*/ | 1140 | /*====================================================================*/ |
1145 | 1141 | ||
1146 | static void netdev_get_drvinfo(struct net_device *dev, | ||
1147 | struct ethtool_drvinfo *info) | ||
1148 | { | ||
1149 | strcpy(info->driver, "pcnet_cs"); | ||
1150 | } | ||
1151 | |||
1152 | static const struct ethtool_ops netdev_ethtool_ops = { | ||
1153 | .get_drvinfo = netdev_get_drvinfo, | ||
1154 | }; | ||
1155 | |||
1156 | /*====================================================================*/ | ||
1157 | |||
1158 | 1142 | ||
1159 | static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | 1143 | static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) |
1160 | { | 1144 | { |