NetBSD Problem Report #25604

Received: (qmail 7538 invoked by uid 605); 17 May 2004 02:13:09 -0000
Message-Id: <20040517021308.5F29011152@narn.netbsd.org>
Date: Mon, 17 May 2004 02:13:08 +0000 (UTC)
From: michael@nosflow.com
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: michael@nosflow.com
To: gnats-bugs@gnats.NetBSD.org
Subject: ifconfig wi0 media DS11 panics system
X-Send-Pr-Version: www-1.0

>Number:         25604
>Category:       kern
>Synopsis:       ifconfig wi0 media DS11 panics system
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    dyoung
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 17 02:14:00 +0000 2004
>Closed-Date:    Sun Aug 08 02:41:14 +0000 2004
>Last-Modified:  Sun Aug 08 02:41:14 +0000 2004
>Originator:     Michael Wolfson
>Release:        2.0_BETA
>Organization:
>Environment:
NetBSD 2.0_BETA NetBSD 2.0_BETA (VGER) #1: Sun May 16 18:14:30 PDT 2004  mw@vger:/usr/src/sys/arch/sparc/compile/VGER sparc
>Description:
Hardware is a SPARCstation Voyager which has a built-in nell PCMCIA interface.  Card is a Lucent Silver WaveLAN 802.11b.  I've also tried the same PCMCIA card on a macppc system without this problem showing up.

martin@duskware.de thinks it's probably a wi issue and not a nell problem.

The card seems to work fine unless I specify the media DS11 option on the sparc system.
# ifconfig wi0 media DS11
trap type 0x7: pc=0xf0127c70 npc=0xf0127c74 psr=44007c4<S,PS>
kernel: alignment fault trap
	Topped in pid 12.1 (ifconfig) at netbsd:ieee80211_chan2mode+0x10:1
duh	[%o1 + 0x2], %g1
db> trace
ieee80211_chan2mode() at netbsd:ifmedia_ioctl
ifmedia_ioctl() at netbsd:wi_ioctl
wi_ioctl() at netbsd:ifioctl
ifioctl() at netbsd:sys_ioctl
sys_ioctl() at netbsd:syscall
syscall() at 0xf00064ec

>How-To-Repeat:

>Fix:
Don't specify media DS11
>Release-Note:
>Audit-Trail:

From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: michael@nosflow.com
Cc: gnats-bugs@gnats.NetBSD.org, netbsd-bugs@netbsd.org
Subject: Re: port-sparc/25604: ifconfig wi0 media DS11 panics system
Date: Tue, 18 May 2004 20:39:50 +0200

 At 2:13 Uhr +0000 17.5.2004, michael@nosflow.com wrote:
 >The card seems to work fine unless I specify the media DS11 option
 >on the sparc system.
 ># ifconfig wi0 media DS11

 If it helps any, I've seen the same panic with a prism 2.5 card on an ss10.

 	hauke

 --
 /~\  The ASCII Ribbon Campaign
 \ /    No HTML/RTF in email
  X     No Word docs in email
 / \  Respect for open standards



From: Michael Wolfson <michael@nosflow.com>
To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Cc: gnats-bugs@gnats.NetBSD.org, netbsd-bugs@netbsd.org
Subject: Re: port-sparc/25604: ifconfig wi0 media DS11 panics system
Date: Tue, 18 May 2004 17:03:39 -0700

 On May 18, 2004, at 11:39 AM, Hauke Fath wrote:

 > At 2:13 Uhr +0000 17.5.2004, michael@nosflow.com wrote:
 >> The card seems to work fine unless I specify the media DS11 option
 >> on the sparc system.
 >> # ifconfig wi0 media DS11
 >
 > If it helps any, I've seen the same panic with a prism 2.5 card on an 
 > ss10.

 So, that's also the wi(4) driver.  I wonder if it happens with non-wi 
 drivers on sparc?

    -- MW


From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: Michael Wolfson <michael@nosflow.com>
Cc: Hauke Fath <hauke@espresso.rhein-neckar.de>, gnats-bugs@gnats.NetBSD.org,
  netbsd-bugs@netbsd.org
Subject: Re: port-sparc/25604: ifconfig wi0 media DS11 panics system
Date: Thu, 20 May 2004 16:14:28 +0200

 At 17:03 Uhr -0700 18.5.2004, Michael Wolfson wrote:
 >> If it helps any, I've seen the same panic with a prism 2.5 card on an
 >> ss10.
 >
 >So, that's also the wi(4) driver.

 Right. But it's a different chip, different code path, differemt data point.

 >I wonder if it happens with non-wi drivers on sparc?

 Are there any? The nell is 16 bit PCMCIA only.

 	hauke


 --
 /~\  The ASCII Ribbon Campaign
 \ /    No HTML/RTF in email
  X     No Word docs in email
 / \  Respect for open standards



