Status of wi(4)
M. Warner Losh
imp at bsdimp.com
Mon Dec 8 12:55:27 PST 2003
You might want to try the following patch. I've had another report
that the firmware is too slow to the 'fast' timings we have in
current.
Warner
Index: if_wi.c
===================================================================
RCS file: /home/imp/FreeBSD/CVS/src/sys/dev/wi/if_wi.c,v
retrieving revision 1.158
diff -u -r1.158 if_wi.c
--- if_wi.c 2 Dec 2003 04:59:59 -0000 1.158
+++ if_wi.c 8 Dec 2003 20:49:20 -0000
@@ -270,6 +270,7 @@
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 @@
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 @@
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 */
Index: if_wivar.h
===================================================================
RCS file: /home/imp/FreeBSD/CVS/src/sys/dev/wi/if_wivar.h,v
retrieving revision 1.20
diff -u -r1.20 if_wivar.h
--- if_wivar.h 5 Sep 2003 22:29:30 -0000 1.20
+++ if_wivar.h 8 Dec 2003 20:49:44 -0000
@@ -96,6 +96,7 @@
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;
More information about the freebsd-current
mailing list