aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-shared.h
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-11-21 04:07:18 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-12-16 10:22:33 -0500
commiteb9a372a73ea3e2b7e795a7ea03a5b8d92815672 (patch)
tree396d90022f3b304ef10f900a3306b8b616a376af /drivers/net/wireless/iwlwifi/iwl-shared.h
parentaca15f81fffb71e5df8fd72e76ef5f1a3128bd11 (diff)
iwlwifi: don't count the tfds in HW queue any more
Since packets sent to an RA / TID in AGG are sent from a separate HW Tx queue, we may get into a race: the regular queue isn't empty while we already begin to send packets from the AGG queue. This would result in sending packets out of order. In order to cope with this, mac80211 waits until the driver reports that the legacy queue is drained before it can send packets to the AGG queue. During that time, mac80211 buffers packets for the driver. These packets will be sent in order after the driver reports it is ready. The way this was implemented in the driver is as follows: We held a counter that monitors the number of packets for an RA / TID in the HW queues. When this counter reached 0, we knew that the HW queues were drained and we reported to mac80211 that were ready to proceed. This patch changes the implementation described above. We now remember what is the wifi sequence number of the first packet that will be sent in the AGG queue (lets' call it ssn). When we reclaim the packet before ssn, we know that the queue is drained, and we are ready to proceed. This will allow us to move this logic in the upper layer and eventually remove the tid_data from the shared area. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-shared.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-shared.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h
index df6d2123fe4f..8a9690714c13 100644
--- a/drivers/net/wireless/iwlwifi/iwl-shared.h
+++ b/drivers/net/wireless/iwlwifi/iwl-shared.h
@@ -231,12 +231,17 @@ enum iwl_agg_state {
231 * @state: state of the BA agreement establishment / tear down. 231 * @state: state of the BA agreement establishment / tear down.
232 * @txq_id: Tx queue used by the BA session - used by the transport layer. 232 * @txq_id: Tx queue used by the BA session - used by the transport layer.
233 * Needed by the upper layer for debugfs only. 233 * Needed by the upper layer for debugfs only.
234 * @ssn: the first packet to be sent in AGG HW queue in Tx AGG start flow, or
235 * the first packet to be sent in legacy HW queue in Tx AGG stop flow.
236 * Basically when next_reclaimed reaches ssn, we can tell mac80211 that
237 * we are ready to finish the Tx AGG stop / start flow.
234 * @wait_for_ba: Expect block-ack before next Tx reply 238 * @wait_for_ba: Expect block-ack before next Tx reply
235 */ 239 */
236struct iwl_ht_agg { 240struct iwl_ht_agg {
237 u32 rate_n_flags; 241 u32 rate_n_flags;
238 enum iwl_agg_state state; 242 enum iwl_agg_state state;
239 u16 txq_id; 243 u16 txq_id;
244 u16 ssn;
240 bool wait_for_ba; 245 bool wait_for_ba;
241}; 246};
242 247
@@ -246,13 +251,13 @@ struct iwl_ht_agg {
246 * This structs holds the states for each RA / TID. 251 * This structs holds the states for each RA / TID.
247 252
248 * @seq_number: the next WiFi sequence number to use 253 * @seq_number: the next WiFi sequence number to use
249 * @tfds_in_queue: number of packets sent to the HW queues. 254 * @next_reclaimed: the WiFi sequence number of the next packet to be acked.
250 * Exported for debugfs only 255 * This is basically (last acked packet++).
251 * @agg: aggregation state machine 256 * @agg: aggregation state machine
252 */ 257 */
253struct iwl_tid_data { 258struct iwl_tid_data {
254 u16 seq_number; 259 u16 seq_number;
255 u16 tfds_in_queue; 260 u16 next_reclaimed;
256 struct iwl_ht_agg agg; 261 struct iwl_ht_agg agg;
257}; 262};
258 263