Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Mar 2002 00:44:47 +0900 (JST)
From:      Tod McQuillin <devin@spamcop.net>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        Dan Langille <dan@langille.org>, <stable@FreeBSD.ORG>
Subject:   Re: wi0 problems under latest STABLE
Message-ID:  <20020315003925.J437-100000@glass.pun-pun.prv>
In-Reply-To: <20020311105627.A9391@Odin.AC.HMC.Edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 11 Mar 2002, Brooks Davis wrote:

> At this point there isn't.  I I'm going to have to rethink handling this
> problem.  It appears that WI_TIMEOUT is actually too long (it hangs the
> machine for WI_TIMEOUT*WI_DELAY if the command doesn't return).
> Additionaly, it appears that some cards are just broken and we need to
> find a way to deal with them.

I made some changes to if_wi.c which completely cleared up the "timeout in
wi_cmd" messages and 500ms freezes which came up every minute on my laptop
and desktop machines.

The laptop is now completely back to the same behaviour as in cvs rev
1.18.2.14 and earlier of if_wi.c, though the desktop still logs these
messages at boot:

wi0: <WaveLAN/IEEE 802.11> at port 0x240-0x27f irq 15 slot 0 on pccard0
wi0: 802.11 address: 00:02:2d:2b:ab:06
wi0: using Lucent chip or unknown chip
wi0: timeout in wi_cmd 2; event status 8080
wi0: timeout in wi_cmd 0; event status 8080
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: init failed

Probably some changes are still needed at attach time.

Here is the patch:

Index: if_wi.c
===================================================================
RCS file: /usr/src/cvs-repo/src/sys/i386/isa/Attic/if_wi.c,v
retrieving revision 1.18.2.16
diff -c -r1.18.2.16 if_wi.c
*** if_wi.c	4 Mar 2002 20:03:57 -0000	1.18.2.16
--- if_wi.c	14 Mar 2002 12:55:54 -0000
***************
*** 453,459 ****
--- 453,461 ----
  	struct wi_ltv_gen	gen;
  	struct ifnet		*ifp;
  	int			error;
+ 	int			s;

+ 	s = splimp();
  	sc = device_get_softc(dev);
  	ifp = &sc->arpcom.ac_if;

***************
*** 463,468 ****
--- 465,471 ----
  	if (error) {
  		device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
  		wi_free(dev);
+ 		splx(s);
  		return (error);
  	}

***************
*** 481,486 ****
--- 484,490 ----
  	if ((error = wi_read_record(sc, (struct wi_ltv_gen *)&mac)) != 0) {
  		device_printf(dev, "mac read failed %d\n", error);
  		wi_free(dev);
+ 		splx(s);
  		return (error);
  	}
  	bcopy((char *)&mac.wi_mac_addr,
***************
*** 584,589 ****
--- 588,594 ----
  	ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
  	callout_handle_init(&sc->wi_stat_ch);

+ 	splx(s);
  	return(0);
  }

***************
*** 799,804 ****
--- 804,810 ----
  {
  	struct wi_softc		*sc;
  	struct ifnet		*ifp;
+ 	int			s;

  	sc = xsc;
  	ifp = &sc->arpcom.ac_if;
***************
*** 809,815 ****
--- 815,823 ----
  	if (ifp->if_flags & IFF_OACTIVE)
  		return;

+ 	s = splimp();
  	wi_cmd(sc, WI_CMD_INQUIRE, WI_INFO_COUNTERS);
+ 	splx(s);

  	return;
  }

-- 
Tod McQuillin



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




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