aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 24bcdb47a465..7d7fbe0315af 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -593,8 +593,8 @@ int rt2x00queue_clear_beacon(struct rt2x00_dev *rt2x00dev,
593 return 0; 593 return 0;
594} 594}
595 595
596int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev, 596int rt2x00queue_update_beacon_locked(struct rt2x00_dev *rt2x00dev,
597 struct ieee80211_vif *vif) 597 struct ieee80211_vif *vif)
598{ 598{
599 struct rt2x00_intf *intf = vif_to_intf(vif); 599 struct rt2x00_intf *intf = vif_to_intf(vif);
600 struct skb_frame_desc *skbdesc; 600 struct skb_frame_desc *skbdesc;
@@ -603,18 +603,14 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
603 if (unlikely(!intf->beacon)) 603 if (unlikely(!intf->beacon))
604 return -ENOBUFS; 604 return -ENOBUFS;
605 605
606 mutex_lock(&intf->beacon_skb_mutex);
607
608 /* 606 /*
609 * Clean up the beacon skb. 607 * Clean up the beacon skb.
610 */ 608 */
611 rt2x00queue_free_skb(intf->beacon); 609 rt2x00queue_free_skb(intf->beacon);
612 610
613 intf->beacon->skb = ieee80211_beacon_get(rt2x00dev->hw, vif); 611 intf->beacon->skb = ieee80211_beacon_get(rt2x00dev->hw, vif);
614 if (!intf->beacon->skb) { 612 if (!intf->beacon->skb)
615 mutex_unlock(&intf->beacon_skb_mutex);
616 return -ENOMEM; 613 return -ENOMEM;
617 }
618 614
619 /* 615 /*
620 * Copy all TX descriptor information into txdesc, 616 * Copy all TX descriptor information into txdesc,
@@ -635,9 +631,21 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
635 */ 631 */
636 rt2x00dev->ops->lib->write_beacon(intf->beacon, &txdesc); 632 rt2x00dev->ops->lib->write_beacon(intf->beacon, &txdesc);
637 633
634 return 0;
635
636}
637
638int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
639 struct ieee80211_vif *vif)
640{
641 struct rt2x00_intf *intf = vif_to_intf(vif);
642 int ret;
643
644 mutex_lock(&intf->beacon_skb_mutex);
645 ret = rt2x00queue_update_beacon_locked(rt2x00dev, vif);
638 mutex_unlock(&intf->beacon_skb_mutex); 646 mutex_unlock(&intf->beacon_skb_mutex);
639 647
640 return 0; 648 return ret;
641} 649}
642 650
643void rt2x00queue_for_each_entry(struct data_queue *queue, 651void rt2x00queue_for_each_entry(struct data_queue *queue,