From: Michael Wolfson <michael@nosflow.com>
To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Cc: gnats-bugs@gnats.NetBSD.org, netbsd-bugs@netbsd.org
Subject: Re: port-sparc/25604: ifconfig wi0 media DS11 panics system
Date: Thu, 20 May 2004 08:05:10 -0700

 On May 20, 2004, at 7:14 AM, Hauke Fath wrote:

 > Right. But it's a different chip, different code path, differemt data 
 > point.

 OK.

 >> I wonder if it happens with non-wi drivers on sparc?
 >
 > Are there any? The nell is 16 bit PCMCIA only.

 awi(4).  I don't own one though.

    -- MW


From: Martin Husemann <martin@duskware.de>
To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Cc: Michael Wolfson <michael@nosflow.com>, gnats-bugs@gnats.NetBSD.org,
  netbsd-bugs@netbsd.org
Subject: Re: port-sparc/25604: ifconfig wi0 media DS11 panics system
Date: Thu, 20 May 2004 17:13:45 +0200

 On Thu, May 20, 2004 at 04:14:28PM +0200, Hauke Fath wrote:
 > Are there any? The nell is 16 bit PCMCIA only.

 Probably unintersting nowadays: ray was the first PCMCIA card I got working
 with nell ;-)

 Martin

From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Cc: Michael Wolfson <michael@nosflow.com>, gnats-bugs@gnats.NetBSD.org,
  netbsd-bugs@NetBSD.org
Subject: Re: port-sparc/25604: ifconfig wi0 media DS11 panics system
Date: Thu, 20 May 2004 22:26:54 +0200

 from http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=25604

 >I think that this happens because a ieee80211_ieee2mode dereferences
 >ic->ic_bss->ni_chan while it is set to IEEE80211_CHAN_ANYC.
 >
 >
 >Please try this patch.

 [...]

 This helps - the panic is gone.

 But, on the other hand, an /etc/ifconfig.wi0 like

 <snip>

 [hauke@pizza] ~ > cat /etc/ifconfig.wi0
 # $Id: ifconfig.wi0,v 1.1 2004/05/20 18:24:03 hauke Exp hauke $
 #
 # Set up wlan accesspoint

 chan 11
 media DS11
 nwid BallPark nwkey "1234512345123"

 # Be an accesspoint
 mediaopt hostap

 up

 </snip>

 gives me a "SIOCSIFMEDIA: Invalid argument" during boot no matter how I
 place the "media DS11".

 The ifconfig(8) and ifmedia(4) man pages tell me nothing about
 preconditions, and an "ifconfig wi0 media DS11" from the command line works
 just fine - although I noticed that it wipes out the "mediaopt hostap"
 unless I add that to the ifconfig parameters.

 	hauke

 --
 /~\  The ASCII Ribbon Campaign
 \ /    No HTML/RTF in email
  X     No Word docs in email
 / \  Respect for open standards


Responsible-Changed-From-To: port-sparc-maintainer->dyoung 
Responsible-Changed-By: dyoung 
Responsible-Changed-When: Sun May 30 01:21:21 UTC 2004 
Responsible-Changed-Why:  
David Young is working on it. 

