Skip site navigation (1)Skip section navigation (2)
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>

next in thread | previous in thread | raw e-mail | index | archive | help

--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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);
=20
-	for (i =3D 0; i < WI_TIMEOUT; i++) {
+	for (i =3D ((cmd =3D=3D WI_CMD_INI) ? WI_TIMEOUT_INI : WI_TIMEOUT);
+	    i >=3D 0; i--) {
 		/*
 		 * Wait for 'command complete' bit to be
 		 * set in the event status register.
@@ -1024,9 +1025,9 @@
 		DELAY(WI_DELAY);
 	}
=20
-	if (i =3D=3D WI_TIMEOUT) {
+	if (i =3D=3D WI_TIMEOUT && (sc->wi_prism2 || (cmd !=3D 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);
 	}
=20
Index: if_wireg.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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)
=20
 #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 */
=20
 #define WI_PORT0	0
 #define WI_PORT1	1

--=20
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

--ikeVEW9yuYc//A+q
Content-Type: application/pgp-signature
Content-Disposition: inline

-----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-----

--ikeVEW9yuYc//A+q--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020313143226.A18204>