aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2003-07-27 02:04:35 (GMT)
committerJouni Malinen <j@w1.fi>2003-07-27 02:04:35 (GMT)
commitaf1b7558d25e28f4c71af7031c4e2d80025bebb2 (patch)
tree54bc3849a8f3a7583c83d32920f6ccfdbdbaee72
parent2878017cff28cd03c04d8213f457471943af3151 (diff)
downloadhostap-history-af1b7558d25e28f4c71af7031c4e2d80025bebb2.zip
hostap-history-af1b7558d25e28f4c71af7031c4e2d80025bebb2.tar.gz
hostap-history-af1b7558d25e28f4c71af7031c4e2d80025bebb2.tar.bz2
Optimized hfa384x_wait_offset()
- patch from Jiri Fojtasek, but with longer BAP busy timeout (50000) - do not read register twice if BAP is not busy - use 1 usec resolution instead of 10 usec (average wait time 3 usec with PCI card)
-rw-r--r--driver/modules/hostap_hw.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/driver/modules/hostap_hw.c b/driver/modules/hostap_hw.c
index d56b099..900992e 100644
--- a/driver/modules/hostap_hw.c
+++ b/driver/modules/hostap_hw.c
@@ -149,9 +149,9 @@ static unsigned char bridge_tunnel_header[] =
/* ca. 1 usec */
#define HFA384X_CMD_BUSY_TIMEOUT 5000
+#define HFA384X_BAP_BUSY_TIMEOUT 50000
/* ca. 10 usec */
-#define HFA384X_BAP_BUSY_TIMEOUT 5000
#define HFA384X_INIT_TIMEOUT 50000
#define HFA384X_CMD_COMPL_TIMEOUT 20000
#define HFA384X_DL_COMPL_TIMEOUT 1000000
@@ -577,12 +577,14 @@ static int hfa384x_cmd_no_wait(struct net_device *dev, u16 cmd, u16 param0)
static inline int hfa384x_wait_offset(struct net_device *dev, u16 o_off)
{
int tries = HFA384X_BAP_BUSY_TIMEOUT;
+ int res = HFA384X_INW(o_off) & HFA384X_OFFSET_BUSY;
- while ((HFA384X_INW(o_off) & HFA384X_OFFSET_BUSY) && tries > 0) {
+ while (res && tries > 0) {
tries--;
- udelay(10);
+ udelay(1);
+ res = HFA384X_INW(o_off) & HFA384X_OFFSET_BUSY;
}
- return (HFA384X_INW(o_off) & HFA384X_OFFSET_BUSY);
+ return res;
}