diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2010-05-07 05:03:08 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-05-07 14:57:21 -0400 |
commit | 1affa091975e47d50ce6a88e9b1abfe717c2fe27 (patch) | |
tree | f278fcbf35ea04e619de3d07ac1234d174f9c943 /drivers/net/wireless/rt2x00/rt2x00ht.c | |
parent | cbd1ea87a198669537591cef9ee834d6986c169b (diff) |
rt2x00: rt2800: use correct txop value in tx descriptor
rt2800 devices use a different enumeration to specify what IFS values should
be used on frame transmission compared to the other rt2x00 devices. Hence,
create a new enum called txop that contains the valid values.
Furthermore use the appropriate txop values as found in the ralink drivers:
- TXOP_BACKOFF for management frames
- TXOP_SIFS for subsequent fragments in a burst
- TXOP_HTTXOP for all data frames
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00ht.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00ht.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00ht.c b/drivers/net/wireless/rt2x00/rt2x00ht.c index 1056c92143a..5a407602ce3 100644 --- a/drivers/net/wireless/rt2x00/rt2x00ht.c +++ b/drivers/net/wireless/rt2x00/rt2x00ht.c | |||
@@ -35,6 +35,7 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, | |||
35 | { | 35 | { |
36 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); | 36 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); |
37 | struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; | 37 | struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; |
38 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; | ||
38 | 39 | ||
39 | if (tx_info->control.sta) | 40 | if (tx_info->control.sta) |
40 | txdesc->mpdu_density = | 41 | txdesc->mpdu_density = |
@@ -66,4 +67,20 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, | |||
66 | __set_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags); | 67 | __set_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags); |
67 | if (txrate->flags & IEEE80211_TX_RC_SHORT_GI) | 68 | if (txrate->flags & IEEE80211_TX_RC_SHORT_GI) |
68 | __set_bit(ENTRY_TXD_HT_SHORT_GI, &txdesc->flags); | 69 | __set_bit(ENTRY_TXD_HT_SHORT_GI, &txdesc->flags); |
70 | |||
71 | /* | ||
72 | * Determine IFS values | ||
73 | * - Use TXOP_BACKOFF for management frames | ||
74 | * - Use TXOP_SIFS for fragment bursts | ||
75 | * - Use TXOP_HTTXOP for everything else | ||
76 | * | ||
77 | * Note: rt2800 devices won't use CTS protection (if used) | ||
78 | * for frames not transmitted with TXOP_HTTXOP | ||
79 | */ | ||
80 | if (ieee80211_is_mgmt(hdr->frame_control)) | ||
81 | txdesc->txop = TXOP_BACKOFF; | ||
82 | else if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)) | ||
83 | txdesc->txop = TXOP_SIFS; | ||
84 | else | ||
85 | txdesc->txop = TXOP_HTTXOP; | ||
69 | } | 86 | } |