diff options
author | Christoph Hellwig <hch@lst.de> | 2005-05-14 11:30:04 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-05-15 17:53:26 -0400 |
commit | 8551cb980086eb9952387a9f135d6f96af3b82ee (patch) | |
tree | 710844d186229cf2f708970bb245d779ee5c803e /drivers/net/wireless | |
parent | d0e3e87ff4516d1b9d7bc6734a99168838f79635 (diff) |
[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/wireless')
-rw-r--r-- | drivers/net/wireless/orinoco.c | 20 |
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) | |||
1919 | { | 1919 | { |
1920 | struct orinoco_private *priv = netdev_priv(dev); | 1920 | struct orinoco_private *priv = netdev_priv(dev); |
1921 | struct hermes *hw = &priv->hw; | 1921 | struct hermes *hw = &priv->hw; |
1922 | int err = 0; | 1922 | int err; |
1923 | unsigned long flags; | 1923 | unsigned long flags; |
1924 | 1924 | ||
1925 | if (orinoco_lock(priv, &flags) != 0) | 1925 | if (orinoco_lock(priv, &flags) != 0) |
@@ -1941,20 +1941,20 @@ static void orinoco_reset(struct net_device *dev) | |||
1941 | 1941 | ||
1942 | orinoco_unlock(priv, &flags); | 1942 | orinoco_unlock(priv, &flags); |
1943 | 1943 | ||
1944 | if (priv->hard_reset) | 1944 | if (priv->hard_reset) { |
1945 | err = (*priv->hard_reset)(priv); | 1945 | err = (*priv->hard_reset)(priv); |
1946 | if (err) { | 1946 | if (err) { |
1947 | printk(KERN_ERR "%s: orinoco_reset: Error %d " | 1947 | printk(KERN_ERR "%s: orinoco_reset: Error %d " |
1948 | "performing hard reset\n", dev->name, err); | 1948 | "performing hard reset\n", dev->name, err); |
1949 | /* FIXME: shutdown of some sort */ | 1949 | goto disable; |
1950 | return; | 1950 | } |
1951 | } | 1951 | } |
1952 | 1952 | ||
1953 | err = orinoco_reinit_firmware(dev); | 1953 | err = orinoco_reinit_firmware(dev); |
1954 | if (err) { | 1954 | if (err) { |
1955 | printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n", | 1955 | printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n", |
1956 | dev->name, err); | 1956 | dev->name, err); |
1957 | return; | 1957 | goto disable; |
1958 | } | 1958 | } |
1959 | 1959 | ||
1960 | spin_lock_irq(&priv->lock); /* This has to be called from user context */ | 1960 | 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 | spin_unlock_irq(&priv->lock); | 1975 | spin_unlock_irq(&priv->lock); |
1976 | 1976 | ||
1977 | return; | 1977 | return; |
1978 | disable: | ||
1979 | hermes_set_irqmask(hw, 0); | ||
1980 | netif_device_detach(dev); | ||
1981 | printk(KERN_ERR "%s: Device has been disabled!\n", dev->name); | ||
1978 | } | 1982 | } |
1979 | 1983 | ||
1980 | /********************************************************************/ | 1984 | /********************************************************************/ |