aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-12-06 21:08:12 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-07 17:07:54 -0500
commit22d8d9f81b8b054df2f7f82daffcb71608f411e4 (patch)
tree445ee23a04aa68cbd3b5b599637ebb39d6bf8a32
parentd7fd1b50a51be3fe6554fbab8953fa8a3ff4009b (diff)
ath5k: Use capabilities information for the number of TX queues
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c65
-rw-r--r--drivers/net/wireless/ath/ath5k/qcu.c4
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 0c419b73f394..bccea7450c38 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2797,33 +2797,46 @@ ath5k_init(struct ieee80211_hw *hw)
2797 goto err_bhal; 2797 goto err_bhal;
2798 } 2798 }
2799 2799
2800 /* This order matches mac80211's queue priority, so we can 2800 /* 5211 and 5212 usually support 10 queues but we better rely on the
2801 * directly use the mac80211 queue number without any mapping */ 2801 * capability information */
2802 txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_VO); 2802 if (ah->ah_capabilities.cap_queues.q_tx_num >= 6) {
2803 if (IS_ERR(txq)) { 2803 /* This order matches mac80211's queue priority, so we can
2804 ATH5K_ERR(sc, "can't setup xmit queue\n"); 2804 * directly use the mac80211 queue number without any mapping */
2805 ret = PTR_ERR(txq); 2805 txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_VO);
2806 goto err_queues; 2806 if (IS_ERR(txq)) {
2807 } 2807 ATH5K_ERR(sc, "can't setup xmit queue\n");
2808 txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_VI); 2808 ret = PTR_ERR(txq);
2809 if (IS_ERR(txq)) { 2809 goto err_queues;
2810 ATH5K_ERR(sc, "can't setup xmit queue\n"); 2810 }
2811 ret = PTR_ERR(txq); 2811 txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_VI);
2812 goto err_queues; 2812 if (IS_ERR(txq)) {
2813 } 2813 ATH5K_ERR(sc, "can't setup xmit queue\n");
2814 txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_BE); 2814 ret = PTR_ERR(txq);
2815 if (IS_ERR(txq)) { 2815 goto err_queues;
2816 ATH5K_ERR(sc, "can't setup xmit queue\n"); 2816 }
2817 ret = PTR_ERR(txq); 2817 txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_BE);
2818 goto err_queues; 2818 if (IS_ERR(txq)) {
2819 } 2819 ATH5K_ERR(sc, "can't setup xmit queue\n");
2820 txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_BK); 2820 ret = PTR_ERR(txq);
2821 if (IS_ERR(txq)) { 2821 goto err_queues;
2822 ATH5K_ERR(sc, "can't setup xmit queue\n"); 2822 }
2823 ret = PTR_ERR(txq); 2823 txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_BK);
2824 goto err_queues; 2824 if (IS_ERR(txq)) {
2825 ATH5K_ERR(sc, "can't setup xmit queue\n");
2826 ret = PTR_ERR(txq);
2827 goto err_queues;
2828 }
2829 hw->queues = 4;
2830 } else {
2831 /* older hardware (5210) can only support one data queue */
2832 txq = ath5k_txq_setup(sc, AR5K_TX_QUEUE_DATA, AR5K_WME_AC_BE);
2833 if (IS_ERR(txq)) {
2834 ATH5K_ERR(sc, "can't setup xmit queue\n");
2835 ret = PTR_ERR(txq);
2836 goto err_queues;
2837 }
2838 hw->queues = 1;
2825 } 2839 }
2826 hw->queues = 4;
2827 2840
2828 tasklet_init(&sc->rxtq, ath5k_tasklet_rx, (unsigned long)sc); 2841 tasklet_init(&sc->rxtq, ath5k_tasklet_rx, (unsigned long)sc);
2829 tasklet_init(&sc->txtq, ath5k_tasklet_tx, (unsigned long)sc); 2842 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 1849eee8235c..2c9c9e793d4e 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,
152 /* 152 /*
153 * Get queue by type 153 * Get queue by type
154 */ 154 */
155 /*5210 only has 2 queues*/ 155 /* 5210 only has 2 queues */
156 if (ah->ah_version == AR5K_AR5210) { 156 if (ah->ah_capabilities.cap_queues.q_tx_num == 2) {
157 switch (queue_type) { 157 switch (queue_type) {
158 case AR5K_TX_QUEUE_DATA: 158 case AR5K_TX_QUEUE_DATA:
159 queue = AR5K_TX_QUEUE_ID_NOQCU_DATA; 159 queue = AR5K_TX_QUEUE_ID_NOQCU_DATA;