Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158847
b: refs/heads/master
c: 42a51b9
h: refs/heads/master
i:
  158845: 594a401
  158843: 46d687b
  158839: 23ac478
  158831: a83b956
  158815: d3dc903
  158783: 48bb42b
  158719: 1301b2d
v: v3
  • Loading branch information
David Kilroy authored and John W. Linville committed Jul 10, 2009
1 parent 20edb85 commit 3f0657e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9e3d0100eae5f254024bd59229ef1be2b719b84
refs/heads/master: 42a51b933034bbed93fa54009c96a482044e5b43
23 changes: 23 additions & 0 deletions trunk/drivers/net/wireless/orinoco/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

#define SYMBOL_MAX_VER_LEN (14)

/* Symbol firmware has a bug allocating buffers larger than this */
#define TX_NICBUF_SIZE_BUG 1585

/********************************************************************/
/* Data tables */
/********************************************************************/
Expand Down Expand Up @@ -364,6 +367,26 @@ int orinoco_hw_read_card_settings(struct orinoco_private *priv, u8 *dev_addr)
return err;
}

int orinoco_hw_allocate_fid(struct orinoco_private *priv)
{
struct net_device *dev = priv->ndev;
struct hermes *hw = &priv->hw;
int err;

err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) {
/* Try workaround for old Symbol firmware bug */
priv->nicbuf_size = TX_NICBUF_SIZE_BUG;
err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);

printk(KERN_WARNING "%s: firmware ALLOC bug detected "
"(old Symbol firmware?). Work around %s\n",
dev->name, err ? "failed!" : "ok.");
}

return err;
}

int orinoco_get_bitratemode(int bitrate, int automatic)
{
int ratemode = -1;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/orinoco/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct dev_addr_list;

int determine_fw_capabilities(struct orinoco_private *priv);
int orinoco_hw_read_card_settings(struct orinoco_private *priv, u8 *dev_addr);
int orinoco_hw_allocate_fid(struct orinoco_private *priv);
int orinoco_get_bitratemode(int bitrate, int automatic);
void orinoco_get_ratemode_cfg(int ratemode, int *bitrate, int *automatic);

Expand Down
25 changes: 2 additions & 23 deletions trunk/drivers/net/wireless/orinoco/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ static const u8 encaps_hdr[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
* how many events the
* device could
* legitimately generate */
#define TX_NICBUF_SIZE_BUG 1585 /* Bug in Symbol firmware */

#define DUMMY_FID 0xFFFF

Expand Down Expand Up @@ -1574,26 +1573,6 @@ int __orinoco_down(struct net_device *dev)
}
EXPORT_SYMBOL(__orinoco_down);

static int orinoco_allocate_fid(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
struct hermes *hw = &priv->hw;
int err;

err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) {
/* Try workaround for old Symbol firmware bug */
priv->nicbuf_size = TX_NICBUF_SIZE_BUG;
err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);

printk(KERN_WARNING "%s: firmware ALLOC bug detected "
"(old Symbol firmware?). Work around %s\n",
dev->name, err ? "failed!" : "ok.");
}

return err;
}

int orinoco_reinit_firmware(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
Expand All @@ -1607,7 +1586,7 @@ int orinoco_reinit_firmware(struct net_device *dev)
priv->do_fw_download = 0;
}
if (!err)
err = orinoco_allocate_fid(dev);
err = orinoco_hw_allocate_fid(priv);

return err;
}
Expand Down Expand Up @@ -2167,7 +2146,7 @@ static int orinoco_init(struct net_device *dev)
if (err)
goto out;

err = orinoco_allocate_fid(dev);
err = orinoco_hw_allocate_fid(priv);
if (err) {
printk(KERN_ERR "%s: failed to allocate NIC buffer!\n",
dev->name);
Expand Down

0 comments on commit 3f0657e

Please sign in to comment.