diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-11-22 15:28:30 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-22 15:28:30 -0500 |
commit | 840fd8ff64f7b6c9cbfa9b7d0419f015f33303ff (patch) | |
tree | bcdc472c9b794f1d141534c14dcb0dd17015f030 /drivers/net/wireless/iwlwifi/iwl-helpers.h | |
parent | b84a7d3d9e7cd5a25f4fd32142cebdf4481a74a4 (diff) | |
parent | 9e2e7422d059f9b98c3a0810df92a1ff660ade2f (diff) |
Merge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-helpers.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-helpers.h | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h index 92336830415..3f5bedd8875 100644 --- a/drivers/net/wireless/iwlwifi/iwl-helpers.h +++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h | |||
@@ -95,42 +95,36 @@ static inline int iwl_alloc_fw_desc(struct pci_dev *pci_dev, | |||
95 | * | | | | | | | | | 95 | * | | | | | | | | |
96 | * | | | | | | +-+-------- AC queue (0-3) | 96 | * | | | | | | +-+-------- AC queue (0-3) |
97 | * | | | | | | | 97 | * | | | | | | |
98 | * | +-+-+-+-+------------ HW A-MPDU queue | 98 | * | +-+-+-+-+------------ HW queue ID |
99 | * | | 99 | * | |
100 | * +---------------------- indicates agg queue | 100 | * +---------------------- unused |
101 | */ | 101 | */ |
102 | static inline u8 iwl_virtual_agg_queue_num(u8 ac, u8 hwq) | 102 | static inline void iwl_set_swq_id(struct iwl_tx_queue *txq, u8 ac, u8 hwq) |
103 | { | 103 | { |
104 | BUG_ON(ac > 3); /* only have 2 bits */ | 104 | BUG_ON(ac > 3); /* only have 2 bits */ |
105 | BUG_ON(hwq > 31); /* only have 5 bits */ | 105 | BUG_ON(hwq > 31); /* only use 5 bits */ |
106 | 106 | ||
107 | return 0x80 | (hwq << 2) | ac; | 107 | txq->swq_id = (hwq << 2) | ac; |
108 | } | 108 | } |
109 | 109 | ||
110 | static inline void iwl_wake_queue(struct iwl_priv *priv, u8 queue) | 110 | static inline void iwl_wake_queue(struct iwl_priv *priv, |
111 | struct iwl_tx_queue *txq) | ||
111 | { | 112 | { |
112 | u8 ac = queue; | 113 | u8 queue = txq->swq_id; |
113 | u8 hwq = queue; | 114 | u8 ac = queue & 3; |
114 | 115 | u8 hwq = (queue >> 2) & 0x1f; | |
115 | if (queue & 0x80) { | ||
116 | ac = queue & 3; | ||
117 | hwq = (queue >> 2) & 0x1f; | ||
118 | } | ||
119 | 116 | ||
120 | if (test_and_clear_bit(hwq, priv->queue_stopped)) | 117 | if (test_and_clear_bit(hwq, priv->queue_stopped)) |
121 | if (atomic_dec_return(&priv->queue_stop_count[ac]) <= 0) | 118 | if (atomic_dec_return(&priv->queue_stop_count[ac]) <= 0) |
122 | ieee80211_wake_queue(priv->hw, ac); | 119 | ieee80211_wake_queue(priv->hw, ac); |
123 | } | 120 | } |
124 | 121 | ||
125 | static inline void iwl_stop_queue(struct iwl_priv *priv, u8 queue) | 122 | static inline void iwl_stop_queue(struct iwl_priv *priv, |
123 | struct iwl_tx_queue *txq) | ||
126 | { | 124 | { |
127 | u8 ac = queue; | 125 | u8 queue = txq->swq_id; |
128 | u8 hwq = queue; | 126 | u8 ac = queue & 3; |
129 | 127 | u8 hwq = (queue >> 2) & 0x1f; | |
130 | if (queue & 0x80) { | ||
131 | ac = queue & 3; | ||
132 | hwq = (queue >> 2) & 0x1f; | ||
133 | } | ||
134 | 128 | ||
135 | if (!test_and_set_bit(hwq, priv->queue_stopped)) | 129 | if (!test_and_set_bit(hwq, priv->queue_stopped)) |
136 | if (atomic_inc_return(&priv->queue_stop_count[ac]) > 0) | 130 | if (atomic_inc_return(&priv->queue_stop_count[ac]) > 0) |