ath6kl: Maintain virtual interface in a list
This patch removes all references to ar->vif and takes
vif from a list.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 99e4a49..61a941d 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1628,11 +1628,7 @@
void ath6kl_stop_txrx(struct ath6kl *ar)
{
- struct ath6kl_vif *vif = ar->vif;
- struct net_device *ndev = vif->ndev;
-
- if (!ndev)
- return;
+ struct ath6kl_vif *vif, *tmp_vif;
set_bit(DESTROY_IN_PROGRESS, &ar->flag);
@@ -1641,7 +1637,14 @@
return;
}
- ath6kl_cleanup_vif(ar->vif, test_bit(WMI_READY, &ar->flag));
+ spin_lock(&ar->list_lock);
+ list_for_each_entry_safe(vif, tmp_vif, &ar->vif_list, list) {
+ list_del(&vif->list);
+ spin_unlock(&ar->list_lock);
+ ath6kl_cleanup_vif(vif, test_bit(WMI_READY, &ar->flag));
+ spin_lock(&ar->list_lock);
+ }
+ spin_unlock(&ar->list_lock);
clear_bit(WMI_READY, &ar->flag);