aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco/main.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2009-06-18 18:21:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:01:43 -0400
commit42a51b933034bbed93fa54009c96a482044e5b43 (patch)
tree46b946a7cb7b82c013caeb320f44b978ce2bc086 /drivers/net/wireless/orinoco/main.c
parente9e3d0100eae5f254024bd59229ef1be2b719b84 (diff)
orinoco: Move FID allocation to hw.c
This is part of refactorring the initialisation code so that we can load the firmware before registerring with netdev. Signed-off-by: David Kilroy <kilroyd@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco/main.c')
-rw-r--r--drivers/net/wireless/orinoco/main.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index 0fe9420c4905..58a48db692e3 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -147,7 +147,6 @@ static const u8 encaps_hdr[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
147 * how many events the 147 * how many events the
148 * device could 148 * device could
149 * legitimately generate */ 149 * legitimately generate */
150#define TX_NICBUF_SIZE_BUG 1585 /* Bug in Symbol firmware */
151 150
152#define DUMMY_FID 0xFFFF 151#define DUMMY_FID 0xFFFF
153 152
@@ -1574,26 +1573,6 @@ int __orinoco_down(struct net_device *dev)
1574} 1573}
1575EXPORT_SYMBOL(__orinoco_down); 1574EXPORT_SYMBOL(__orinoco_down);
1576 1575
1577static int orinoco_allocate_fid(struct net_device *dev)
1578{
1579 struct orinoco_private *priv = netdev_priv(dev);
1580 struct hermes *hw = &priv->hw;
1581 int err;
1582
1583 err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
1584 if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) {
1585 /* Try workaround for old Symbol firmware bug */
1586 priv->nicbuf_size = TX_NICBUF_SIZE_BUG;
1587 err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
1588
1589 printk(KERN_WARNING "%s: firmware ALLOC bug detected "
1590 "(old Symbol firmware?). Work around %s\n",
1591 dev->name, err ? "failed!" : "ok.");
1592 }
1593
1594 return err;
1595}
1596
1597int orinoco_reinit_firmware(struct net_device *dev) 1576int orinoco_reinit_firmware(struct net_device *dev)
1598{ 1577{
1599 struct orinoco_private *priv = netdev_priv(dev); 1578 struct orinoco_private *priv = netdev_priv(dev);
@@ -1607,7 +1586,7 @@ int orinoco_reinit_firmware(struct net_device *dev)
1607 priv->do_fw_download = 0; 1586 priv->do_fw_download = 0;
1608 } 1587 }
1609 if (!err) 1588 if (!err)
1610 err = orinoco_allocate_fid(dev); 1589 err = orinoco_hw_allocate_fid(priv);
1611 1590
1612 return err; 1591 return err;
1613} 1592}
@@ -2167,7 +2146,7 @@ static int orinoco_init(struct net_device *dev)
2167 if (err) 2146 if (err)
2168 goto out; 2147 goto out;
2169 2148
2170 err = orinoco_allocate_fid(dev); 2149 err = orinoco_hw_allocate_fid(priv);
2171 if (err) { 2150 if (err) {
2172 printk(KERN_ERR "%s: failed to allocate NIC buffer!\n", 2151 printk(KERN_ERR "%s: failed to allocate NIC buffer!\n",
2173 dev->name); 2152 dev->name);