Skip to contentSkip to conversation

ath9k patches

PATCH New Sujith Manoharan 1 participant 6 messages Oct 1, 2014

Subsystems (2)
lore
Share & tools
lore
#3 lore raw

PATCH 3/5 ath9k: Check pending frames properly

In reply to Sujith Manoharan

From: Sujith Manoharan <[email protected]>

There is no need to check if the current
channel context has active ACs queued up
if the TX queue is not empty.

---
 drivers/net/wireless/ath/ath9k/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/main.c +4 -1
index ae7c6ee..84c0cd4 100644
@@ -60,8 +60,10 @@ static bool ath9k_has_pending_frames(struct ath_softc *sc, struct ath_txq *txq)
 
 	spin_lock_bh(&txq->axq_lock);
 
-	if (txq->axq_depth)
+	if (txq->axq_depth) {
 		pending = true;
+		goto out;
+	}
 
 	if (txq->mac80211_qnum >= 0) {
 		struct list_head *list;
@@ -70,6 +72,7 @@ static bool ath9k_has_pending_frames(struct ath_softc *sc, struct ath_txq *txq)
 		if (!list_empty(list))
 			pending = true;
 	}
+out:
 	spin_unlock_bh(&txq->axq_lock);
 	return pending;
 }
Signature · 1 line
2.1.1
#2 lore raw

PATCH 2/5 ath9k: Print RoC expiration

In reply to Sujith Manoharan

From: Sujith Manoharan <[email protected]>

---
 drivers/net/wireless/ath/ath9k/channel.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/wireless/ath/ath9k/channel.c +7 -0
