orinoco: provide generic commit function

This allows changes to be commited from cfg80211 functions.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
David Kilroy
2009-06-18 23:21:31 +01:00
committed by John W. Linville
parent 6415f7df10
commit 721aa2f75b
5 changed files with 294 additions and 269 deletions

View File

@@ -2163,49 +2163,16 @@ static int orinoco_ioctl_commit(struct net_device *dev,
char *extra)
{
struct orinoco_private *priv = ndev_priv(dev);
struct hermes *hw = &priv->hw;
unsigned long flags;
int err = 0;
if (!priv->open)
return 0;
if (priv->broken_disableport) {
orinoco_reset(&priv->reset_work);
return 0;
}
if (orinoco_lock(priv, &flags) != 0)
return err;
err = hermes_disable_port(hw, 0);
if (err) {
printk(KERN_WARNING "%s: Unable to disable port "
"while reconfiguring card\n", dev->name);
priv->broken_disableport = 1;
goto out;
}
err = __orinoco_program_rids(dev);
if (err) {
printk(KERN_WARNING "%s: Unable to reconfigure card\n",
dev->name);
goto out;
}
err = hermes_enable_port(hw, 0);
if (err) {
printk(KERN_WARNING "%s: Unable to enable port while reconfiguring card\n",
dev->name);
goto out;
}
out:
if (err) {
printk(KERN_WARNING "%s: Resetting instead...\n", dev->name);
schedule_work(&priv->reset_work);
err = 0;
}
err = orinoco_commit(priv);
orinoco_unlock(priv, &flags);
return err;