diff options
author | David Gibson <hermes@gibson.dropbear.id.au> | 2005-05-12 20:04:16 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-05-12 20:04:16 -0400 |
commit | b24d4582fd93f3654d0a0a89f85e95140efc7fd4 (patch) | |
tree | 0226b89570a1f806f3f650612708f1d4aa214357 /drivers/net/wireless/orinoco.c | |
parent | d51d8b1f249b23a717ae489d6ccf2c25030988e6 (diff) |
[PATCH] Orinoco: consolidate allocation code
Consolidate allocation of firmware buffers. In the process, remove
duplication of a workaround for an old symbol firmware bug, and fix a
bug where we could retry the workaround, even if it already failed to
help.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/wireless/orinoco.c')
-rw-r--r-- | drivers/net/wireless/orinoco.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index b79aebf83e47..d910b89e6482 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -1418,7 +1418,7 @@ int orinoco_reinit_firmware(struct net_device *dev) | |||
1418 | return err; | 1418 | return err; |
1419 | 1419 | ||
1420 | err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); | 1420 | err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); |
1421 | if (err == -EIO) { | 1421 | if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) { |
1422 | /* Try workaround for old Symbol firmware bug */ | 1422 | /* Try workaround for old Symbol firmware bug */ |
1423 | printk(KERN_WARNING "%s: firmware ALLOC bug detected " | 1423 | printk(KERN_WARNING "%s: firmware ALLOC bug detected " |
1424 | "(old Symbol firmware?). Trying to work around... ", | 1424 | "(old Symbol firmware?). Trying to work around... ", |
@@ -2270,7 +2270,7 @@ static int orinoco_init(struct net_device *dev) | |||
2270 | priv->nicbuf_size = IEEE802_11_FRAME_LEN + ETH_HLEN; | 2270 | priv->nicbuf_size = IEEE802_11_FRAME_LEN + ETH_HLEN; |
2271 | 2271 | ||
2272 | /* Initialize the firmware */ | 2272 | /* Initialize the firmware */ |
2273 | err = hermes_init(hw); | 2273 | err = orinoco_reinit_firmware(dev); |
2274 | if (err != 0) { | 2274 | if (err != 0) { |
2275 | printk(KERN_ERR "%s: failed to initialize firmware (err = %d)\n", | 2275 | printk(KERN_ERR "%s: failed to initialize firmware (err = %d)\n", |
2276 | dev->name, err); | 2276 | dev->name, err); |
@@ -2409,25 +2409,6 @@ static int orinoco_init(struct net_device *dev) | |||
2409 | priv->wep_on = 0; | 2409 | priv->wep_on = 0; |
2410 | priv->tx_key = 0; | 2410 | priv->tx_key = 0; |
2411 | 2411 | ||
2412 | err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); | ||
2413 | if (err == -EIO) { | ||
2414 | /* Try workaround for old Symbol firmware bug */ | ||
2415 | printk(KERN_WARNING "%s: firmware ALLOC bug detected " | ||
2416 | "(old Symbol firmware?). Trying to work around... ", | ||
2417 | dev->name); | ||
2418 | |||
2419 | priv->nicbuf_size = TX_NICBUF_SIZE_BUG; | ||
2420 | err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); | ||
2421 | if (err) | ||
2422 | printk("failed!\n"); | ||
2423 | else | ||
2424 | printk("ok.\n"); | ||
2425 | } | ||
2426 | if (err) { | ||
2427 | printk("%s: Error %d allocating Tx buffer\n", dev->name, err); | ||
2428 | goto out; | ||
2429 | } | ||
2430 | |||
2431 | /* Make the hardware available, as long as it hasn't been | 2412 | /* Make the hardware available, as long as it hasn't been |
2432 | * removed elsewhere (e.g. by PCMCIA hot unplug) */ | 2413 | * removed elsewhere (e.g. by PCMCIA hot unplug) */ |
2433 | spin_lock_irq(&priv->lock); | 2414 | spin_lock_irq(&priv->lock); |