Date: Mon, 08 Dec 2003 13:53:23 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: erwin@FreeBSD.org Cc: current@FreeBSD.org Subject: Re: Status of wi(4) Message-ID: <20031208.135323.73290760.imp@bsdimp.com> In-Reply-To: <20031208200714.GA88971@droso.net> References: <20031208162637.GB70065@droso.net> <20031208.123602.71642131.imp@bsdimp.com> <20031208200714.GA88971@droso.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031208.135323.73290760.imp>