diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2009-12-14 04:27:04 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-22 13:56:12 -0500 |
commit | 05c78d6d3ec5a8325398b3866e7e6bb88940d4fd (patch) | |
tree | 91951db4805bd5250dc433632ca3d3c4244326c1 /drivers/net/wireless/ath | |
parent | 0ce024cbcd5837596bc82861f1d3074d53e956f6 (diff) |
ath9k: Remove ANI lock
Cancel/restart the ANI timer directly.
With this patch, the ANI lock can be removed.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 19 |
2 files changed, 4 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index e2cef2ff5d8f..9f1f523e02eb 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -453,7 +453,6 @@ struct ath_softc { | |||
453 | int irq; | 453 | int irq; |
454 | spinlock_t sc_resetlock; | 454 | spinlock_t sc_resetlock; |
455 | spinlock_t sc_serial_rw; | 455 | spinlock_t sc_serial_rw; |
456 | spinlock_t ani_lock; | ||
457 | spinlock_t sc_pm_lock; | 456 | spinlock_t sc_pm_lock; |
458 | struct mutex mutex; | 457 | struct mutex mutex; |
459 | 458 | ||
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index c48743452515..adb0edf2c8b0 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -363,14 +363,6 @@ static void ath_ani_calibrate(unsigned long data) | |||
363 | short_cal_interval = (ah->opmode == NL80211_IFTYPE_AP) ? | 363 | short_cal_interval = (ah->opmode == NL80211_IFTYPE_AP) ? |
364 | ATH_AP_SHORT_CALINTERVAL : ATH_STA_SHORT_CALINTERVAL; | 364 | ATH_AP_SHORT_CALINTERVAL : ATH_STA_SHORT_CALINTERVAL; |
365 | 365 | ||
366 | /* | ||
367 | * don't calibrate when we're scanning. | ||
368 | * we are most likely not on our home channel. | ||
369 | */ | ||
370 | spin_lock(&sc->ani_lock); | ||
371 | if (sc->sc_flags & SC_OP_SCANNING) | ||
372 | goto set_timer; | ||
373 | |||
374 | /* Only calibrate if awake */ | 366 | /* Only calibrate if awake */ |
375 | if (sc->sc_ah->power_mode != ATH9K_PM_AWAKE) | 367 | if (sc->sc_ah->power_mode != ATH9K_PM_AWAKE) |
376 | goto set_timer; | 368 | goto set_timer; |
@@ -437,7 +429,6 @@ static void ath_ani_calibrate(unsigned long data) | |||
437 | ath9k_ps_restore(sc); | 429 | ath9k_ps_restore(sc); |
438 | 430 | ||
439 | set_timer: | 431 | set_timer: |
440 | spin_unlock(&sc->ani_lock); | ||
441 | /* | 432 | /* |
442 | * Set timer interval based on previous results. | 433 | * Set timer interval based on previous results. |
443 | * The interval must be the shortest necessary to satisfy ANI, | 434 | * The interval must be the shortest necessary to satisfy ANI, |
@@ -1610,7 +1601,6 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
1610 | spin_lock_init(&sc->wiphy_lock); | 1601 | spin_lock_init(&sc->wiphy_lock); |
1611 | spin_lock_init(&sc->sc_resetlock); | 1602 | spin_lock_init(&sc->sc_resetlock); |
1612 | spin_lock_init(&sc->sc_serial_rw); | 1603 | spin_lock_init(&sc->sc_serial_rw); |
1613 | spin_lock_init(&sc->ani_lock); | ||
1614 | spin_lock_init(&sc->sc_pm_lock); | 1604 | spin_lock_init(&sc->sc_pm_lock); |
1615 | mutex_init(&sc->mutex); | 1605 | mutex_init(&sc->mutex); |
1616 | tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); | 1606 | tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); |
@@ -3113,6 +3103,7 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw) | |||
3113 | { | 3103 | { |
3114 | struct ath_wiphy *aphy = hw->priv; | 3104 | struct ath_wiphy *aphy = hw->priv; |
3115 | struct ath_softc *sc = aphy->sc; | 3105 | struct ath_softc *sc = aphy->sc; |
3106 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
3116 | 3107 | ||
3117 | mutex_lock(&sc->mutex); | 3108 | mutex_lock(&sc->mutex); |
3118 | if (ath9k_wiphy_scanning(sc)) { | 3109 | if (ath9k_wiphy_scanning(sc)) { |
@@ -3128,10 +3119,8 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw) | |||
3128 | 3119 | ||
3129 | aphy->state = ATH_WIPHY_SCAN; | 3120 | aphy->state = ATH_WIPHY_SCAN; |
3130 | ath9k_wiphy_pause_all_forced(sc, aphy); | 3121 | ath9k_wiphy_pause_all_forced(sc, aphy); |
3131 | |||
3132 | spin_lock_bh(&sc->ani_lock); | ||
3133 | sc->sc_flags |= SC_OP_SCANNING; | 3122 | sc->sc_flags |= SC_OP_SCANNING; |
3134 | spin_unlock_bh(&sc->ani_lock); | 3123 | del_timer_sync(&common->ani.timer); |
3135 | mutex_unlock(&sc->mutex); | 3124 | mutex_unlock(&sc->mutex); |
3136 | } | 3125 | } |
3137 | 3126 | ||
@@ -3139,13 +3128,13 @@ static void ath9k_sw_scan_complete(struct ieee80211_hw *hw) | |||
3139 | { | 3128 | { |
3140 | struct ath_wiphy *aphy = hw->priv; | 3129 | struct ath_wiphy *aphy = hw->priv; |
3141 | struct ath_softc *sc = aphy->sc; | 3130 | struct ath_softc *sc = aphy->sc; |
3131 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
3142 | 3132 | ||
3143 | mutex_lock(&sc->mutex); | 3133 | mutex_lock(&sc->mutex); |
3144 | spin_lock_bh(&sc->ani_lock); | ||
3145 | aphy->state = ATH_WIPHY_ACTIVE; | 3134 | aphy->state = ATH_WIPHY_ACTIVE; |
3146 | sc->sc_flags &= ~SC_OP_SCANNING; | 3135 | sc->sc_flags &= ~SC_OP_SCANNING; |
3147 | sc->sc_flags |= SC_OP_FULL_RESET; | 3136 | sc->sc_flags |= SC_OP_FULL_RESET; |
3148 | spin_unlock_bh(&sc->ani_lock); | 3137 | ath_start_ani(common); |
3149 | ath_beacon_config(sc, NULL); | 3138 | ath_beacon_config(sc, NULL); |
3150 | mutex_unlock(&sc->mutex); | 3139 | mutex_unlock(&sc->mutex); |
3151 | } | 3140 | } |