aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index fb5193764afa..55f7de09d134 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2070,6 +2070,13 @@ err_unmap:
2070 return ret; 2070 return ret;
2071} 2071}
2072 2072
2073static void ath5k_beacon_disable(struct ath5k_softc *sc)
2074{
2075 sc->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA);
2076 ath5k_hw_set_imr(sc->ah, sc->imask);
2077 ath5k_hw_stop_tx_dma(sc->ah, sc->bhalq);
2078}
2079
2073/* 2080/*
2074 * Transmit a beacon frame at SWBA. Dynamic updates to the 2081 * Transmit a beacon frame at SWBA. Dynamic updates to the
2075 * frame contents are done as needed and the slot time is 2082 * frame contents are done as needed and the slot time is
@@ -2353,6 +2360,8 @@ ath5k_init(struct ath5k_softc *sc)
2353 if (ret) 2360 if (ret)
2354 goto done; 2361 goto done;
2355 2362
2363 ath5k_rfkill_hw_start(ah);
2364
2356 /* 2365 /*
2357 * Reset the key cache since some parts do not reset the 2366 * Reset the key cache since some parts do not reset the
2358 * contents on initial power up or resume from suspend. 2367 * contents on initial power up or resume from suspend.
@@ -2461,6 +2470,8 @@ ath5k_stop_hw(struct ath5k_softc *sc)
2461 tasklet_kill(&sc->restq); 2470 tasklet_kill(&sc->restq);
2462 tasklet_kill(&sc->beacontq); 2471 tasklet_kill(&sc->beacontq);
2463 2472
2473 ath5k_rfkill_hw_stop(sc->ah);
2474
2464 return ret; 2475 return ret;
2465} 2476}
2466 2477
@@ -2519,6 +2530,9 @@ ath5k_intr(int irq, void *dev_id)
2519 */ 2530 */
2520 ath5k_hw_update_mib_counters(ah, &sc->ll_stats); 2531 ath5k_hw_update_mib_counters(ah, &sc->ll_stats);
2521 } 2532 }
2533 if (status & AR5K_INT_GPIO)
2534 tasklet_schedule(&sc->rf_kill.toggleq);
2535
2522 } 2536 }
2523 } while (ath5k_hw_is_intr_pending(ah) && --counter > 0); 2537 } while (ath5k_hw_is_intr_pending(ah) && --counter > 0);
2524 2538
@@ -2757,6 +2771,7 @@ ath5k_remove_interface(struct ieee80211_hw *hw,
2757 goto end; 2771 goto end;
2758 2772
2759 ath5k_hw_set_lladdr(sc->ah, mac); 2773 ath5k_hw_set_lladdr(sc->ah, mac);
2774 ath5k_beacon_disable(sc);
2760 sc->vif = NULL; 2775 sc->vif = NULL;
2761end: 2776end:
2762 mutex_unlock(&sc->lock); 2777 mutex_unlock(&sc->lock);
@@ -2775,11 +2790,9 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
2775 2790
2776 mutex_lock(&sc->lock); 2791 mutex_lock(&sc->lock);
2777 2792
2778 sc->bintval = conf->beacon_int;
2779
2780 ret = ath5k_chan_set(sc, conf->channel); 2793 ret = ath5k_chan_set(sc, conf->channel);
2781 if (ret < 0) 2794 if (ret < 0)
2782 return ret; 2795 goto unlock;
2783 2796
2784 if ((changed & IEEE80211_CONF_CHANGE_POWER) && 2797 if ((changed & IEEE80211_CONF_CHANGE_POWER) &&
2785 (sc->power_level != conf->power_level)) { 2798 (sc->power_level != conf->power_level)) {
@@ -2808,8 +2821,9 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
2808 */ 2821 */
2809 ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT); 2822 ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT);
2810 2823
2824unlock:
2811 mutex_unlock(&sc->lock); 2825 mutex_unlock(&sc->lock);
2812 return 0; 2826 return ret;
2813} 2827}
2814 2828
2815#define SUPPORTED_FIF_FLAGS \ 2829#define SUPPORTED_FIF_FLAGS \
@@ -3061,7 +3075,14 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
3061{ 3075{
3062 int ret; 3076 int ret;
3063 struct ath5k_softc *sc = hw->priv; 3077 struct ath5k_softc *sc = hw->priv;
3064 struct sk_buff *skb = ieee80211_beacon_get(hw, vif); 3078 struct sk_buff *skb;
3079
3080 if (WARN_ON(!vif)) {
3081 ret = -EINVAL;
3082 goto out;
3083 }
3084
3085 skb = ieee80211_beacon_get(hw, vif);
3065 3086
3066 if (!skb) { 3087 if (!skb) {
3067 ret = -ENOMEM; 3088 ret = -ENOMEM;