aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-03-05 14:24:44 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-03-06 15:16:14 -0500
commit70a18c5d57998433d9f4de058a5286fbd16ed839 (patch)
treee800a535fb72e5a0e5e2ade612c82eb50fe28d26
parent930dfd5f20eba2cef41cdb2db04108b359b97594 (diff)
iwlwifi: move tid_to_ac to PCI-E
Currently, queue mapping is handled in the transport. This may change, but until then the code for it can be close to where it's used rather than in iwl-shared.h. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-shared.h46
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c46
2 files changed, 46 insertions, 46 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h
index 2b9d21a7207d..740a058b22ee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-shared.h
+++ b/drivers/net/wireless/iwlwifi/iwl-shared.h
@@ -412,52 +412,6 @@ static inline bool iwl_have_debug_level(u32 level)
412 return iwlagn_mod_params.debug_level & level; 412 return iwlagn_mod_params.debug_level & level;
413} 413}
414 414
415/*
416 * mac80211 queues, ACs, hardware queues, FIFOs.
417 *
418 * Cf. http://wireless.kernel.org/en/developers/Documentation/mac80211/queues
419 *
420 * Mac80211 uses the following numbers, which we get as from it
421 * by way of skb_get_queue_mapping(skb):
422 *
423 * VO 0
424 * VI 1
425 * BE 2
426 * BK 3
427 *
428 *
429 * Regular (not A-MPDU) frames are put into hardware queues corresponding
430 * to the FIFOs, see comments in iwl-prph.h. Aggregated frames get their
431 * own queue per aggregation session (RA/TID combination), such queues are
432 * set up to map into FIFOs too, for which we need an AC->FIFO mapping. In
433 * order to map frames to the right queue, we also need an AC->hw queue
434 * mapping. This is implemented here.
435 *
436 * Due to the way hw queues are set up (by the hw specific modules like
437 * iwl-4965.c, iwl-5000.c etc.), the AC->hw queue mapping is the identity
438 * mapping.
439 */
440
441static const u8 tid_to_ac[] = {
442 IEEE80211_AC_BE,
443 IEEE80211_AC_BK,
444 IEEE80211_AC_BK,
445 IEEE80211_AC_BE,
446 IEEE80211_AC_VI,
447 IEEE80211_AC_VI,
448 IEEE80211_AC_VO,
449 IEEE80211_AC_VO
450};
451
452static inline int get_ac_from_tid(u16 tid)
453{
454 if (likely(tid < ARRAY_SIZE(tid_to_ac)))
455 return tid_to_ac[tid];
456
457 /* no support for TIDs 8-15 yet */
458 return -EINVAL;
459}
460
461enum iwl_rxon_context_id { 415enum iwl_rxon_context_id {
462 IWL_RXON_CTX_BSS, 416 IWL_RXON_CTX_BSS,
463 IWL_RXON_CTX_PAN, 417 IWL_RXON_CTX_PAN,
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
index 0513b90da040..0164154f9c97 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
@@ -41,6 +41,43 @@
41#define IWL_TX_CRC_SIZE 4 41#define IWL_TX_CRC_SIZE 4
42#define IWL_TX_DELIMITER_SIZE 4 42#define IWL_TX_DELIMITER_SIZE 4
43 43
44/*
45 * mac80211 queues, ACs, hardware queues, FIFOs.
46 *
47 * Cf. http://wireless.kernel.org/en/developers/Documentation/mac80211/queues
48 *
49 * Mac80211 uses the following numbers, which we get as from it
50 * by way of skb_get_queue_mapping(skb):
51 *
52 * VO 0
53 * VI 1
54 * BE 2
55 * BK 3
56 *
57 *
58 * Regular (not A-MPDU) frames are put into hardware queues corresponding
59 * to the FIFOs, see comments in iwl-prph.h. Aggregated frames get their
60 * own queue per aggregation session (RA/TID combination), such queues are
61 * set up to map into FIFOs too, for which we need an AC->FIFO mapping. In
62 * order to map frames to the right queue, we also need an AC->hw queue
63 * mapping. This is implemented here.
64 *
65 * Due to the way hw queues are set up (by the hw specific code), the AC->hw
66 * queue mapping is the identity mapping.
67 */
68
69static const u8 tid_to_ac[] = {
70 IEEE80211_AC_BE,
71 IEEE80211_AC_BK,
72 IEEE80211_AC_BK,
73 IEEE80211_AC_BE,
74 IEEE80211_AC_VI,
75 IEEE80211_AC_VI,
76 IEEE80211_AC_VO,
77 IEEE80211_AC_VO
78};
79
80
44/** 81/**
45 * iwl_trans_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array 82 * iwl_trans_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array
46 */ 83 */
@@ -442,6 +479,15 @@ void iwl_trans_tx_queue_set_status(struct iwl_trans *trans,
442 scd_retry ? "BA" : "AC/CMD", txq_id); 479 scd_retry ? "BA" : "AC/CMD", txq_id);
443} 480}
444 481
482static inline int get_ac_from_tid(u16 tid)
483{
484 if (likely(tid < ARRAY_SIZE(tid_to_ac)))
485 return tid_to_ac[tid];
486
487 /* no support for TIDs 8-15 yet */
488 return -EINVAL;
489}
490
445static inline int get_fifo_from_tid(struct iwl_trans_pcie *trans_pcie, 491static inline int get_fifo_from_tid(struct iwl_trans_pcie *trans_pcie,
446 u8 ctx, u16 tid) 492 u8 ctx, u16 tid)
447{ 493{