提交 8551cb98 编写于 作者: C Christoph Hellwig 提交者: Jeff Garzik

[PATCH] orinoco: disconnect the network device on reset errors

Patch from Pavel Roskin

Index: linux-2.6/drivers/net/wireless/orinoco.c
===================================================================
上级 d0e3e87f
...@@ -1919,7 +1919,7 @@ static void orinoco_reset(struct net_device *dev) ...@@ -1919,7 +1919,7 @@ static void orinoco_reset(struct net_device *dev)
{ {
struct orinoco_private *priv = netdev_priv(dev); struct orinoco_private *priv = netdev_priv(dev);
struct hermes *hw = &priv->hw; struct hermes *hw = &priv->hw;
int err = 0; int err;
unsigned long flags; unsigned long flags;
if (orinoco_lock(priv, &flags) != 0) if (orinoco_lock(priv, &flags) != 0)
...@@ -1941,20 +1941,20 @@ static void orinoco_reset(struct net_device *dev) ...@@ -1941,20 +1941,20 @@ static void orinoco_reset(struct net_device *dev)
orinoco_unlock(priv, &flags); orinoco_unlock(priv, &flags);
if (priv->hard_reset) if (priv->hard_reset) {
err = (*priv->hard_reset)(priv); err = (*priv->hard_reset)(priv);
if (err) { if (err) {
printk(KERN_ERR "%s: orinoco_reset: Error %d " printk(KERN_ERR "%s: orinoco_reset: Error %d "
"performing hard reset\n", dev->name, err); "performing hard reset\n", dev->name, err);
/* FIXME: shutdown of some sort */ goto disable;
return; }
} }
err = orinoco_reinit_firmware(dev); err = orinoco_reinit_firmware(dev);
if (err) { if (err) {
printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n", printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n",
dev->name, err); dev->name, err);
return; goto disable;
} }
spin_lock_irq(&priv->lock); /* This has to be called from user context */ 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) ...@@ -1975,6 +1975,10 @@ static void orinoco_reset(struct net_device *dev)
spin_unlock_irq(&priv->lock); spin_unlock_irq(&priv->lock);
return; return;
disable:
hermes_set_irqmask(hw, 0);
netif_device_detach(dev);
printk(KERN_ERR "%s: Device has been disabled!\n", dev->name);
} }
/********************************************************************/ /********************************************************************/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册