diff options
author | adrian <adrian@FreeBSD.org> | 2011-12-26 06:25:12 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2011-12-26 06:25:12 +0000 |
commit | 122e4872cc81f926fd37e041becea69984548a14 (patch) | |
tree | 7e6ec2d7ed1b0fba34c0e44fd8e90d29472313f3 /sys/dev/ath/if_ath.c | |
parent | 137bb4966cdf4f59430aa2cc5395754323ec1198 (diff) | |
download | FreeBSD-src-122e4872cc81f926fd37e041becea69984548a14.zip FreeBSD-src-122e4872cc81f926fd37e041becea69984548a14.tar.gz |
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.
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r-- | sys/dev/ath/if_ath.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index ee17c84..e4d7976 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -491,6 +491,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) */ 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 ? */ } |