diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2014-06-05 07:52:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-06-19 15:49:14 -0400 |
commit | 283dafa1c69475596701da7767df471c0a71d8fb (patch) | |
tree | b6f11ab5c0c8fdb540a3dbadae0593519d37407e | |
parent | 7d8831bb1bfbf8db896bfc1de9d0b3bc7a8e60f0 (diff) |
rt2x00: change beaconing locking
This patch is needed for further changes to keep global variables
consistent when changing beaconing on diffrent vif's.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 21 |
3 files changed, 9 insertions, 25 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 2bde6729f5e6..72e3e8138111 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -141,8 +141,11 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac, | |||
141 | if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) | 141 | if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) |
142 | return; | 142 | return; |
143 | 143 | ||
144 | if (test_and_clear_bit(DELAYED_UPDATE_BEACON, &intf->delayed_flags)) | 144 | if (test_and_clear_bit(DELAYED_UPDATE_BEACON, &intf->delayed_flags)) { |
145 | mutex_lock(&intf->beacon_skb_mutex); | ||
145 | rt2x00queue_update_beacon(rt2x00dev, vif); | 146 | rt2x00queue_update_beacon(rt2x00dev, vif); |
147 | mutex_unlock(&intf->beacon_skb_mutex); | ||
148 | } | ||
146 | } | 149 | } |
147 | 150 | ||
148 | static void rt2x00lib_intf_scheduled(struct work_struct *work) | 151 | static void rt2x00lib_intf_scheduled(struct work_struct *work) |
@@ -216,7 +219,7 @@ static void rt2x00lib_beaconupdate_iter(void *data, u8 *mac, | |||
216 | * never be called for USB devices. | 219 | * never be called for USB devices. |
217 | */ | 220 | */ |
218 | WARN_ON(rt2x00_is_usb(rt2x00dev)); | 221 | WARN_ON(rt2x00_is_usb(rt2x00dev)); |
219 | rt2x00queue_update_beacon_locked(rt2x00dev, vif); | 222 | rt2x00queue_update_beacon(rt2x00dev, vif); |
220 | } | 223 | } |
221 | 224 | ||
222 | void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev) | 225 | void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 671836210744..d63636bbb9d7 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -624,6 +624,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, | |||
624 | * Start/stop beaconing. | 624 | * Start/stop beaconing. |
625 | */ | 625 | */ |
626 | if (changes & BSS_CHANGED_BEACON_ENABLED) { | 626 | if (changes & BSS_CHANGED_BEACON_ENABLED) { |
627 | mutex_lock(&intf->beacon_skb_mutex); | ||
627 | if (!bss_conf->enable_beacon && intf->enable_beacon) { | 628 | if (!bss_conf->enable_beacon && intf->enable_beacon) { |
628 | rt2x00dev->intf_beaconing--; | 629 | rt2x00dev->intf_beaconing--; |
629 | intf->enable_beacon = false; | 630 | intf->enable_beacon = false; |
@@ -639,9 +640,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, | |||
639 | * Last beaconing interface disabled | 640 | * Last beaconing interface disabled |
640 | * -> stop beacon queue. | 641 | * -> stop beacon queue. |
641 | */ | 642 | */ |
642 | mutex_lock(&intf->beacon_skb_mutex); | ||
643 | rt2x00queue_stop_queue(rt2x00dev->bcn); | 643 | rt2x00queue_stop_queue(rt2x00dev->bcn); |
644 | mutex_unlock(&intf->beacon_skb_mutex); | ||
645 | } | 644 | } |
646 | } else if (bss_conf->enable_beacon && !intf->enable_beacon) { | 645 | } else if (bss_conf->enable_beacon && !intf->enable_beacon) { |
647 | rt2x00dev->intf_beaconing++; | 646 | rt2x00dev->intf_beaconing++; |
@@ -658,11 +657,10 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, | |||
658 | * First beaconing interface enabled | 657 | * First beaconing interface enabled |
659 | * -> start beacon queue. | 658 | * -> start beacon queue. |
660 | */ | 659 | */ |
661 | mutex_lock(&intf->beacon_skb_mutex); | ||
662 | rt2x00queue_start_queue(rt2x00dev->bcn); | 660 | rt2x00queue_start_queue(rt2x00dev->bcn); |
663 | mutex_unlock(&intf->beacon_skb_mutex); | ||
664 | } | 661 | } |
665 | } | 662 | } |
663 | mutex_unlock(&intf->beacon_skb_mutex); | ||
666 | } | 664 | } |
667 | 665 | ||
668 | /* | 666 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 5642ccceca7c..8e68f87ab13c 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -754,8 +754,6 @@ int rt2x00queue_clear_beacon(struct rt2x00_dev *rt2x00dev, | |||
754 | if (unlikely(!intf->beacon)) | 754 | if (unlikely(!intf->beacon)) |
755 | return -ENOBUFS; | 755 | return -ENOBUFS; |
756 | 756 | ||
757 | mutex_lock(&intf->beacon_skb_mutex); | ||
758 | |||
759 | /* | 757 | /* |
760 | * Clean up the beacon skb. | 758 | * Clean up the beacon skb. |
761 | */ | 759 | */ |
@@ -768,13 +766,11 @@ int rt2x00queue_clear_beacon(struct rt2x00_dev *rt2x00dev, | |||
768 | if (rt2x00dev->ops->lib->clear_beacon) | 766 | if (rt2x00dev->ops->lib->clear_beacon) |
769 | rt2x00dev->ops->lib->clear_beacon(intf->beacon); | 767 | rt2x00dev->ops->lib->clear_beacon(intf->beacon); |
770 | 768 | ||
771 | mutex_unlock(&intf->beacon_skb_mutex); | ||
772 | |||
773 | return 0; | 769 | return 0; |
774 | } | 770 | } |
775 | 771 | ||
776 | int rt2x00queue_update_beacon_locked(struct rt2x00_dev *rt2x00dev, | 772 | int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev, |
777 | struct ieee80211_vif *vif) | 773 | struct ieee80211_vif *vif) |
778 | { | 774 | { |
779 | struct rt2x00_intf *intf = vif_to_intf(vif); | 775 | struct rt2x00_intf *intf = vif_to_intf(vif); |
780 | struct skb_frame_desc *skbdesc; | 776 | struct skb_frame_desc *skbdesc; |
@@ -815,19 +811,6 @@ int rt2x00queue_update_beacon_locked(struct rt2x00_dev *rt2x00dev, | |||
815 | 811 | ||
816 | } | 812 | } |
817 | 813 | ||
818 | int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev, | ||
819 | struct ieee80211_vif *vif) | ||
820 | { | ||
821 | struct rt2x00_intf *intf = vif_to_intf(vif); | ||
822 | int ret; | ||
823 | |||
824 | mutex_lock(&intf->beacon_skb_mutex); | ||
825 | ret = rt2x00queue_update_beacon_locked(rt2x00dev, vif); | ||
826 | mutex_unlock(&intf->beacon_skb_mutex); | ||
827 | |||
828 | return ret; | ||
829 | } | ||
830 | |||
831 | bool rt2x00queue_for_each_entry(struct data_queue *queue, | 814 | bool rt2x00queue_for_each_entry(struct data_queue *queue, |
832 | enum queue_index start, | 815 | enum queue_index start, |
833 | enum queue_index end, | 816 | enum queue_index end, |