diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2009-03-02 23:46:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-05 14:39:41 -0500 |
commit | 0c98de6535f4de746618547c057dccd442ba968a (patch) | |
tree | 366df1959dec4e60acba3a726bde46aad6453ec3 | |
parent | 707c1b4e68a2811ff2c9e75750a98a3310789a2d (diff) |
ath9k: Use new scan notifiers from mac80211
The only use case for this right now is ANI calibration,
but more might come up in the future.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath9k/ath9k.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath9k/ath9k.h b/drivers/net/wireless/ath9k/ath9k.h index 69292f31d20b..0fb66b0c9e8e 100644 --- a/drivers/net/wireless/ath9k/ath9k.h +++ b/drivers/net/wireless/ath9k/ath9k.h | |||
@@ -559,6 +559,7 @@ struct ath_rfkill { | |||
559 | #define SC_OP_RFKILL_HW_BLOCKED BIT(13) | 559 | #define SC_OP_RFKILL_HW_BLOCKED BIT(13) |
560 | #define SC_OP_WAIT_FOR_BEACON BIT(14) | 560 | #define SC_OP_WAIT_FOR_BEACON BIT(14) |
561 | #define SC_OP_LED_ON BIT(15) | 561 | #define SC_OP_LED_ON BIT(15) |
562 | #define SC_OP_SCANNING BIT(16) | ||
562 | 563 | ||
563 | struct ath_bus_ops { | 564 | struct ath_bus_ops { |
564 | void (*read_cachesize)(struct ath_softc *sc, int *csz); | 565 | void (*read_cachesize)(struct ath_softc *sc, int *csz); |
@@ -682,4 +683,5 @@ static inline void ath9k_ps_restore(struct ath_softc *sc) | |||
682 | ath9k_hw_setpower(sc->sc_ah, | 683 | ath9k_hw_setpower(sc->sc_ah, |
683 | sc->sc_ah->restore_mode); | 684 | sc->sc_ah->restore_mode); |
684 | } | 685 | } |
686 | |||
685 | #endif /* ATH9K_H */ | 687 | #endif /* ATH9K_H */ |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 59b769e716fc..48beef9235b3 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -327,7 +327,7 @@ static void ath_ani_calibrate(unsigned long data) | |||
327 | * don't calibrate when we're scanning. | 327 | * don't calibrate when we're scanning. |
328 | * we are most likely not on our home channel. | 328 | * we are most likely not on our home channel. |
329 | */ | 329 | */ |
330 | if (sc->rx.rxfilter & FIF_BCN_PRBRESP_PROMISC) | 330 | if (sc->sc_flags & SC_OP_SCANNING) |
331 | goto set_timer; | 331 | goto set_timer; |
332 | 332 | ||
333 | /* Long calibration runs independently of short calibration. */ | 333 | /* Long calibration runs independently of short calibration. */ |
@@ -2616,6 +2616,24 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw, | |||
2616 | return ret; | 2616 | return ret; |
2617 | } | 2617 | } |
2618 | 2618 | ||
2619 | static void ath9k_sw_scan_start(struct ieee80211_hw *hw) | ||
2620 | { | ||
2621 | struct ath_softc *sc = hw->priv; | ||
2622 | |||
2623 | mutex_lock(&sc->mutex); | ||
2624 | sc->sc_flags |= SC_OP_SCANNING; | ||
2625 | mutex_unlock(&sc->mutex); | ||
2626 | } | ||
2627 | |||
2628 | static void ath9k_sw_scan_complete(struct ieee80211_hw *hw) | ||
2629 | { | ||
2630 | struct ath_softc *sc = hw->priv; | ||
2631 | |||
2632 | mutex_lock(&sc->mutex); | ||
2633 | sc->sc_flags &= ~SC_OP_SCANNING; | ||
2634 | mutex_unlock(&sc->mutex); | ||
2635 | } | ||
2636 | |||
2619 | struct ieee80211_ops ath9k_ops = { | 2637 | struct ieee80211_ops ath9k_ops = { |
2620 | .tx = ath9k_tx, | 2638 | .tx = ath9k_tx, |
2621 | .start = ath9k_start, | 2639 | .start = ath9k_start, |
@@ -2633,6 +2651,8 @@ struct ieee80211_ops ath9k_ops = { | |||
2633 | .set_tsf = ath9k_set_tsf, | 2651 | .set_tsf = ath9k_set_tsf, |
2634 | .reset_tsf = ath9k_reset_tsf, | 2652 | .reset_tsf = ath9k_reset_tsf, |
2635 | .ampdu_action = ath9k_ampdu_action, | 2653 | .ampdu_action = ath9k_ampdu_action, |
2654 | .sw_scan_start = ath9k_sw_scan_start, | ||
2655 | .sw_scan_complete = ath9k_sw_scan_complete, | ||
2636 | }; | 2656 | }; |
2637 | 2657 | ||
2638 | static struct { | 2658 | static struct { |