aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2003-07-26 03:15:39 (GMT)
committerJouni Malinen <j@w1.fi>2003-07-26 03:15:39 (GMT)
commit2878017cff28cd03c04d8213f457471943af3151 (patch)
tree073bb13ca63c886ca69491c14c9cbaa1e6fe7eb1
parentcb6131dde17798cbc337b39efc08d294c62d7fd6 (diff)
downloadhostap-history-2878017cff28cd03c04d8213f457471943af3151.zip
hostap-history-2878017cff28cd03c04d8213f457471943af3151.tar.gz
hostap-history-2878017cff28cd03c04d8213f457471943af3151.tar.bz2
Divided prism2_hw_init() into two functions so that it is clearer which
parts of the initialization is performed during firmware downloading.
-rw-r--r--driver/modules/hostap_hw.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/driver/modules/hostap_hw.c b/driver/modules/hostap_hw.c
index 8de3123..d56b099 100644
--- a/driver/modules/hostap_hw.c
+++ b/driver/modules/hostap_hw.c
@@ -1060,7 +1060,7 @@ static int prism2_hw_init(struct net_device *dev, int initial)
if (ret) {
printk("%s: first command failed - is the card compatible?\n",
dev_info);
- goto failed;
+ return 1;
}
i = HFA384X_INIT_TIMEOUT;
while (!(HFA384X_INW(HFA384X_EVSTAT_OFF) & HFA384X_EV_CMD) && i > 0) {
@@ -1078,14 +1078,19 @@ static int prism2_hw_init(struct net_device *dev, int initial)
}
if (i == 0) {
printk("%s: card initialization timed out\n", dev_info);
- goto failed;
+ return 1;
}
printk(KERN_DEBUG "prism2_hw_init: initialized in %d iterations\n",
HFA384X_INIT_TIMEOUT - i);
HFA384X_OUTW(HFA384X_EV_CMD, HFA384X_EVACK_OFF);
+ return 0;
+}
- if (local->hw_downloading)
- return 0;
+
+static int prism2_hw_init2(struct net_device *dev, int initial)
+{
+ local_info_t *local = (local_info_t *) dev->priv;
+ int i;
#ifdef PRISM2_DOWNLOAD_SUPPORT
local->pda = prism2_read_pda(dev);
@@ -1198,7 +1203,7 @@ static int prism2_hw_config(struct net_device *dev, int initial)
if (local->hw_downloading)
return 1;
- if (prism2_hw_init(dev, initial))
+ if (prism2_hw_init(dev, initial) || prism2_hw_init2(dev, initial))
return 1;
if (!initial || !delayed_enable) {