aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2009-01-19 11:20:54 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:00:53 -0500
commitbb2becac91f13e862d4601a8c5364bc758c35b8e (patch)
tree5d599d13bc31a50306d6a4069696fbf76b72894b
parent665af4fc8979734d8f73c9a6732be07e545ce4cc (diff)
ath5k: remove stop/start calls from within suspend/resume
mac80211 now takes down interfaces automatically during suspend so doing it in the driver is unnecessary. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath5k/base.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index d3178731adc6..747b49682c5d 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -347,9 +347,9 @@ static inline u64 ath5k_extend_tsf(struct ath5k_hw *ah, u32 rstamp)
347} 347}
348 348
349/* Interrupt handling */ 349/* Interrupt handling */
350static int ath5k_init(struct ath5k_softc *sc, bool is_resume); 350static int ath5k_init(struct ath5k_softc *sc);
351static int ath5k_stop_locked(struct ath5k_softc *sc); 351static int ath5k_stop_locked(struct ath5k_softc *sc);
352static int ath5k_stop_hw(struct ath5k_softc *sc, bool is_suspend); 352static int ath5k_stop_hw(struct ath5k_softc *sc);
353static irqreturn_t ath5k_intr(int irq, void *dev_id); 353static irqreturn_t ath5k_intr(int irq, void *dev_id);
354static void ath5k_tasklet_reset(unsigned long data); 354static void ath5k_tasklet_reset(unsigned long data);
355 355
@@ -653,8 +653,6 @@ ath5k_pci_suspend(struct pci_dev *pdev, pm_message_t state)
653 653
654 ath5k_led_off(sc); 654 ath5k_led_off(sc);
655 655
656 ath5k_stop_hw(sc, true);
657
658 free_irq(pdev->irq, sc); 656 free_irq(pdev->irq, sc);
659 pci_save_state(pdev); 657 pci_save_state(pdev);
660 pci_disable_device(pdev); 658 pci_disable_device(pdev);
@@ -689,14 +687,9 @@ ath5k_pci_resume(struct pci_dev *pdev)
689 goto err_no_irq; 687 goto err_no_irq;
690 } 688 }
691 689
692 err = ath5k_init(sc, true);
693 if (err)
694 goto err_irq;
695 ath5k_led_enable(sc); 690 ath5k_led_enable(sc);
696
697 return 0; 691 return 0;
698err_irq: 692
699 free_irq(pdev->irq, sc);
700err_no_irq: 693err_no_irq:
701 pci_disable_device(pdev); 694 pci_disable_device(pdev);
702 return err; 695 return err;
@@ -2226,18 +2219,13 @@ ath5k_beacon_config(struct ath5k_softc *sc)
2226\********************/ 2219\********************/
2227 2220
2228static int 2221static int
2229ath5k_init(struct ath5k_softc *sc, bool is_resume) 2222ath5k_init(struct ath5k_softc *sc)
2230{ 2223{
2231 struct ath5k_hw *ah = sc->ah; 2224 struct ath5k_hw *ah = sc->ah;
2232 int ret, i; 2225 int ret, i;
2233 2226
2234 mutex_lock(&sc->lock); 2227 mutex_lock(&sc->lock);
2235 2228
2236 if (is_resume && !test_bit(ATH_STAT_STARTED, sc->status))
2237 goto out_ok;
2238
2239 __clear_bit(ATH_STAT_STARTED, sc->status);
2240
2241 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "mode %d\n", sc->opmode); 2229 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "mode %d\n", sc->opmode);
2242 2230
2243 /* 2231 /*
@@ -2269,15 +2257,12 @@ ath5k_init(struct ath5k_softc *sc, bool is_resume)
2269 for (i = 0; i < AR5K_KEYTABLE_SIZE; i++) 2257 for (i = 0; i < AR5K_KEYTABLE_SIZE; i++)
2270 ath5k_hw_reset_key(ah, i); 2258 ath5k_hw_reset_key(ah, i);
2271 2259
2272 __set_bit(ATH_STAT_STARTED, sc->status);
2273
2274 /* Set ack to be sent at low bit-rates */ 2260 /* Set ack to be sent at low bit-rates */
2275 ath5k_hw_set_ack_bitrate_high(ah, false); 2261 ath5k_hw_set_ack_bitrate_high(ah, false);
2276 2262
2277 mod_timer(&sc->calib_tim, round_jiffies(jiffies + 2263 mod_timer(&sc->calib_tim, round_jiffies(jiffies +
2278 msecs_to_jiffies(ath5k_calinterval * 1000))); 2264 msecs_to_jiffies(ath5k_calinterval * 1000)));
2279 2265
2280out_ok:
2281 ret = 0; 2266 ret = 0;
2282done: 2267done:
2283 mmiowb(); 2268 mmiowb();
@@ -2332,7 +2317,7 @@ ath5k_stop_locked(struct ath5k_softc *sc)
2332 * stop is preempted). 2317 * stop is preempted).
2333 */ 2318 */
2334static int 2319static int
2335ath5k_stop_hw(struct ath5k_softc *sc, bool is_suspend) 2320ath5k_stop_hw(struct ath5k_softc *sc)
2336{ 2321{
2337 int ret; 2322 int ret;
2338 2323
@@ -2363,8 +2348,6 @@ ath5k_stop_hw(struct ath5k_softc *sc, bool is_suspend)
2363 } 2348 }
2364 } 2349 }
2365 ath5k_txbuf_free(sc, sc->bbuf); 2350 ath5k_txbuf_free(sc, sc->bbuf);
2366 if (!is_suspend)
2367 __clear_bit(ATH_STAT_STARTED, sc->status);
2368 2351
2369 mmiowb(); 2352 mmiowb();
2370 mutex_unlock(&sc->lock); 2353 mutex_unlock(&sc->lock);
@@ -2771,12 +2754,12 @@ ath5k_reset_wake(struct ath5k_softc *sc)
2771 2754
2772static int ath5k_start(struct ieee80211_hw *hw) 2755static int ath5k_start(struct ieee80211_hw *hw)
2773{ 2756{
2774 return ath5k_init(hw->priv, false); 2757 return ath5k_init(hw->priv);
2775} 2758}
2776 2759
2777static void ath5k_stop(struct ieee80211_hw *hw) 2760static void ath5k_stop(struct ieee80211_hw *hw)
2778{ 2761{
2779 ath5k_stop_hw(hw->priv, false); 2762 ath5k_stop_hw(hw->priv);
2780} 2763}
2781 2764
2782static int ath5k_add_interface(struct ieee80211_hw *hw, 2765static int ath5k_add_interface(struct ieee80211_hw *hw,