diff options
author | Christoph Hellwig <hch@lst.de> | 2005-11-07 00:21:21 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-09 01:10:10 -0500 |
commit | 6d3874844f3279f170dca5339b8a94d6f1868425 (patch) | |
tree | 3f2b3148c71b9ffb2752af9a4780316441db574b /arch | |
parent | d3757472841cddfa2f905d1de76fabf1b98cfc1a (diff) |
[PATCH] uml_net: use ethtool_ops
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/drivers/net_kern.c | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index fe865d9a3721..4cf31a2ae19c 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
@@ -243,34 +243,18 @@ static int uml_net_change_mtu(struct net_device *dev, int new_mtu) | |||
243 | return err; | 243 | return err; |
244 | } | 244 | } |
245 | 245 | ||
246 | static int uml_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | 246 | static void uml_net_get_drvinfo(struct net_device *dev, |
247 | { | 247 | struct ethtool_drvinfo *info) |
248 | static const struct ethtool_drvinfo info = { | 248 | { |
249 | .cmd = ETHTOOL_GDRVINFO, | 249 | strcpy(info->driver, DRIVER_NAME); |
250 | .driver = DRIVER_NAME, | 250 | strcpy(info->version, "42"); |
251 | .version = "42", | ||
252 | }; | ||
253 | void *useraddr; | ||
254 | u32 ethcmd; | ||
255 | |||
256 | switch (cmd) { | ||
257 | case SIOCETHTOOL: | ||
258 | useraddr = ifr->ifr_data; | ||
259 | if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) | ||
260 | return -EFAULT; | ||
261 | switch (ethcmd) { | ||
262 | case ETHTOOL_GDRVINFO: | ||
263 | if (copy_to_user(useraddr, &info, sizeof(info))) | ||
264 | return -EFAULT; | ||
265 | return 0; | ||
266 | default: | ||
267 | return -EOPNOTSUPP; | ||
268 | } | ||
269 | default: | ||
270 | return -EINVAL; | ||
271 | } | ||
272 | } | 251 | } |
273 | 252 | ||
253 | static struct ethtool_ops uml_net_ethtool_ops = { | ||
254 | .get_drvinfo = uml_net_get_drvinfo, | ||
255 | .get_link = ethtool_op_get_link, | ||
256 | }; | ||
257 | |||
274 | void uml_net_user_timer_expire(unsigned long _conn) | 258 | void uml_net_user_timer_expire(unsigned long _conn) |
275 | { | 259 | { |
276 | #ifdef undef | 260 | #ifdef undef |
@@ -359,7 +343,7 @@ static int eth_configure(int n, void *init, char *mac, | |||
359 | dev->tx_timeout = uml_net_tx_timeout; | 343 | dev->tx_timeout = uml_net_tx_timeout; |
360 | dev->set_mac_address = uml_net_set_mac; | 344 | dev->set_mac_address = uml_net_set_mac; |
361 | dev->change_mtu = uml_net_change_mtu; | 345 | dev->change_mtu = uml_net_change_mtu; |
362 | dev->do_ioctl = uml_net_ioctl; | 346 | dev->ethtool_ops = ¨_net_ethtool_ops; |
363 | dev->watchdog_timeo = (HZ >> 1); | 347 | dev->watchdog_timeo = (HZ >> 1); |
364 | dev->irq = UM_ETH_IRQ; | 348 | dev->irq = UM_ETH_IRQ; |
365 | 349 | ||