aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-06-18 19:27:40 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-27 00:23:55 -0400
commit1fab2e8b7a9dd0226e42ad5d3688edd5065bd231 (patch)
tree6f81696f1f32c71e567fb29ab8dd17fb40a8172c /drivers
parent620554e406e3cc01434c658a1e597162d7e56fd6 (diff)
[PATCH] orinoco: basic ethtool support
I completely reimplemented this based on ethtool_ops, CVS has an ioctl-based version.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/orinoco.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 0e1edce91021..b5f626cae98c 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -462,6 +462,7 @@
462#include <linux/netdevice.h> 462#include <linux/netdevice.h>
463#include <linux/if_arp.h> 463#include <linux/if_arp.h>
464#include <linux/etherdevice.h> 464#include <linux/etherdevice.h>
465#include <linux/ethtool.h>
465#include <linux/wireless.h> 466#include <linux/wireless.h>
466#include <net/iw_handler.h> 467#include <net/iw_handler.h>
467#include <net/ieee80211.h> 468#include <net/ieee80211.h>
@@ -542,6 +543,7 @@ MODULE_PARM_DESC(ignore_disconnect, "Don't report lost link to the network layer
542#define MAX_RID_LEN 1024 543#define MAX_RID_LEN 1024
543 544
544static const struct iw_handler_def orinoco_handler_def; 545static const struct iw_handler_def orinoco_handler_def;
546static struct ethtool_ops orinoco_ethtool_ops;
545 547
546/********************************************************************/ 548/********************************************************************/
547/* Data tables */ 549/* Data tables */
@@ -2412,6 +2414,7 @@ struct net_device *alloc_orinocodev(int sizeof_card,
2412 dev->tx_timeout = orinoco_tx_timeout; 2414 dev->tx_timeout = orinoco_tx_timeout;
2413 dev->watchdog_timeo = HZ; /* 1 second timeout */ 2415 dev->watchdog_timeo = HZ; /* 1 second timeout */
2414 dev->get_stats = orinoco_get_stats; 2416 dev->get_stats = orinoco_get_stats;
2417 dev->ethtool_ops = &orinoco_ethtool_ops;
2415 dev->get_wireless_stats = orinoco_get_wireless_stats; 2418 dev->get_wireless_stats = orinoco_get_wireless_stats;
2416 dev->wireless_handlers = (struct iw_handler_def *)&orinoco_handler_def; 2419 dev->wireless_handlers = (struct iw_handler_def *)&orinoco_handler_def;
2417 dev->change_mtu = orinoco_change_mtu; 2420 dev->change_mtu = orinoco_change_mtu;
@@ -3930,6 +3933,27 @@ static const struct iw_handler_def orinoco_handler_def = {
3930 .private_args = orinoco_privtab, 3933 .private_args = orinoco_privtab,
3931}; 3934};
3932 3935
3936static void orinoco_get_drvinfo(struct net_device *dev,
3937 struct ethtool_drvinfo *info)
3938{
3939 struct orinoco_private *priv = netdev_priv(dev);
3940
3941 strncpy(info->driver, DRIVER_NAME, sizeof(info->driver) - 1);
3942 strncpy(info->version, DRIVER_VERSION, sizeof(info->version) - 1);
3943 strncpy(info->fw_version, priv->fw_name, sizeof(info->fw_version) - 1);
3944 if (dev->class_dev.dev)
3945 strncpy(info->bus_info, dev->class_dev.dev->bus_id,
3946 sizeof(info->bus_info) - 1);
3947 else
3948 snprintf(info->bus_info, sizeof(info->bus_info) - 1,
3949 "PCMCIA %p", priv->hw.iobase);
3950}
3951
3952static struct ethtool_ops orinoco_ethtool_ops = {
3953 .get_drvinfo = orinoco_get_drvinfo,
3954 .get_link = ethtool_op_get_link,
3955};
3956
3933/********************************************************************/ 3957/********************************************************************/
3934/* Debugging */ 3958/* Debugging */
3935/********************************************************************/ 3959/********************************************************************/