Skip to contentSkip to conversation

ath9k: fix misc debugfs when not using chan context

PATCH New greearb at candelatech.com 3 participants 4 messages Nov 4, 2014 – Nov 12, 2014 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ath9k: fix misc debugfs when not using chan context

From: Ben Greear <[email protected]>

When channel-context is not enabled, all vifs belong to the first context, but it is not configured as 'assigned'.

Fix misc debugfs file to print out info for non-assigned contexts, and also print whether ctx is assigned or not.

---

This is not overly critical, but fixes regression in 3.17 kernel.

 drivers/net/wireless/ath/ath9k/debug.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/debug.c +4 -3
index 46f20a3..3f6d971 100644
@@ -828,13 +828,14 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
 
 	i = 0;
 	ath_for_each_chanctx(sc, ctx) {
-		if (!ctx->assigned || list_empty(&ctx->vifs))
+		if (list_empty(&ctx->vifs))
 			continue;
 		ath9k_calculate_iter_data(sc, ctx, &iter_data);
 
 		len += scnprintf(buf + len, sizeof(buf) - len,
-			"VIF-COUNTS: CTX %i AP: %i STA: %i MESH: %i WDS: %i",
-			i++, iter_data.naps, iter_data.nstations,
+			"VIFS: CTX %i(%i) AP: %i STA: %i MESH: %i WDS: %i",
+			i++, (int)(ctx->assigned), iter_data.naps,
+			iter_data.nstations,
 			iter_data.nmeshes, iter_data.nwds);
 		len += scnprintf(buf + len, sizeof(buf) - len,
 			" ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n",
Signature · 1 line
1.9.3
#1 lore raw

PATCH 2/2 ath9k: fix regression in bssidmask calculation

From: Ben Greear <[email protected]>

The commit that went into 3.17:

ath9k: Summarize hw state per channel context

Group and set hw state (opmode, primary_sta, beacon conf) per channel context instead of whole list of vifs. This would allow each channel context to run in different mode (STA/AP).

broke multi-vif configuration due to not properly calculating the bssid mask.

The test case that caught this was:

create wlan0 and sta0-4 (6 total), not sure how much that matters. associate all 6 (works fine)
disconnect 5 of them, leaving sta0 up
Start trying to bring up the other 5 one at a time. It will fail, with iw events looking like this (in these logs, several sta are trying to come up, but symptom is the same with just one)

The patch causing the regression made quite a few changes, but the part I think caused this particular problem was not recalculating the bssid mask when adding and removing interfaces.

Re-adding those calls fixes my test case. Fix bad comment as well.

---

This needs to be reviewed by ath9k driver folks that added the original patch, at least.

And, should be considered for 3.17 stable if fix is accepted upstream.

 drivers/net/wireless/ath/ath9k/main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +6 -3
index fbf23ac..d2ad9e95 100644
@@ -947,9 +947,8 @@ void ath9k_calculate_iter_data(struct ath_softc *sc,
 	struct ath_vif *avp;
 
 	/*
-	 * Pick the MAC address of the first interface as the new hardware
-	 * MAC address. The hardware will use it together with the BSSID mask
-	 * when matching addresses.
+	 * The hardware will use primary station addr together with the
+	 * BSSID mask when matching addresses.
 	 */
 	memset(iter_data, 0, sizeof(*iter_data));
 	memset(&iter_data->mask, 0xff, ETH_ALEN);
@@ -1169,6 +1168,8 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
 		list_add_tail(&avp->list, &avp->chanctx->vifs);
 	}
 
+	ath9k_calculate_summary_state(sc, avp->chanctx);
+
 	ath9k_assign_hw_queues(hw, vif);
 
 	an->sc = sc;
@@ -1238,6 +1239,8 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
 
 	ath_tx_node_cleanup(sc, &avp->mcast_node);
 
+	ath9k_calculate_summary_state(sc, avp->chanctx);
+
 	mutex_unlock(&sc->mutex);
 }
 
Signature · 1 line
1.9.3
#2 lore raw

PATCH 2/2 ath9k: fix regression in bssidmask calculation

Quoted 30 lines · greearb at candelatech.com

From: Ben Greear <[email protected]>

The commit that went into 3.17:

ath9k: Summarize hw state per channel context

Group and set hw state (opmode, primary_sta, beacon conf) per channel context instead of whole list of vifs. This would allow each channel context to run in different mode (STA/AP).

broke multi-vif configuration due to not properly calculating the bssid mask.

The test case that caught this was:

create wlan0 and sta0-4 (6 total), not sure how much that matters. associate all 6 (works fine)
disconnect 5 of them, leaving sta0 up
Start trying to bring up the other 5 one at a time. It will fail, with iw events looking like this (in these logs, several sta are trying to come up, but symptom is the same with just one)

The patch causing the regression made quite a few changes, but the part I think caused this particular problem was not recalculating the bssid mask when adding and removing interfaces.

Quoted 8 lines

Re-adding those calls fixes my test case. Fix bad comment as well.

---

This needs to be reviewed by ath9k driver folks that added the original patch, at least.

Any word from the ath9k posse?

Quoted 47 lines

And, should be considered for 3.17 stable if fix is accepted upstream.

 drivers/net/wireless/ath/ath9k/main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +6 -3
index fbf23ac..d2ad9e95 100644
@@ -947,9 +947,8 @@ void ath9k_calculate_iter_data(struct ath_softc *sc,
 	struct ath_vif *avp;
 
 	/*
-	 * Pick the MAC address of the first interface as the new hardware
-	 * MAC address. The hardware will use it together with the BSSID mask
-	 * when matching addresses.
+	 * The hardware will use primary station addr together with the
+	 * BSSID mask when matching addresses.
 	 */
 	memset(iter_data, 0, sizeof(*iter_data));
 	memset(&iter_data->mask, 0xff, ETH_ALEN);
@@ -1169,6 +1168,8 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
 		list_add_tail(&avp->list, &avp->chanctx->vifs);
 	}
 
+	ath9k_calculate_summary_state(sc, avp->chanctx);
+
 	ath9k_assign_hw_queues(hw, vif);
 
 	an->sc = sc;
@@ -1238,6 +1239,8 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
 
 	ath_tx_node_cleanup(sc, &avp->mcast_node);
 
+	ath9k_calculate_summary_state(sc, avp->chanctx);
+
 	mutex_unlock(&sc->mutex);
 }
 
Signature · 6 lines
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
linville at tuxdriver.com			might be all we have.  Be ready.
#3 lore raw

PATCH 2/2 ath9k: fix regression in bssidmask calculation

Quoted 1 line · John W. Linville

Any word from the ath9k posse?

Looks good to me...

Sujith