Date: Wed, 13 Mar 2002 14:32:27 -0800 From: Brooks Davis <brooks@one-eyed-alien.net> To: Brooks Davis <brooks@one-eyed-alien.net> Cc: mobile@FreeBSD.ORG, Oliver Brandmueller <ob@gruft.de>, Rasputin <rasputin@submonkey.net>, Dan Langille <dan@langille.org> Subject: Re: patch for Lucent command timeouts Message-ID: <20020313143226.A18204@Odin.AC.HMC.Edu> In-Reply-To: <20020313113313.B11290@Odin.AC.HMC.Edu>; from brooks@one-eyed-alien.net on Wed, Mar 13, 2002 at 11:33:13AM -0800 References: <20020313113313.B11290@Odin.AC.HMC.Edu>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Wed, Mar 13, 2002 at 11:33:13AM -0800, Brooks Davis wrote:
> The following patch attempts to address the timeouts people have been
> seeing in after my recent MFC of Linksys support.
Here's a slightly improved patch which avoids some timeouts on INI
commands thanks to Thomas Skibo.
-- Brooks
Index: if_wi.c
===================================================================
RCS file: /usr/cvs/src/sys/dev/wi/if_wi.c,v
retrieving revision 1.80
diff -u -r1.80 if_wi.c
--- if_wi.c 11 Mar 2002 23:29:59 -0000 1.80
+++ if_wi.c 13 Mar 2002 22:25:38 -0000
@@ -1003,7 +1003,8 @@
CSR_WRITE_2(sc, WI_PARAM2, 0);
CSR_WRITE_2(sc, WI_COMMAND, cmd);
- for (i = 0; i < WI_TIMEOUT; i++) {
+ for (i = ((cmd == WI_CMD_INI) ? WI_TIMEOUT_INI : WI_TIMEOUT);
+ i >= 0; i--) {
/*
* Wait for 'command complete' bit to be
* set in the event status register.
@@ -1024,9 +1025,9 @@
DELAY(WI_DELAY);
}
- if (i == WI_TIMEOUT) {
+ if (i == WI_TIMEOUT && (sc->wi_prism2 || (cmd != WI_CMD_INQUIRE))) {
device_printf(sc->dev,
- "timeout in wi_cmd %x; event status %x\n", cmd, s);
+ "timeout in wi_cmd 0x%04x; event status 0x%04x\n", cmd, s);
return(ETIMEDOUT);
}
Index: if_wireg.h
===================================================================
RCS file: /usr/cvs/src/sys/dev/wi/if_wireg.h,v
retrieving revision 1.19
diff -u -r1.19 if_wireg.h
--- if_wireg.h 5 Mar 2002 16:06:54 -0000 1.19
+++ if_wireg.h 13 Mar 2002 22:26:08 -0000
@@ -150,7 +150,8 @@
#define WI_UNLOCK(_sc)
#define WI_DELAY 5
-#define WI_TIMEOUT (500000/WI_DELAY) /* 500 ms */
+#define WI_TIMEOUT (10000/WI_DELAY) /* 10 ms */
+#define WI_TIMEOUT_INI (100000/WI_DELAY) /* 100 ms */
#define WI_PORT0 0
#define WI_PORT1 1
--
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE8j9N4XY6L6fI4GtQRAvbOAJ4pZpteVrzNbKVAjclEoL4TQUE09gCfdVoK
aCHsM6pCltP4LoZ/7UnoYog=
=qXIr
-----END PGP SIGNATURE-----
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020313143226.A18204>
