summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/if_ath.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r--sys/dev/ath/if_ath.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 6c7b0e7..35592d9 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -528,6 +528,9 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
| IEEE80211_C_WPA /* capable of WPA1+WPA2 */
| IEEE80211_C_BGSCAN /* capable of bg scanning */
| IEEE80211_C_TXFRAG /* handle tx frags */
+#ifdef ATH_ENABLE_DFS
+ | IEEE80211_C_DFS /* Enable DFS radar detection */
+#endif
;
/*
* Query the hal to figure out h/w crypto support.
@@ -738,6 +741,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
*/
ath_sysctlattach(sc);
ath_sysctl_stats_attach(sc);
+ ath_sysctl_hal_attach(sc);
if (bootverbose)
ieee80211_announce(ic);
@@ -1286,6 +1290,8 @@ ath_resume(struct ath_softc *sc)
HAL_GPIO_MUX_MAC_NETWORK_LED);
ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon);
}
+
+ /* XXX beacons ? */
}
void
@@ -1588,6 +1594,12 @@ ath_init(void *arg)
sc->sc_lastani = 0;
sc->sc_lastshortcal = 0;
sc->sc_doresetcal = AH_FALSE;
+ /*
+ * Beacon timers were cleared here; give ath_newstate()
+ * a hint that the beacon timers should be poked when
+ * things transition to the RUN state.
+ */
+ sc->sc_beacons = 0;
/*
* Setup the hardware after reset: the key cache
@@ -4464,6 +4476,19 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
ath_chan_change(sc, chan);
/*
+ * Reset clears the beacon timers; reset them
+ * here if needed.
+ */
+ if (sc->sc_beacons) { /* restart beacons */
+#ifdef IEEE80211_SUPPORT_TDMA
+ if (sc->sc_tdma)
+ ath_tdma_config(sc, NULL);
+ else
+#endif
+ ath_beacon_config(sc, NULL);
+ }
+
+ /*
* Re-enable interrupts.
*/
ath_hal_intrset(ah, sc->sc_imask);
@@ -4668,6 +4693,7 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
struct ieee80211_node *ni = NULL;
int i, error, stamode;
u_int32_t rfilt;
+ int csa_run_transition = 0;
static const HAL_LED_STATE leds[] = {
HAL_LED_INIT, /* IEEE80211_S_INIT */
HAL_LED_SCAN, /* IEEE80211_S_SCAN */
@@ -4683,6 +4709,9 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
ieee80211_state_name[vap->iv_state],
ieee80211_state_name[nstate]);
+ if (vap->iv_state == IEEE80211_S_CSA && nstate == IEEE80211_S_RUN)
+ csa_run_transition = 1;
+
callout_drain(&sc->sc_cal_ch);
ath_hal_setledstate(ah, leds[nstate]); /* set LED */
@@ -4789,8 +4818,14 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
* Defer beacon timer configuration to the next
* beacon frame so we have a current TSF to use
* (any TSF collected when scanning is likely old).
+ * However if it's due to a CSA -> RUN transition,
+ * force a beacon update so we pick up a lack of
+ * beacons from an AP in CAC and thus force a
+ * scan.
*/
sc->sc_syncbeacon = 1;
+ if (csa_run_transition)
+ ath_beacon_config(sc, vap);
break;
case IEEE80211_M_MONITOR:
/*
OpenPOWER on IntegriCloud