ath10k: track vif list internally
authorMichal Kazior <michal.kazior@tieto.com>
Wed, 16 Oct 2013 12:44:45 +0000 (15:44 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 16 Oct 2013 12:44:45 +0000 (15:44 +0300)
mac80211 interface interations functions have
peculiar locking issues. This patch introduces
internal (to ath10k) vif list that will be used
for vif iteration purposes.

kvalo: remove extra INIT_LIST_HEAD()

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/mac.c

index c5561a935bbb011c49a0dc2281d50362dc47d0b2..1129994fb10505864c57e1025d95cec8aa009093 100644 (file)
@@ -824,6 +824,7 @@ int ath10k_core_start(struct ath10k *ar)
                goto err_disconnect_htc;
 
        ar->free_vdev_map = (1 << TARGET_NUM_VDEVS) - 1;
+       INIT_LIST_HEAD(&ar->arvifs);
 
        return 0;
 
index cef5455853c5e16e55ad1757d18bea54f17b04c0..0934f7633de399df82df8ab74a9e0f6ef64f5b82 100644 (file)
@@ -205,6 +205,8 @@ struct ath10k_peer {
 #define ATH10K_VDEV_SETUP_TIMEOUT_HZ (5*HZ)
 
 struct ath10k_vif {
+       struct list_head list;
+
        u32 vdev_id;
        enum wmi_vdev_type vdev_type;
        enum wmi_vdev_subtype vdev_subtype;
@@ -404,6 +406,7 @@ struct ath10k {
        /* protects shared structure data */
        spinlock_t data_lock;
 
+       struct list_head arvifs;
        struct list_head peers;
        wait_queue_head_t peer_mapping_wq;
 
index 16e55bd22fc2f8359efe3b1ce49edc0d05ee51ef..c8e4180e8c30b4fa4b994f8fe2611505592961b1 100644 (file)
@@ -2093,6 +2093,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
        }
 
        ar->free_vdev_map &= ~BIT(arvif->vdev_id);
+       list_add(&arvif->list, &ar->arvifs);
 
        vdev_param = ar->wmi.vdev_param->def_keyid;
        ret = ath10k_wmi_vdev_set_param(ar, 0, vdev_param,
@@ -2175,6 +2176,7 @@ err_peer_delete:
 err_vdev_delete:
        ath10k_wmi_vdev_delete(ar, arvif->vdev_id);
        ar->free_vdev_map &= ~BIT(arvif->vdev_id);
+       list_del(&arvif->list);
 
 err:
        mutex_unlock(&ar->conf_mutex);
@@ -2201,6 +2203,7 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw,
        spin_unlock_bh(&ar->data_lock);
 
        ar->free_vdev_map |= 1 << (arvif->vdev_id);
+       list_del(&arvif->list);
 
        if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
                ret = ath10k_peer_delete(arvif->ar, arvif->vdev_id, vif->addr);