From owner-svn-src-all@FreeBSD.ORG Mon Dec 26 06:25:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3FC81065672; Mon, 26 Dec 2011 06:25:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 988538FC08; Mon, 26 Dec 2011 06:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBQ6PCTM093114; Mon, 26 Dec 2011 06:25:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBQ6PCHi093112; Mon, 26 Dec 2011 06:25:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201112260625.pBQ6PCHi093112@svn.freebsd.org> From: Adrian Chadd Date: Mon, 26 Dec 2011 06:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228890 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2011 06:25:12 -0000 Author: adrian Date: Mon Dec 26 06:25:12 2011 New Revision: 228890 URL: http://svn.freebsd.org/changeset/base/228890 Log: Setup the initial LED state on attach and resume. Some of the NICs I have here power up with the LEDs blinking, which is incorrect. The blinking should only occur when the NIC is attempting to associate. * On powerup, set the state to HAL_LED_INIT, which turns on the "Power" MAC LED but leaves the "Network" MAC LED the way it is. * On resume, also init it to HAL_LED_INIT unless in station mode, where it's forced to HAL_LED_RUN. Hopefully the net80211 state machine will call newstate() at some point, which will refiddle the LEDs. I've tested this on a handful of 11n and pre-11n NICs. The blinking behaviour is slightly more sensible now. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Dec 26 06:07:21 2011 (r228889) +++ head/sys/dev/ath/if_ath.c Mon Dec 26 06:25:12 2011 (r228890) @@ -491,6 +491,7 @@ ath_attach(u_int16_t devid, struct ath_s */ sc->sc_softled = (devid == AR5212_DEVID_IBM || devid == AR5211_DEVID); ath_led_config(sc); + ath_hal_setledstate(ah, HAL_LED_INIT); ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; @@ -1312,9 +1313,14 @@ ath_resume(struct ath_softc *sc) /* Let DFS at it in case it's a DFS channel */ ath_dfs_radar_enable(sc, ic->ic_curchan); + /* Restore the LED configuration */ + ath_led_config(sc); + ath_hal_setledstate(ah, HAL_LED_INIT); + if (sc->sc_resume_up) { if (ic->ic_opmode == IEEE80211_M_STA) { ath_init(sc); + ath_hal_setledstate(ah, HAL_LED_RUN); /* * Program the beacon registers using the last rx'd * beacon frame and enable sync on the next beacon @@ -1328,7 +1334,6 @@ ath_resume(struct ath_softc *sc) } else ieee80211_resume_all(ic); } - ath_led_config(sc); /* XXX beacons ? */ }