From owner-freebsd-current@FreeBSD.ORG Mon Dec 8 12:55:27 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8FECA16A4CE; Mon, 8 Dec 2003 12:55:27 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78BF243D28; Mon, 8 Dec 2003 12:55:14 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.10/8.12.9) with ESMTP id hB8KrQ0u011258; Mon, 8 Dec 2003 13:53:26 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 08 Dec 2003 13:53:23 -0700 (MST) Message-Id: <20031208.135323.73290760.imp@bsdimp.com> To: erwin@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20031208200714.GA88971@droso.net> References: <20031208162637.GB70065@droso.net> <20031208.123602.71642131.imp@bsdimp.com> <20031208200714.GA88971@droso.net> X-Mailer: Mew version 2.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: current@FreeBSD.org Subject: Re: Status of wi(4) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2003 20:55:27 -0000 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;