Skip to contentSkip to conversation

ath11k: Remove mac_registered variable

PATCH In review Karthikeyan Periyasamy 2 participants 2 messages Aug 8, 2019 – Aug 12, 2019 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath11k: Remove mac_registered variable

mac_registered is used as a check to avoid the mac register functionality in recovery flow. It can be achieved by check the dev flags. so removed the mac_registered variable.

---
 drivers/net/wireless/ath/ath11k/core.h |  1 -
 drivers/net/wireless/ath/ath11k/mac.c  | 14 +-------------
 drivers/net/wireless/ath/ath11k/wmi.c  |  2 +-
 3 files changed, 2 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +0 -1
index 79134c4..a0d6832 100644
@@ -594,7 +594,6 @@ struct ath11k_base {
 	struct ath11k_ce ce;
 	struct timer_list rx_replenish_retry;
 	struct ath11k_hal hal;
-	bool mac_registered;
 	/* To synchronize core_start/core_stop */
 	struct mutex core_lock;
 	/* Protects data like peers */
drivers/net/wireless/ath/ath11k/mac.c +1 -13
index 8ffdf59..5ecb74a 100644
@@ -360,9 +360,6 @@ struct ath11k_vif *ath11k_mac_get_arvif_by_vdev_id(struct ath11k_base *ab,
 	struct ath11k_pdev *pdev;
 	struct ath11k_vif *arvif;
 
-	if (!ab->mac_registered)
-		return NULL;
-
 	for (i = 0; i < ab->num_radios; i++) {
 		pdev = rcu_dereference(ab->pdevs_active[i]);
 		if (pdev && pdev->ar) {
@@ -381,9 +378,6 @@ struct ath11k *ath11k_mac_get_ar_by_vdev_id(struct ath11k_base *ab, u32 vdev_id)
 	struct ath11k_pdev *pdev;
 	struct ath11k_vif *arvif;
 
-	if (!ab->mac_registered)
-		return NULL;
-
 	for (i = 0; i < ab->num_radios; i++) {
 		pdev = rcu_dereference(ab->pdevs_active[i]);
 		if (pdev && pdev->ar) {
@@ -401,9 +395,6 @@ struct ath11k *ath11k_mac_get_ar_by_pdev_id(struct ath11k_base *ab, u32 pdev_id)
 	int i;
 	struct ath11k_pdev *pdev;
 
-	if (!ab->mac_registered)
-		return NULL;
-
 	if (WARN_ON(pdev_id > ab->num_radios))
 		return NULL;
 
@@ -5373,7 +5364,6 @@ void ath11k_mac_unregister(struct ath11k_base *ab)
 
 		SET_IEEE80211_DEV(ar->hw, NULL);
 	}
-	ab->mac_registered = false;
 }
 
 int ath11k_mac_create(struct ath11k_base *ab)
@@ -5384,7 +5374,7 @@ int ath11k_mac_create(struct ath11k_base *ab)
 	int ret;
 	int i;
 
-	if (ab->mac_registered)
+	if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags))
 		return 0;
 
 	for (i = 0; i < ab->num_radios; i++) {
@@ -5455,8 +5445,6 @@ int ath11k_mac_create(struct ath11k_base *ab)
 	ab->cc_freq_hz = IPQ8074_CC_FREQ_HERTZ;
 	ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS)) - 1;
 
-	ab->mac_registered = true;
-
 	return 0;
 
 err_destroy_mac:
drivers/net/wireless/ath/ath11k/wmi.c +1 -1
index e7a74e0..a9e2d3c 100644
@@ -4398,7 +4398,7 @@ static int ath11k_reg_chan_list_event(struct ath11k_base *ab, struct sk_buff *sk
 	}
 
 	spin_lock(&ab->base_lock);
-	if (ab->mac_registered) {
+	if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) {
 		/* Once mac is registered, ar is valid and all CC events from
 		 * fw is considered to be received due to user requests
 		 * currently.
Signature · 7 lines
1.9.1


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw
Quoted 6 lines · Karthikeyan Periyasamy

mac_registered is used as a check to avoid the mac register functionality in recovery flow. It can be achieved by check the dev flags. so removed the mac_registered variable.

Patch applied to ath11k-bringup branch of ath.git, thanks.

81b27083b2e5 ath11k: Remove mac_registered variable

Signature · 9 lines
https://patchwork.kernel.org/patch/11084135/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k