aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-08-17 05:31:15 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-17 05:31:15 -0400
commit01414802054c382072b6cb9a1bdc6e243c74b2d5 (patch)
treef09b05eb9fff16a69d83ec28653992d1bae8d74c /drivers/net/pcmcia
parentbb8a10bbd10a45db0eb45bac520489bdbc0917ef (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.c13
-rw-r--r--drivers/net/pcmcia/axnet_cs.c13
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c13
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c16
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);
238static int el3_close(struct net_device *dev); 237static int el3_close(struct net_device *dev);
239static void el3_tx_timeout(struct net_device *dev); 238static void el3_tx_timeout(struct net_device *dev);
240static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 239static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
241static const struct ethtool_ops netdev_ethtool_ops;
242static void set_rx_mode(struct net_device *dev); 240static void set_rx_mode(struct net_device *dev);
243static void set_multicast_list(struct net_device *dev); 241static 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
1068static void netdev_get_drvinfo(struct net_device *dev,
1069 struct ethtool_drvinfo *info)
1070{
1071 strcpy(info->driver, "3c574_cs");
1072}
1073
1074static 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. */
1079static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1066static 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,
86static struct net_device_stats *get_stats(struct net_device *dev); 85static struct net_device_stats *get_stats(struct net_device *dev);
87static void set_multicast_list(struct net_device *dev); 86static void set_multicast_list(struct net_device *dev);
88static void axnet_tx_timeout(struct net_device *dev); 87static void axnet_tx_timeout(struct net_device *dev);
89static const struct ethtool_ops netdev_ethtool_ops;
90static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); 88static irqreturn_t ei_irq_wrapper(int irq, void *dev_id);
91static void ei_watchdog(u_long arg); 89static void ei_watchdog(u_long arg);
92static void axnet_reset_8390(struct net_device *dev); 90static 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
661static void netdev_get_drvinfo(struct net_device *dev,
662 struct ethtool_drvinfo *info)
663{
664 strcpy(info->driver, "axnet_cs");
665}
666
667static const struct ethtool_ops netdev_ethtool_ops = {
668 .get_drvinfo = netdev_get_drvinfo,
669};
670
671/*====================================================================*/ 658/*====================================================================*/
672 659
673static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 660static 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
110static void netdev_get_drvinfo(struct net_device *dev,
111 struct ethtool_drvinfo *info)
112{
113 strcpy(info->driver, "ibmtr_cs");
114}
115
116static const struct ethtool_ops netdev_ethtool_ops = {
117 .get_drvinfo = netdev_get_drvinfo,
118};
119
120static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) { 109static 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);
100static int pcnet_open(struct net_device *dev); 99static int pcnet_open(struct net_device *dev);
101static int pcnet_close(struct net_device *dev); 100static int pcnet_close(struct net_device *dev);
102static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 101static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
103static const struct ethtool_ops netdev_ethtool_ops;
104static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); 102static irqreturn_t ei_irq_wrapper(int irq, void *dev_id);
105static void ei_watchdog(u_long arg); 103static void ei_watchdog(u_long arg);
106static void pcnet_reset_8390(struct net_device *dev); 104static 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
1146static void netdev_get_drvinfo(struct net_device *dev,
1147 struct ethtool_drvinfo *info)
1148{
1149 strcpy(info->driver, "pcnet_cs");
1150}
1151
1152static const struct ethtool_ops netdev_ethtool_ops = {
1153 .get_drvinfo = netdev_get_drvinfo,
1154};
1155
1156/*====================================================================*/
1157
1158 1142
1159static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1143static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1160{ 1144{