From: David Gibson 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 Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/wireless/orinoco.c | 23 ++--------------------- 1 files changed, 2 insertions(+), 21 deletions(-) diff -puN drivers/net/wireless/orinoco.c~orinoco-merge-updates-part-the-fourth-consolidate-allocation-code drivers/net/wireless/orinoco.c --- 25/drivers/net/wireless/orinoco.c~orinoco-merge-updates-part-the-fourth-consolidate-allocation-code Wed Mar 30 15:29:34 2005 +++ 25-akpm/drivers/net/wireless/orinoco.c Wed Mar 30 15:29:34 2005 @@ -1419,7 +1419,7 @@ int orinoco_reinit_firmware(struct net_d return err; err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); - if (err == -EIO) { + if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) { /* Try workaround for old Symbol firmware bug */ printk(KERN_WARNING "%s: firmware ALLOC bug detected " "(old Symbol firmware?). Trying to work around... ", @@ -2271,7 +2271,7 @@ static int orinoco_init(struct net_devic priv->nicbuf_size = IEEE80211_FRAME_LEN + ETH_HLEN; /* Initialize the firmware */ - err = hermes_init(hw); + err = orinoco_reinit_firmware(dev); if (err != 0) { printk(KERN_ERR "%s: failed to initialize firmware (err = %d)\n", dev->name, err); @@ -2410,25 +2410,6 @@ static int orinoco_init(struct net_devic priv->wep_on = 0; priv->tx_key = 0; - err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); - if (err == -EIO) { - /* Try workaround for old Symbol firmware bug */ - printk(KERN_WARNING "%s: firmware ALLOC bug detected " - "(old Symbol firmware?). Trying to work around... ", - dev->name); - - priv->nicbuf_size = TX_NICBUF_SIZE_BUG; - err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); - if (err) - printk("failed!\n"); - else - printk("ok.\n"); - } - if (err) { - printk("%s: Error %d allocating Tx buffer\n", dev->name, err); - goto out; - } - /* Make the hardware available, as long as it hasn't been * removed elsewhere (e.g. by PCMCIA hot unplug) */ spin_lock_irq(&priv->lock); _