Commit 991ae550 authored by Margit Schubert-While's avatar Margit Schubert-While Committed by Linus Torvalds

[PATCH] prism54 bug initialization/mgt_commit

*  Change mgt_commit from void to int
*  (and pass a return code)
*  We call this from device initialization,
*  therefore we need to know that it has succeeded
*  If it hasn't, we do not have a working device and
*  should pass a non-zero value upwards
parent e94a5aa4
......@@ -340,7 +340,10 @@ prism54_set_mode(struct net_device *ndev, struct iw_request_info *info,
mgt_set(priv, DOT11_OID_MLMEAUTOLEVEL, &mlmeautolevel);
mgt_commit(priv);
if (mgt_commit(priv)) {
up_write(&priv->mib_sem);
return -EIO;
}
priv->ndev->type = (priv->iw_mode == IW_MODE_MONITOR)
? priv->monitor_type : ARPHRD_ETHER;
up_write(&priv->mib_sem);
......@@ -1401,7 +1404,10 @@ prism54_set_policy(struct net_device *ndev, struct iw_request_info *info,
mlmeautolevel = DOT11_MLME_EXTENDED;
mgt_set(priv, DOT11_OID_MLMEAUTOLEVEL, &mlmeautolevel);
/* restart the card with our new policy */
mgt_commit(priv);
if (mgt_commit(priv)) {
up_write(&priv->mib_sem);
return -EIO;
}
up_write(&priv->mib_sem);
return 0;
......
......@@ -522,7 +522,12 @@ islpci_reset_if(islpci_private *priv)
isl38xx_enable_common_interrupts(priv->device_base);
down_write(&priv->mib_sem);
mgt_commit(priv);
result = mgt_commit(priv);
if (result) {
printk(KERN_ERR "%s: interface reset failure\n", priv->ndev->name);
up_write(&priv->mib_sem);
return result;
}
up_write(&priv->mib_sem);
islpci_set_state(priv, PRV_STATE_READY);
......
......@@ -697,14 +697,14 @@ mgt_update_addr(islpci_private *priv)
#define VEC_SIZE(a) (sizeof(a)/sizeof(a[0]))
void
int
mgt_commit(islpci_private *priv)
{
int rvalue;
u32 u;
if (islpci_get_state(priv) < PRV_STATE_INIT)
return;
return 0;
rvalue = mgt_commit_list(priv, commit_part1, VEC_SIZE(commit_part1));
......@@ -720,6 +720,7 @@ mgt_commit(islpci_private *priv)
incoherent state. We should reset it ! */
printk(KERN_DEBUG "%s: mgt_commit: failure\n", priv->ndev->name);
}
return rvalue;
}
/* The following OIDs need to be "unlatched":
......
......@@ -48,7 +48,7 @@ void mgt_set(islpci_private *, enum oid_num_t, void *);
void mgt_get(islpci_private *, enum oid_num_t, void *);
void mgt_commit(islpci_private *);
int mgt_commit(islpci_private *);
void mgt_unlatch_all(islpci_private *);
int mgt_mlme_answer(islpci_private *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment