summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-12-09 07:41:07 +0000
committerimp <imp@FreeBSD.org>2003-12-09 07:41:07 +0000
commit32b9913273a9f0a6aea1cd90c55fbdec7f379378 (patch)
tree2035e89ef91bfac8c6caa224ca834e352878266e /sys
parente3c53b37aeae9971384a39009e4e9936fb4a0b32 (diff)
downloadFreeBSD-src-32b9913273a9f0a6aea1cd90c55fbdec7f379378.zip
FreeBSD-src-32b9913273a9f0a6aea1cd90c55fbdec7f379378.tar.gz
Older versions of the intersil firmware is a lot slower than newer
versions of the firmware. It responds more slowly to commands, and we bogusly failed them. We assume that all versions of the intersil firmware before 1.0 are 10 times slower and will give it 10x the time to finish. # for 5.2 we should always just assume 5s.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/wi/if_wi.c8
-rw-r--r--sys/dev/wi/if_wivar.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 6281a1d..53086c3 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -270,6 +270,7 @@ wi_attach(device_t dev)
MTX_DEF | MTX_RECURSE);
#endif
+ sc->wi_cmd_count = 500;
/* Reset the NIC. */
if (wi_reset(sc) != 0)
return ENXIO; /* XXX */
@@ -383,6 +384,11 @@ wi_attach(device_t dev)
sc->sc_flags |= WI_FLAGS_HAS_FRAGTHR;
sc->sc_flags |= WI_FLAGS_HAS_ROAMING;
sc->sc_flags |= WI_FLAGS_HAS_SYSSCALE;
+ /*
+ * Old firmware are slow, so give peace a chance.
+ */
+ if (sc->sc_sta_firmware_ver < 10000)
+ sc->wi_cmd_count = 5000;
if (sc->sc_sta_firmware_ver > 10101)
sc->sc_flags |= WI_FLAGS_HAS_DBMADJUST;
if (sc->sc_sta_firmware_ver >= 800) {
@@ -2390,7 +2396,7 @@ wi_cmd(struct wi_softc *sc, int cmd, int val0, int val1, int val2)
count++;
/* wait for the busy bit to clear */
- for (i = 500; i > 0; i--) { /* 500ms */
+ for (i = sc->wi_cmd_count; i > 0; i--) { /* 500ms */
if (!(CSR_READ_2(sc, WI_COMMAND) & WI_CMD_BUSY))
break;
DELAY(1*1000); /* 1ms */
diff --git a/sys/dev/wi/if_wivar.h b/sys/dev/wi/if_wivar.h
index dbfc627..bd7e16b 100644
--- a/sys/dev/wi/if_wivar.h
+++ b/sys/dev/wi/if_wivar.h
@@ -96,6 +96,7 @@ struct wi_softc {
bus_space_tag_t wi_bmemtag;
void * wi_intrhand;
int wi_io_addr;
+ int wi_cmd_count;
struct bpf_if *sc_drvbpf;
int sc_flags;
OpenPOWER on IntegriCloud