aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-30 02:06:00 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-30 02:06:00 -0400
commitb171e19ed08c8ba832e5325fadf1be493f56665d (patch)
tree017208f9fcc4ef2cc3fe5cc3f262d2455eda9f61 /drivers/net/wireless/ath5k
parent143b11c03cd42f2284efe5128afc057d8fc86c78 (diff)
parent7c19a3d280297d43ef5ff7c6b205dc208a16d3d1 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: net/mac80211/mlme.c
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r--drivers/net/wireless/ath5k/base.c23
-rw-r--r--drivers/net/wireless/ath5k/base.h1
2 files changed, 18 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index cd598c0d8d6d..bcec74e839e9 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -290,7 +290,7 @@ static inline void ath5k_txbuf_free(struct ath5k_softc *sc,
290 return; 290 return;
291 pci_unmap_single(sc->pdev, bf->skbaddr, bf->skb->len, 291 pci_unmap_single(sc->pdev, bf->skbaddr, bf->skb->len,
292 PCI_DMA_TODEVICE); 292 PCI_DMA_TODEVICE);
293 dev_kfree_skb(bf->skb); 293 dev_kfree_skb_any(bf->skb);
294 bf->skb = NULL; 294 bf->skb = NULL;
295} 295}
296 296
@@ -505,6 +505,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
505 mutex_init(&sc->lock); 505 mutex_init(&sc->lock);
506 spin_lock_init(&sc->rxbuflock); 506 spin_lock_init(&sc->rxbuflock);
507 spin_lock_init(&sc->txbuflock); 507 spin_lock_init(&sc->txbuflock);
508 spin_lock_init(&sc->block);
508 509
509 /* Set private data */ 510 /* Set private data */
510 pci_set_drvdata(pdev, hw); 511 pci_set_drvdata(pdev, hw);
@@ -2123,8 +2124,11 @@ ath5k_beacon_config(struct ath5k_softc *sc)
2123 2124
2124 sc->imask |= AR5K_INT_SWBA; 2125 sc->imask |= AR5K_INT_SWBA;
2125 2126
2126 if (ath5k_hw_hasveol(ah)) 2127 if (ath5k_hw_hasveol(ah)) {
2128 spin_lock(&sc->block);
2127 ath5k_beacon_send(sc); 2129 ath5k_beacon_send(sc);
2130 spin_unlock(&sc->block);
2131 }
2128 } 2132 }
2129 /* TODO else AP */ 2133 /* TODO else AP */
2130 2134
@@ -2324,7 +2328,9 @@ ath5k_intr(int irq, void *dev_id)
2324 TSF_TO_TU(tsf), 2328 TSF_TO_TU(tsf),
2325 (unsigned long long) tsf); 2329 (unsigned long long) tsf);
2326 } else { 2330 } else {
2331 spin_lock(&sc->block);
2327 ath5k_beacon_send(sc); 2332 ath5k_beacon_send(sc);
2333 spin_unlock(&sc->block);
2328 } 2334 }
2329 } 2335 }
2330 if (status & AR5K_INT_RXEOL) { 2336 if (status & AR5K_INT_RXEOL) {
@@ -2685,6 +2691,11 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
2685 ret = -EOPNOTSUPP; 2691 ret = -EOPNOTSUPP;
2686 goto end; 2692 goto end;
2687 } 2693 }
2694
2695 /* Set to a reasonable value. Note that this will
2696 * be set to mac80211's value at ath5k_config(). */
2697 sc->bintval = 1000;
2698
2688 ret = 0; 2699 ret = 0;
2689end: 2700end:
2690 mutex_unlock(&sc->lock); 2701 mutex_unlock(&sc->lock);
@@ -2729,9 +2740,6 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2729 struct ath5k_hw *ah = sc->ah; 2740 struct ath5k_hw *ah = sc->ah;
2730 int ret; 2741 int ret;
2731 2742
2732 /* Set to a reasonable value. Note that this will
2733 * be set to mac80211's value at ath5k_config(). */
2734 sc->bintval = 1000;
2735 mutex_lock(&sc->lock); 2743 mutex_lock(&sc->lock);
2736 if (sc->vif != vif) { 2744 if (sc->vif != vif) {
2737 ret = -EIO; 2745 ret = -EIO;
@@ -2991,6 +2999,7 @@ static int
2991ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) 2999ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
2992{ 3000{
2993 struct ath5k_softc *sc = hw->priv; 3001 struct ath5k_softc *sc = hw->priv;
3002 unsigned long flags;
2994 int ret; 3003 int ret;
2995 3004
2996 ath5k_debug_dump_skb(sc, skb, "BC ", 1); 3005 ath5k_debug_dump_skb(sc, skb, "BC ", 1);
@@ -3000,12 +3009,14 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
3000 goto end; 3009 goto end;
3001 } 3010 }
3002 3011
3012 spin_lock_irqsave(&sc->block, flags);
3003 ath5k_txbuf_free(sc, sc->bbuf); 3013 ath5k_txbuf_free(sc, sc->bbuf);
3004 sc->bbuf->skb = skb; 3014 sc->bbuf->skb = skb;
3005 ret = ath5k_beacon_setup(sc, sc->bbuf); 3015 ret = ath5k_beacon_setup(sc, sc->bbuf);
3006 if (ret) 3016 if (ret)
3007 sc->bbuf->skb = NULL; 3017 sc->bbuf->skb = NULL;
3008 else { 3018 spin_unlock_irqrestore(&sc->block, flags);
3019 if (!ret) {
3009 ath5k_beacon_config(sc); 3020 ath5k_beacon_config(sc);
3010 mmiowb(); 3021 mmiowb();
3011 } 3022 }
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h
index 248e32eb6cb3..1549b63d6138 100644
--- a/drivers/net/wireless/ath5k/base.h
+++ b/drivers/net/wireless/ath5k/base.h
@@ -168,6 +168,7 @@ struct ath5k_softc {
168 struct tasklet_struct txtq; /* tx intr tasklet */ 168 struct tasklet_struct txtq; /* tx intr tasklet */
169 struct ath5k_led tx_led; /* tx led */ 169 struct ath5k_led tx_led; /* tx led */
170 170
171 spinlock_t block; /* protects beacon */
171 struct ath5k_buf *bbuf; /* beacon buffer */ 172 struct ath5k_buf *bbuf; /* beacon buffer */
172 unsigned int bhalq, /* SW q for outgoing beacons */ 173 unsigned int bhalq, /* SW q for outgoing beacons */
173 bmisscount, /* missed beacon transmits */ 174 bmisscount, /* missed beacon transmits */