aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/orinoco/main.c')
-rw-r--r--drivers/net/wireless/orinoco/main.c42
1 files changed, 11 insertions, 31 deletions
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index 7a32bcb0c037..413e9ab6cab3 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -78,12 +78,12 @@
78 78
79#include <linux/module.h> 79#include <linux/module.h>
80#include <linux/kernel.h> 80#include <linux/kernel.h>
81#include <linux/slab.h>
81#include <linux/init.h> 82#include <linux/init.h>
82#include <linux/delay.h> 83#include <linux/delay.h>
83#include <linux/device.h> 84#include <linux/device.h>
84#include <linux/netdevice.h> 85#include <linux/netdevice.h>
85#include <linux/etherdevice.h> 86#include <linux/etherdevice.h>
86#include <linux/ethtool.h>
87#include <linux/suspend.h> 87#include <linux/suspend.h>
88#include <linux/if_arp.h> 88#include <linux/if_arp.h>
89#include <linux/wireless.h> 89#include <linux/wireless.h>
@@ -162,8 +162,6 @@ static const u8 encaps_hdr[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
162 | HERMES_EV_WTERR | HERMES_EV_INFO \ 162 | HERMES_EV_WTERR | HERMES_EV_INFO \
163 | HERMES_EV_INFDROP) 163 | HERMES_EV_INFDROP)
164 164
165static const struct ethtool_ops orinoco_ethtool_ops;
166
167/********************************************************************/ 165/********************************************************************/
168/* Data types */ 166/* Data types */
169/********************************************************************/ 167/********************************************************************/
@@ -1671,16 +1669,15 @@ __orinoco_set_multicast_list(struct net_device *dev)
1671 /* The Hermes doesn't seem to have an allmulti mode, so we go 1669 /* The Hermes doesn't seem to have an allmulti mode, so we go
1672 * into promiscuous mode and let the upper levels deal. */ 1670 * into promiscuous mode and let the upper levels deal. */
1673 if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) || 1671 if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) ||
1674 (dev->mc_count > MAX_MULTICAST(priv))) { 1672 (netdev_mc_count(dev) > MAX_MULTICAST(priv))) {
1675 promisc = 1; 1673 promisc = 1;
1676 mc_count = 0; 1674 mc_count = 0;
1677 } else { 1675 } else {
1678 promisc = 0; 1676 promisc = 0;
1679 mc_count = dev->mc_count; 1677 mc_count = netdev_mc_count(dev);
1680 } 1678 }
1681 1679
1682 err = __orinoco_hw_set_multicast_list(priv, dev->mc_list, mc_count, 1680 err = __orinoco_hw_set_multicast_list(priv, dev, mc_count, promisc);
1683 promisc);
1684 1681
1685 return err; 1682 return err;
1686} 1683}
@@ -1994,7 +1991,9 @@ int orinoco_init(struct orinoco_private *priv)
1994 goto out; 1991 goto out;
1995 } 1992 }
1996 1993
1997 err = determine_fw_capabilities(priv); 1994 err = determine_fw_capabilities(priv, wiphy->fw_version,
1995 sizeof(wiphy->fw_version),
1996 &wiphy->hw_version);
1998 if (err != 0) { 1997 if (err != 0) {
1999 dev_err(dev, "Incompatible firmware, aborting\n"); 1998 dev_err(dev, "Incompatible firmware, aborting\n");
2000 goto out; 1999 goto out;
@@ -2010,7 +2009,9 @@ int orinoco_init(struct orinoco_private *priv)
2010 priv->do_fw_download = 0; 2009 priv->do_fw_download = 0;
2011 2010
2012 /* Check firmware version again */ 2011 /* Check firmware version again */
2013 err = determine_fw_capabilities(priv); 2012 err = determine_fw_capabilities(priv, wiphy->fw_version,
2013 sizeof(wiphy->fw_version),
2014 &wiphy->hw_version);
2014 if (err != 0) { 2015 if (err != 0) {
2015 dev_err(dev, "Incompatible firmware, aborting\n"); 2016 dev_err(dev, "Incompatible firmware, aborting\n");
2016 goto out; 2017 goto out;
@@ -2212,7 +2213,6 @@ int orinoco_if_add(struct orinoco_private *priv,
2212 dev->ieee80211_ptr = wdev; 2213 dev->ieee80211_ptr = wdev;
2213 dev->netdev_ops = &orinoco_netdev_ops; 2214 dev->netdev_ops = &orinoco_netdev_ops;
2214 dev->watchdog_timeo = HZ; /* 1 second timeout */ 2215 dev->watchdog_timeo = HZ; /* 1 second timeout */
2215 dev->ethtool_ops = &orinoco_ethtool_ops;
2216 dev->wireless_handlers = &orinoco_handler_def; 2216 dev->wireless_handlers = &orinoco_handler_def;
2217#ifdef WIRELESS_SPY 2217#ifdef WIRELESS_SPY
2218 dev->wireless_data = &priv->wireless_data; 2218 dev->wireless_data = &priv->wireless_data;
@@ -2225,6 +2225,7 @@ int orinoco_if_add(struct orinoco_private *priv,
2225 netif_carrier_off(dev); 2225 netif_carrier_off(dev);
2226 2226
2227 memcpy(dev->dev_addr, wiphy->perm_addr, ETH_ALEN); 2227 memcpy(dev->dev_addr, wiphy->perm_addr, ETH_ALEN);
2228 memcpy(dev->perm_addr, wiphy->perm_addr, ETH_ALEN);
2228 2229
2229 dev->base_addr = base_addr; 2230 dev->base_addr = base_addr;
2230 dev->irq = irq; 2231 dev->irq = irq;
@@ -2348,27 +2349,6 @@ void orinoco_down(struct orinoco_private *priv)
2348} 2349}
2349EXPORT_SYMBOL(orinoco_down); 2350EXPORT_SYMBOL(orinoco_down);
2350 2351
2351static void orinoco_get_drvinfo(struct net_device *dev,
2352 struct ethtool_drvinfo *info)
2353{
2354 struct orinoco_private *priv = ndev_priv(dev);
2355
2356 strncpy(info->driver, DRIVER_NAME, sizeof(info->driver) - 1);
2357 strncpy(info->version, DRIVER_VERSION, sizeof(info->version) - 1);
2358 strncpy(info->fw_version, priv->fw_name, sizeof(info->fw_version) - 1);
2359 if (dev->dev.parent)
2360 strncpy(info->bus_info, dev_name(dev->dev.parent),
2361 sizeof(info->bus_info) - 1);
2362 else
2363 snprintf(info->bus_info, sizeof(info->bus_info) - 1,
2364 "PCMCIA %p", priv->hw.iobase);
2365}
2366
2367static const struct ethtool_ops orinoco_ethtool_ops = {
2368 .get_drvinfo = orinoco_get_drvinfo,
2369 .get_link = ethtool_op_get_link,
2370};
2371
2372/********************************************************************/ 2352/********************************************************************/
2373/* Module initialization */ 2353/* Module initialization */
2374/********************************************************************/ 2354/********************************************************************/