From: David Young <dyoung@pobox.com>
To: gnats-bugs@gnats.netbsd.org, hauke@Espresso.Rhein-Neckar.DE
Cc:  
Subject: Re: kern/25604
Date: Sat, 29 May 2004 20:24:10 -0500

 --3siQDZowHQqNOShm
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 Hauke,

 Try this patch for the second issue, SIOCSIFMEDIA: Invalid argument.

 Dave

 -- 
 David Young             OJC Technologies
 dyoung@ojctech.com      Urbana, IL * (217) 278-3933

 --3siQDZowHQqNOShm
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=wmc-diff

 Index: wi.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/ic/wi.c,v
 retrieving revision 1.159
 diff -u -r1.159 wi.c
 --- wi.c	26 Mar 2004 06:43:25 -0000	1.159
 +++ wi.c	30 May 2004 01:19:46 -0000
 @@ -1255,53 +1255,14 @@
  	return error;
  }

 -/* TBD factor with ieee80211_media_change */
  static int
  wi_media_change(struct ifnet *ifp)
  {
  	struct wi_softc *sc = ifp->if_softc;
  	struct ieee80211com *ic = &sc->sc_ic;
 -	struct ifmedia_entry *ime;
 -	enum ieee80211_opmode newmode;
 -	int i, rate, error = 0;
 -
 -	ime = ic->ic_media.ifm_cur;
 -	if (IFM_SUBTYPE(ime->ifm_media) == IFM_AUTO) {
 -		i = -1;
 -	} else {
 -		struct ieee80211_rateset *rs =
 -		    &ic->ic_sup_rates[ieee80211_chan2mode(ic,
 -		        ic->ic_bss->ni_chan)];
 -		rate = ieee80211_media2rate(ime->ifm_media);
 -		if (rate == 0)
 -			return EINVAL;
 -		for (i = 0; i < rs->rs_nrates; i++) {
 -			if ((rs->rs_rates[i] & IEEE80211_RATE_VAL) == rate)
 -				break;
 -		}
 -		if (i == rs->rs_nrates)
 -			return EINVAL;
 -	}
 -	if (ic->ic_fixed_rate != i) {
 -		ic->ic_fixed_rate = i;
 -		error = ENETRESET;
 -	}
 -
 -	if ((ime->ifm_media & IFM_IEEE80211_ADHOC) &&
 -	    (ime->ifm_media & IFM_FLAG0))
 -		newmode = IEEE80211_M_AHDEMO;
 -	else if (ime->ifm_media & IFM_IEEE80211_ADHOC)
 -		newmode = IEEE80211_M_IBSS;
 -	else if (ime->ifm_media & IFM_IEEE80211_HOSTAP)
 -		newmode = IEEE80211_M_HOSTAP;
 -	else if (ime->ifm_media & IFM_IEEE80211_MONITOR)
 -		newmode = IEEE80211_M_MONITOR;
 -	else
 -		newmode = IEEE80211_M_STA;
 -	if (ic->ic_opmode != newmode) {
 -		ic->ic_opmode = newmode;
 -		error = ENETRESET;
 -	}
 +	int error;
 +
 +	error = ieee80211_media_change(ifp);
  	if (error == ENETRESET) {
  		if (sc->sc_enabled)
  			error = wi_init(ifp);

 --3siQDZowHQqNOShm--

From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: David Young <dyoung@pobox.com>
Cc: gnats-bugs@gnats.netbsd.org, hauke@Espresso.Rhein-Neckar.DE
Subject: Re: kern/25604
Date: Thu, 3 Jun 2004 22:37:30 +0200

 At 20:24 Uhr -0500 29.5.2004, David Young wrote:
 >Try this patch for the second issue, SIOCSIFMEDIA: Invalid argument.

 Works fine for me. Thanks!

 	hauke

 --
 /~\  The ASCII Ribbon Campaign
 \ /    No HTML/RTF in email
  X     No Word docs in email
 / \  Respect for open standards



From: David Young <dyoung@pobox.com>
To: michael@nosflow.com
Cc: gnats-bugs@netbsd.org
Subject: kern/25604: ifconfig wi0 media DS11 panics system
Date: Sun, 6 Jun 2004 00:54:05 -0500

 Michael,

 I have made some patches that should resolve this problem.  (I have also
 made a 2.0 pull-up request.)  Please test -current sources.

 Dave

 -- 
 David Young             OJC Technologies
 dyoung@ojctech.com      Urbana, IL * (217) 278-3933
State-Changed-From-To: open->feedback 
State-Changed-By: dyoung 
State-Changed-When: Sat Aug 7 05:04:56 UTC 2004 
State-Changed-Why:  
Hauke says my patches fixed the issue for him.  Michael? 
State-Changed-From-To: feedback->closed 
State-Changed-By: mbw 
State-Changed-When: Sun Aug 8 02:40:10 UTC 2004 
State-Changed-Why:  
dyoung's fixes to the tree work.  Tested on 2.0_BETA.  Thanks! 
>Unformatted:
 I think that this happens because a ieee80211_ieee2mode dereferences
 ic->ic_bss->ni_chan while it is set to IEEE80211_CHAN_ANYC.

 Please try this patch.

 Index: sys/net80211/ieee80211.c
 ===================================================================
 RCS file: /cvsroot/src/sys/net80211/ieee80211.c,v
 retrieving revision 1.14
 diff -u -r1.14 ieee80211.c
 --- sys/net80211/ieee80211.c	9 May 2004 09:00:05 -0000	1.14
 +++ sys/net80211/ieee80211.c	19 May 2004 07:21:31 -0000
 @@ -786,7 +805,8 @@
 	 * NB: this assumes the channel would not be supplied to us
 	 *     unless it was already compatible with the current mode.
 	 */
 -	if (ic->ic_curmode != IEEE80211_MODE_AUTO)
 +	if (ic->ic_curmode != IEEE80211_MODE_AUTO ||
 +	    chan == IEEE80211_CHAN_ANYC)
 		return ic->ic_curmode;
 	/*
 	 * In autoselect mode; deduce a mode based on the channel

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.