index b93f83c..d088f06 100644
@@ -761,6 +761,13 @@ void ath_offchannel_next(struct ath_softc *sc)
 
 void ath_roc_complete(struct ath_softc *sc, bool abort)
 {
+	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+
+	if (abort)
+		ath_dbg(common, CHAN_CTX, "RoC aborted\n");
+	else
+		ath_dbg(common, CHAN_CTX, "RoC expired\n");
+
 	sc->offchannel.roc_vif = NULL;
 	sc->offchannel.roc_chan = NULL;
 	if (!abort)
Signature · 1 line
2.1.1
#4 lore raw

PATCH 4/5 ath9k: Fix pending frame check

In reply to Sujith Manoharan

From: Sujith Manoharan <[email protected]>

Checking for the queue depth outside of
the TX queue lock is incorrect and in this
case, is not required since it is done inside
ath9k_has_pending_frames().

---
 drivers/net/wireless/ath/ath9k/main.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +0 -3
index 84c0cd4..73a4438 100644
@@ -1974,9 +1974,6 @@ static bool ath9k_has_tx_pending(struct ath_softc *sc)
 		if (!ATH_TXQ_SETUP(sc, i))
 			continue;
 
-		if (!sc->tx.txq[i].axq_depth)
-			continue;
-
 		npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
 		if (npend)
 			break;
Signature · 1 line
2.1.1
#0 lore raw

cover ath9k patches

From: Sujith Manoharan <[email protected]>

For -next.

Sujith Manoharan (5):
ath: Add support for tracing
ath9k: Print RoC expiration
ath9k: Check pending frames properly
ath9k: Fix pending frame check
ath9k: Remove duplicate code

 drivers/net/wireless/ath/Kconfig         |  8 ++++
 drivers/net/wireless/ath/Makefile        |  4 ++
 drivers/net/wireless/ath/ath.h           |  1 +
 drivers/net/wireless/ath/ath9k/channel.c |  7 ++++
 drivers/net/wireless/ath/ath9k/main.c    | 18 +++-----
 drivers/net/wireless/ath/main.c          |  3 ++
 drivers/net/wireless/ath/trace.c         | 20 +++++++++
 drivers/net/wireless/ath/trace.h         | 71 ++++++++++++++++++++++++++++++++
 8 files changed, 119 insertions(+), 13 deletions(-)
 create mode 100644 drivers/net/wireless/ath/trace.c
 create mode 100644 drivers/net/wireless/ath/trace.h
Signature · 1 line
2.1.1
#1 lore raw

PATCH 1/5 ath: Add support for tracing

From: Sujith Manoharan <[email protected]>

---
 drivers/net/wireless/ath/Kconfig  |  8 +++++
 drivers/net/wireless/ath/Makefile |  4 +++
 drivers/net/wireless/ath/ath.h    |  1 +
 drivers/net/wireless/ath/main.c   |  3 ++
 drivers/net/wireless/ath/trace.c  | 20 +++++++++++
 drivers/net/wireless/ath/trace.h  | 71 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 107 insertions(+)
 create mode 100644 drivers/net/wireless/ath/trace.c
 create mode 100644 drivers/net/wireless/ath/trace.h
drivers/net/wireless/ath/Kconfig +8 -0
index c63d115..ce78260 100644
@@ -25,6 +25,14 @@ config ATH_DEBUG
 	  Say Y, if you want to debug atheros wireless drivers.
 	  Right now only ath9k makes use of this.
 
+config ATH_TRACEPOINTS
+       bool "Atheros wireless tracing"
+       depends on ATH_DEBUG
+       depends on EVENT_TRACING
+       ---help---
+         This option enables tracepoints for atheros wireless drivers.
+	 Currently, ath9k makes use of this facility.
+
 config ATH_REG_DYNAMIC_USER_REG_HINTS
 	bool "Atheros dynamic user regulatory hints"
 	depends on CFG80211_CERTIFICATION_ONUS
drivers/net/wireless/ath/Makefile +4 -0
index 7d023b0..89f8d59 100644
@@ -17,4 +17,8 @@ ath-objs :=	main.o \
 		dfs_pri_detector.o
 
 ath-$(CONFIG_ATH_DEBUG) += debug.o
+ath-$(CONFIG_ATH_TRACEPOINTS) += trace.o
+
 ccflags-y += -D__CHECK_ENDIAN__
+
+CFLAGS_trace.o := -I$(src)
drivers/net/wireless/ath/ath.h +1 -0
index a3b6e27..e5ba6fa 100644
@@ -268,6 +268,7 @@ enum ATH_DEBUG {
 };
 
 #define ATH_DBG_DEFAULT (ATH_DBG_FATAL)
+#define ATH_DBG_MAX_LEN 512
 
 #ifdef CONFIG_ATH_DEBUG
 
drivers/net/wireless/ath/main.c +3 -0
index 8b0ac14..83f47af 100644
@@ -20,6 +20,7 @@
 #include <linux/module.h>
 
 #include "ath.h"
+#include "trace.h"
 
 MODULE_AUTHOR("Atheros Communications");
 MODULE_DESCRIPTION("Shared library for Atheros wireless LAN cards.");
@@ -84,6 +85,8 @@ void ath_printk(const char *level, const struct ath_common* common,
 	else
 		printk("%sath: %pV", level, &vaf);
 
+	trace_ath_log(common->hw->wiphy, &vaf);
+
 	va_end(args);
 }
 EXPORT_SYMBOL(ath_printk);
drivers/net/wireless/ath/trace.c new file +20 -0
new file mode 100644
index 0000000..18fb3a0
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2014 Qualcomm Atheros, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <linux/module.h>
+
+#define CREATE_TRACE_POINTS
+#include "trace.h"
drivers/net/wireless/ath/trace.h new file +71 -0

71 lines not on this page · raw message

Signature · 1 line
2.1.1
#5 lore raw

PATCH 5/5 ath9k: Remove duplicate code

In reply to Sujith Manoharan

From: Sujith Manoharan <[email protected]>

ath9k_has_tx_pending() can be used to
check if there are pending frames instead
of having duplicate code.

---
 drivers/net/wireless/ath/ath9k/main.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +1 -9
index 73a4438..65ca7ac 100644
@@ -2039,16 +2039,8 @@ void __ath9k_flush(struct ieee80211_hw *hw, u32 queues, bool drop)
 static bool ath9k_tx_frames_pending(struct ieee80211_hw *hw)
 {
 	struct ath_softc *sc = hw->priv;
-	int i;
-
-	for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
-		if (!ATH_TXQ_SETUP(sc, i))
-			continue;
 
-		if (ath9k_has_pending_frames(sc, &sc->tx.txq[i]))
-			return true;
-	}
-	return false;
+	return ath9k_has_tx_pending(sc);
 }
 
 static int ath9k_tx_last_beacon(struct ieee80211_hw *hw)
Signature · 1 line
2.1.1