All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath5k: Use capabilities information for the number of TX queues
@ 2010-12-07  2:08 Bruno Randolf
  2010-12-07 14:01 ` John W. Linville
  0 siblings, 1 reply; 3+ messages in thread
From: Bruno Randolf @ 2010-12-07  2:08 UTC (permalink / raw)
  To: linville; +Cc: ath5k-devel, linux-wireless

One thing I missed in my WME series: Older hardware does not have enough
hardware queues to support WME. In this case we just set up one data queue. Use
the capability information to decide how many queues to set up.

Signed-off-by: Bruno Randolf <br1@einfach.org>

--

resend, seems like it got lost somewhere in a queue ;)
---
 drivers/net/wireless/ath/ath5k/base.c |   65 ++++++++++++++++++++-------------
 drivers/net/wireless/ath/ath5k/qcu.c  |    4 +-
 2 files changed, 41 insertions(+), 28 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 380ff2f..3a09e72 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2799,33 +2799,46 @@ ath5k_init(struct ieee80211_hw *hw)
 		goto err_bhal;
 	}
 
-	/* This order matches mac80211's queue priority, so we can
-	 * directly use the mac80211 queue number without any mapping */
-	txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_VO);
-	if (IS_ERR(txq)) {
-		ATH5K_ERR(sc, "can't setup xmit queue\n");
-		ret = PTR_ERR(txq);
-		goto err_queues;
-	}
-	txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_VI);
-	if (IS_ERR(txq)) {
-		ATH5K_ERR(sc, "can't setup xmit queue\n");
-		ret = PTR_ERR(txq);
-		goto err_queues;
-	}
-	txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_BE);
-	if (IS_ERR(txq)) {
-		ATH5K_ERR(sc, "can't setup xmit queue\n");
-		ret = PTR_ERR(txq);
-		goto err_queues;
-	}
-	txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_BK);
-	if (IS_ERR(txq)) {
-		ATH5K_ERR(sc, "can't setup xmit queue\n");
-		ret = PTR_ERR(txq);
-		goto err_queues;
+	/* 5211 and 5212 usually support 10 queues but we better rely on the
+	 * capability information */
+	if (ah->ah_capabilities.cap_queues.q_tx_num >= 6) {
+		/* This order matches mac80211's queue priority, so we can
+		* directly use the mac80211 queue number without any mapping */
+		txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_VO);
+		if (IS_ERR(txq)) {
+			ATH5K_ERR(sc, "can't setup xmit queue\n");
+			ret = PTR_ERR(txq);
+			goto err_queues;
+		}
+		txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_VI);
+		if (IS_ERR(txq)) {
+			ATH5K_ERR(sc, "can't setup xmit queue\n");
+			ret = PTR_ERR(txq);
+			goto err_queues;
+		}
+		txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_BE);
+		if (IS_ERR(txq)) {
+			ATH5K_ERR(sc, "can't setup xmit queue\n");
+			ret = PTR_ERR(txq);
+			goto err_queues;
+		}
+		txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_BK);
+		if (IS_ERR(txq)) {
+			ATH5K_ERR(sc, "can't setup xmit queue\n");
+			ret = PTR_ERR(txq);
+			goto err_queues;
+		}
+		hw->queues = 4;
+	} else {
+		/* older hardware (5210) can only support one data queue */
+		txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_BE);
+		if (IS_ERR(txq)) {
+			ATH5K_ERR(sc, "can't setup xmit queue\n");
+			ret = PTR_ERR(txq);
+			goto err_queues;
+		}
+		hw->queues = 1;
 	}
-	hw->queues = 4;
 
 	tasklet_init(&sc->rxtq, ath5k_tasklet_rx, (unsigned long)sc);
 	tasklet_init(&sc->txtq, ath5k_tasklet_tx, (unsigned long)sc);
diff --git a/drivers/net/wireless/ath/ath5k/qcu.c b/drivers/net/wireless/ath/ath5k/qcu.c
index 1849eee..2c9c9e7 100644
--- a/drivers/net/wireless/ath/ath5k/qcu.c
+++ b/drivers/net/wireless/ath/ath5k/qcu.c
@@ -152,8 +152,8 @@ int ath5k_hw_setup_tx_queue(struct ath5k_hw *ah, enum ath5k_tx_queue queue_type,
 	/*
 	 * Get queue by type
 	 */
-	/*5210 only has 2 queues*/
-	if (ah->ah_version == AR5K_AR5210) {
+	/* 5210 only has 2 queues */
+	if (ah->ah_capabilities.cap_queues.q_tx_num == 2) {
 		switch (queue_type) {
 		case AR5K_TX_QUEUE_DATA:
 			queue = AR5K_TX_QUEUE_ID_NOQCU_DATA;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ath5k: Use capabilities information for the number of TX queues
  2010-12-07  2:08 [PATCH] ath5k: Use capabilities information for the number of TX queues Bruno Randolf
@ 2010-12-07 14:01 ` John W. Linville
  2010-12-08  1:13   ` Bruno Randolf
  0 siblings, 1 reply; 3+ messages in thread
From: John W. Linville @ 2010-12-07 14:01 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: ath5k-devel, linux-wireless

On Tue, Dec 07, 2010 at 11:08:12AM +0900, Bruno Randolf wrote:
> One thing I missed in my WME series: Older hardware does not have enough
> hardware queues to support WME. In this case we just set up one data queue. Use
> the capability information to decide how many queues to set up.
> 
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> 
> --
> 
> resend, seems like it got lost somewhere in a queue ;)

Did you originally post with a different subject?  The MARC archive
doesn't seem to see any prior posting.

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ath5k: Use capabilities information for the number of TX queues
  2010-12-07 14:01 ` John W. Linville
@ 2010-12-08  1:13   ` Bruno Randolf
  0 siblings, 0 replies; 3+ messages in thread
From: Bruno Randolf @ 2010-12-08  1:13 UTC (permalink / raw)
  To: John W. Linville; +Cc: ath5k-devel, linux-wireless

On Tue December 7 2010 23:01:21 John W. Linville wrote:
> On Tue, Dec 07, 2010 at 11:08:12AM +0900, Bruno Randolf wrote:
> > One thing I missed in my WME series: Older hardware does not have enough
> > hardware queues to support WME. In this case we just set up one data
> > queue. Use the capability information to decide how many queues to set
> > up.
> > 
> > Signed-off-by: Bruno Randolf <br1@einfach.org>
> > 
> > --
> > 
> > resend, seems like it got lost somewhere in a queue ;)
> 
> Did you originally post with a different subject?  The MARC archive
> doesn't seem to see any prior posting.

Sorry, I accidentially posted only to the ath5k lists before. My fault.

bruno

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-08  1:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-07  2:08 [PATCH] ath5k: Use capabilities information for the number of TX queues Bruno Randolf
2010-12-07 14:01 ` John W. Linville
2010-12-08  1:13   ` Bruno Randolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.