1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-26 16:18:31 +00:00

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.
This commit is contained in:
Adrian Chadd 2011-12-26 06:25:12 +00:00
parent 2942e03f5c
commit a497cd8806
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=228890

View File

@ -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 ? */
}