aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/orinoco.c')
-rw-r--r--drivers/net/wireless/orinoco.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 80cf6fba3798..d4c13ff4d8a1 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -1345,16 +1345,12 @@ int __orinoco_down(struct net_device *dev)
1345 return 0; 1345 return 0;
1346} 1346}
1347 1347
1348int orinoco_reinit_firmware(struct net_device *dev) 1348static int orinoco_allocate_fid(struct net_device *dev)
1349{ 1349{
1350 struct orinoco_private *priv = netdev_priv(dev); 1350 struct orinoco_private *priv = netdev_priv(dev);
1351 struct hermes *hw = &priv->hw; 1351 struct hermes *hw = &priv->hw;
1352 int err; 1352 int err;
1353 1353
1354 err = hermes_init(hw);
1355 if (err)
1356 return err;
1357
1358 err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); 1354 err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
1359 if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) { 1355 if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) {
1360 /* Try workaround for old Symbol firmware bug */ 1356 /* Try workaround for old Symbol firmware bug */
@@ -1373,6 +1369,19 @@ int orinoco_reinit_firmware(struct net_device *dev)
1373 return err; 1369 return err;
1374} 1370}
1375 1371
1372int orinoco_reinit_firmware(struct net_device *dev)
1373{
1374 struct orinoco_private *priv = netdev_priv(dev);
1375 struct hermes *hw = &priv->hw;
1376 int err;
1377
1378 err = hermes_init(hw);
1379 if (!err)
1380 err = orinoco_allocate_fid(dev);
1381
1382 return err;
1383}
1384
1376static int __orinoco_hw_set_bitrate(struct orinoco_private *priv) 1385static int __orinoco_hw_set_bitrate(struct orinoco_private *priv)
1377{ 1386{
1378 hermes_t *hw = &priv->hw; 1387 hermes_t *hw = &priv->hw;
@@ -2224,7 +2233,7 @@ static int orinoco_init(struct net_device *dev)
2224 priv->nicbuf_size = IEEE80211_FRAME_LEN + ETH_HLEN; 2233 priv->nicbuf_size = IEEE80211_FRAME_LEN + ETH_HLEN;
2225 2234
2226 /* Initialize the firmware */ 2235 /* Initialize the firmware */
2227 err = orinoco_reinit_firmware(dev); 2236 err = hermes_init(hw);
2228 if (err != 0) { 2237 if (err != 0) {
2229 printk(KERN_ERR "%s: failed to initialize firmware (err = %d)\n", 2238 printk(KERN_ERR "%s: failed to initialize firmware (err = %d)\n",
2230 dev->name, err); 2239 dev->name, err);
@@ -2282,6 +2291,13 @@ static int orinoco_init(struct net_device *dev)
2282 2291
2283 printk(KERN_DEBUG "%s: Station name \"%s\"\n", dev->name, priv->nick); 2292 printk(KERN_DEBUG "%s: Station name \"%s\"\n", dev->name, priv->nick);
2284 2293
2294 err = orinoco_allocate_fid(dev);
2295 if (err) {
2296 printk(KERN_ERR "%s: failed to allocate NIC buffer!\n",
2297 dev->name);
2298 goto out;
2299 }
2300
2285 /* Get allowed channels */ 2301 /* Get allowed channels */
2286 err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CHANNELLIST, 2302 err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CHANNELLIST,
2287 &priv->channel_mask); 2303 &priv->channel_mask);