From gfm@menhennitt.com.au  Sat Feb 13 07:58:30 2010
Return-Path: <gfm@menhennitt.com.au>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A12C1106566C
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 13 Feb 2010 07:58:30 +0000 (UTC)
	(envelope-from gfm@menhennitt.com.au)
Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10])
	by mx1.freebsd.org (Postfix) with ESMTP id 398A78FC16
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 13 Feb 2010 07:58:29 +0000 (UTC)
Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182])
	by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o1D60Nbu005716
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 13 Feb 2010 17:00:23 +1100
Received: from maxwell.mencon.com.au (c122-107-224-152.mckinn3.vic.optusnet.com.au [122.107.224.152])
	by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o1D60KQE002008
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 13 Feb 2010 17:00:21 +1100
Received: by maxwell.mencon.com.au (Postfix, from userid 1001)
	id C7E085D3A; Sat, 13 Feb 2010 17:00:14 +1100 (EST)
Message-Id: <20100213060014.C7E085D3A@maxwell.mencon.com.au>
Date: Sat, 13 Feb 2010 17:00:14 +1100 (EST)
From: Graham Menhennitt <graham@menhennitt.com.au>
Reply-To: Graham Menhennitt <graham@menhennitt.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: allow Atheros watchdog timeout to be tunable
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         143868
>Category:       kern
>Synopsis:       [ath] [patch] [request] allow Atheros watchdog timeout to be tunable
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-wireless
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 13 08:00:14 UTC 2010
>Closed-Date:    Thu Dec 22 23:19:59 UTC 2011
>Last-Modified:  Thu Dec 22 23:19:59 UTC 2011
>Originator:     Graham Menhennitt
>Release:        FreeBSD 8.0-STABLE i386
>Organization:
>Environment:
System: FreeBSD maxwell.mencon.com.au 8.0-STABLE FreeBSD 8.0-STABLE #24: Sun Feb 14 00:56:04 EST 2010 root@chief-freebsd.mencon.com.au:/usr/obj/usr/src/sys/maxwell i386

ath0: <Atheros 5413> mem 0xa0010000-0xa001ffff irq 15 at device 17.0 on pci0
ath0: [ITHREAD]
ath0: AR5413 mac 10.5 RF5413 phy 6.1

>Description:
The Atheros wireless driver uses a hard-coded value for the watchdog timer. This value is too low on slow hardware (e.g. Soekris net5501). The attached patch allows the timer threshold to be tuned via sysctl.
>How-To-Repeat:
>Fix:

*** if_ath.c	Sat Feb 13 13:47:37 2010
--- if_ath.c_save	Tue Sep  8 02:41:18 2009
***************
*** 286,295 ****
  SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold,
  	    0, "max missed beacon xmits before chip reset");
  
- static	int ath_wd_timer_threshold = 5;		/* watchdog timer threshold */
- SYSCTL_INT(_hw_ath, OID_AUTO, wd_timer_threshold, CTLFLAG_RW, &ath_wd_timer_threshold,
- 	    0, "watchdog timer threshold");
- 
  #ifdef ATH_DEBUG
  enum {
  	ATH_DEBUG_XMIT		= 0x00000001,	/* basic xmit operation */
--- 286,291 ----
***************
*** 1894,1900 ****
  			goto nextfrag;
  		}
  
! 		sc->sc_wd_timer = ath_wd_timer_threshold;
  	}
  }
  
--- 1890,1896 ----
  			goto nextfrag;
  		}
  
! 		sc->sc_wd_timer = 5;
  	}
  }
  
***************
*** 6906,6912 ****
  			goto bad2;
  		}
  	}
! 	sc->sc_wd_timer = ath_wd_timer_threshold;
  	ifp->if_opackets++;
  	sc->sc_stats.ast_tx_raw++;
  
--- 6902,6908 ----
  			goto bad2;
  		}
  	}
! 	sc->sc_wd_timer = 5;
  	ifp->if_opackets++;
  	sc->sc_stats.ast_tx_raw++;
  
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Feb 13 08:52:27 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=143868 
Responsible-Changed-From-To: freebsd-net->freebsd-wireless 
Responsible-Changed-By: adrian 
Responsible-Changed-When: Mon Apr 11 11:42:26 UTC 2011 
Responsible-Changed-Why:  
punt to freebsd-wireless 


http://www.freebsd.org/cgi/query-pr.cgi?pr=143868 
State-Changed-From-To: open->closed 
State-Changed-By: adrian 
State-Changed-When: Thu Dec 22 23:19:14 UTC 2011 
State-Changed-Why:  
Submitter reports thus: 

== 
The Soekris box net5501 I use as my router/WAP/server used to report timeouts every few seconds. I upped that timeout value by changing the code to fix it (well, actually, reduce it to a managable level). It seemed that this should be tunable via a sysctl instead. 

I've added a second antenna for diversity and that seems to have fixed the problem completely. So, I don't need it any longer. 
== 

This is a common problem - if not all antennas are configured, the 
radio/baseband can incorrectly calibrate things and it shows up 
as a "stuck beacon". 


http://www.freebsd.org/cgi/query-pr.cgi?pr=143868 
>Unformatted:
