aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath5k/base.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index b20a45aa8680..0676c6d84383 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -251,7 +251,7 @@ static inline void ath5k_txbuf_free(struct ath5k_softc *sc,
251 return; 251 return;
252 pci_unmap_single(sc->pdev, bf->skbaddr, bf->skb->len, 252 pci_unmap_single(sc->pdev, bf->skbaddr, bf->skb->len,
253 PCI_DMA_TODEVICE); 253 PCI_DMA_TODEVICE);
254 dev_kfree_skb(bf->skb); 254 dev_kfree_skb_any(bf->skb);
255 bf->skb = NULL; 255 bf->skb = NULL;
256} 256}
257 257
@@ -466,6 +466,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
466 mutex_init(&sc->lock); 466 mutex_init(&sc->lock);
467 spin_lock_init(&sc->rxbuflock); 467 spin_lock_init(&sc->rxbuflock);
468 spin_lock_init(&sc->txbuflock); 468 spin_lock_init(&sc->txbuflock);
469 spin_lock_init(&sc->block);
469 470
470 /* Set private data */ 471 /* Set private data */
471 pci_set_drvdata(pdev, hw); 472 pci_set_drvdata(pdev, hw);
@@ -2179,8 +2180,11 @@ ath5k_beacon_config(struct ath5k_softc *sc)
2179 2180
2180 sc->imask |= AR5K_INT_SWBA; 2181 sc->imask |= AR5K_INT_SWBA;
2181 2182
2182 if (ath5k_hw_hasveol(ah)) 2183 if (ath5k_hw_hasveol(ah)) {
2184 spin_lock(&sc->block);
2183 ath5k_beacon_send(sc); 2185 ath5k_beacon_send(sc);
2186 spin_unlock(&sc->block);
2187 }
2184 } 2188 }
2185 /* TODO else AP */ 2189 /* TODO else AP */
2186 2190
@@ -2403,7 +2407,9 @@ ath5k_intr(int irq, void *dev_id)
2403 TSF_TO_TU(tsf), 2407 TSF_TO_TU(tsf),
2404 (unsigned long long) tsf); 2408 (unsigned long long) tsf);
2405 } else { 2409 } else {
2410 spin_lock(&sc->block);
2406 ath5k_beacon_send(sc); 2411 ath5k_beacon_send(sc);
2412 spin_unlock(&sc->block);
2407 } 2413 }
2408 } 2414 }
2409 if (status & AR5K_INT_RXEOL) { 2415 if (status & AR5K_INT_RXEOL) {
@@ -2745,6 +2751,11 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
2745 ret = -EOPNOTSUPP; 2751 ret = -EOPNOTSUPP;
2746 goto end; 2752 goto end;
2747 } 2753 }
2754
2755 /* Set to a reasonable value. Note that this will
2756 * be set to mac80211's value at ath5k_config(). */
2757 sc->bintval = 1000;
2758
2748 ret = 0; 2759 ret = 0;
2749end: 2760end:
2750 mutex_unlock(&sc->lock); 2761 mutex_unlock(&sc->lock);
@@ -2789,9 +2800,6 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2789 struct ath5k_hw *ah = sc->ah; 2800 struct ath5k_hw *ah = sc->ah;
2790 int ret; 2801 int ret;
2791 2802
2792 /* Set to a reasonable value. Note that this will
2793 * be set to mac80211's value at ath5k_config(). */
2794 sc->bintval = 1000;
2795 mutex_lock(&sc->lock); 2803 mutex_lock(&sc->lock);
2796 if (sc->vif != vif) { 2804 if (sc->vif != vif) {
2797 ret = -EIO; 2805 ret = -EIO;
@@ -3050,6 +3058,7 @@ static int
3050ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) 3058ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
3051{ 3059{
3052 struct ath5k_softc *sc = hw->priv; 3060 struct ath5k_softc *sc = hw->priv;
3061 unsigned long flags;
3053 int ret; 3062 int ret;
3054 3063
3055 ath5k_debug_dump_skb(sc, skb, "BC ", 1); 3064 ath5k_debug_dump_skb(sc, skb, "BC ", 1);
@@ -3059,12 +3068,14 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
3059 goto end; 3068 goto end;
3060 } 3069 }
3061 3070
3071 spin_lock_irqsave(&sc->block, flags);
3062 ath5k_txbuf_free(sc, sc->bbuf); 3072 ath5k_txbuf_free(sc, sc->bbuf);
3063 sc->bbuf->skb = skb; 3073 sc->bbuf->skb = skb;
3064 ret = ath5k_beacon_setup(sc, sc->bbuf); 3074 ret = ath5k_beacon_setup(sc, sc->bbuf);
3065 if (ret) 3075 if (ret)
3066 sc->bbuf->skb = NULL; 3076 sc->bbuf->skb = NULL;
3067 else { 3077 spin_unlock_irqrestore(&sc->block, flags);
3078 if (!ret) {
3068 ath5k_beacon_config(sc); 3079 ath5k_beacon_config(sc);
3069 mmiowb(); 3080 mmiowb();
3070 } 3081 }