summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-05-14 17:30:04 +0200
committerJeff Garzik <jgarzik@pobox.com>2005-05-15 17:53:26 -0400
commit8551cb980086eb9952387a9f135d6f96af3b82ee (patch)
tree710844d186229cf2f708970bb245d779ee5c803e /drivers/net
parentd0e3e87ff4516d1b9d7bc6734a99168838f79635 (diff)
downloadlinux-8551cb980086eb9952387a9f135d6f96af3b82ee.tar.gz
linux-8551cb980086eb9952387a9f135d6f96af3b82ee.tar.bz2
linux-8551cb980086eb9952387a9f135d6f96af3b82ee.zip
[PATCH] orinoco: disconnect the network device on reset errors
Patch from Pavel Roskin Index: linux-2.6/drivers/net/wireless/orinoco.c ===================================================================
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/orinoco.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 76875dac9d69..48800b91448b 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -1919,7 +1919,7 @@ static void orinoco_reset(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
struct hermes *hw = &priv->hw;
- int err = 0;
+ int err;
unsigned long flags;
if (orinoco_lock(priv, &flags) != 0)
@@ -1941,20 +1941,20 @@ static void orinoco_reset(struct net_device *dev)
orinoco_unlock(priv, &flags);
- if (priv->hard_reset)
+ if (priv->hard_reset) {
err = (*priv->hard_reset)(priv);
- if (err) {
- printk(KERN_ERR "%s: orinoco_reset: Error %d "
- "performing hard reset\n", dev->name, err);
- /* FIXME: shutdown of some sort */
- return;
+ if (err) {
+ printk(KERN_ERR "%s: orinoco_reset: Error %d "
+ "performing hard reset\n", dev->name, err);
+ goto disable;
+ }
}
err = orinoco_reinit_firmware(dev);
if (err) {
printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n",
dev->name, err);
- return;
+ goto disable;
}
spin_lock_irq(&priv->lock); /* This has to be called from user context */
@@ -1975,6 +1975,10 @@ static void orinoco_reset(struct net_device *dev)
spin_unlock_irq(&priv->lock);
return;
+ disable:
+ hermes_set_irqmask(hw, 0);
+ netif_device_detach(dev);
+ printk(KERN_ERR "%s: Device has been disabled!\n", dev->name);
}
/********************************************************************/