diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2011-03-03 13:42:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-04 14:06:47 -0500 |
commit | 26a1d07f4176099a7b6f45009dad054e6ad5b7e4 (patch) | |
tree | 432cabdfd4ffb4dcdd6121e4898598e2a5be842e /drivers/net/wireless/rt2x00/rt2x00ht.c | |
parent | 7fe7ee77765161217f60ec9facabd9d2b38d98fe (diff) |
rt2x00: Optimize TX descriptor handling
HT and no-HT rt2x00 devices use a partly different TX descriptor.
Optimize the tx desciptor memory layout by putting the PLCP and HT
substructs into a union and introduce a new driver flag to decide which
TX desciptor format is used by the device.
This saves us the expensive PLCP calculation fOr HT devices and the HT
descriptor setup on no-HT devices.
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@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 | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00ht.c b/drivers/net/wireless/rt2x00/rt2x00ht.c index 03d9579da681..78a0e7386a78 100644 --- a/drivers/net/wireless/rt2x00/rt2x00ht.c +++ b/drivers/net/wireless/rt2x00/rt2x00ht.c | |||
@@ -38,12 +38,12 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, | |||
38 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; | 38 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; |
39 | 39 | ||
40 | if (tx_info->control.sta) | 40 | if (tx_info->control.sta) |
41 | txdesc->mpdu_density = | 41 | txdesc->u.ht.mpdu_density = |
42 | tx_info->control.sta->ht_cap.ampdu_density; | 42 | tx_info->control.sta->ht_cap.ampdu_density; |
43 | 43 | ||
44 | txdesc->ba_size = 7; /* FIXME: What value is needed? */ | 44 | txdesc->u.ht.ba_size = 7; /* FIXME: What value is needed? */ |
45 | 45 | ||
46 | txdesc->stbc = | 46 | txdesc->u.ht.stbc = |
47 | (tx_info->flags & IEEE80211_TX_CTL_STBC) >> IEEE80211_TX_CTL_STBC_SHIFT; | 47 | (tx_info->flags & IEEE80211_TX_CTL_STBC) >> IEEE80211_TX_CTL_STBC_SHIFT; |
48 | 48 | ||
49 | /* | 49 | /* |
@@ -51,22 +51,22 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, | |||
51 | * mcs rate to be used | 51 | * mcs rate to be used |
52 | */ | 52 | */ |
53 | if (txrate->flags & IEEE80211_TX_RC_MCS) { | 53 | if (txrate->flags & IEEE80211_TX_RC_MCS) { |
54 | txdesc->mcs = txrate->idx; | 54 | txdesc->u.ht.mcs = txrate->idx; |
55 | 55 | ||
56 | /* | 56 | /* |
57 | * MIMO PS should be set to 1 for STA's using dynamic SM PS | 57 | * MIMO PS should be set to 1 for STA's using dynamic SM PS |
58 | * when using more then one tx stream (>MCS7). | 58 | * when using more then one tx stream (>MCS7). |
59 | */ | 59 | */ |
60 | if (tx_info->control.sta && txdesc->mcs > 7 && | 60 | if (tx_info->control.sta && txdesc->u.ht.mcs > 7 && |
61 | ((tx_info->control.sta->ht_cap.cap & | 61 | ((tx_info->control.sta->ht_cap.cap & |
62 | IEEE80211_HT_CAP_SM_PS) >> | 62 | IEEE80211_HT_CAP_SM_PS) >> |
63 | IEEE80211_HT_CAP_SM_PS_SHIFT) == | 63 | IEEE80211_HT_CAP_SM_PS_SHIFT) == |
64 | WLAN_HT_CAP_SM_PS_DYNAMIC) | 64 | WLAN_HT_CAP_SM_PS_DYNAMIC) |
65 | __set_bit(ENTRY_TXD_HT_MIMO_PS, &txdesc->flags); | 65 | __set_bit(ENTRY_TXD_HT_MIMO_PS, &txdesc->flags); |
66 | } else { | 66 | } else { |
67 | txdesc->mcs = rt2x00_get_rate_mcs(hwrate->mcs); | 67 | txdesc->u.ht.mcs = rt2x00_get_rate_mcs(hwrate->mcs); |
68 | if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) | 68 | if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) |
69 | txdesc->mcs |= 0x08; | 69 | txdesc->u.ht.mcs |= 0x08; |
70 | } | 70 | } |
71 | 71 | ||
72 | /* | 72 | /* |
@@ -105,11 +105,11 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, | |||
105 | * for frames not transmitted with TXOP_HTTXOP | 105 | * for frames not transmitted with TXOP_HTTXOP |
106 | */ | 106 | */ |
107 | if (ieee80211_is_mgmt(hdr->frame_control)) | 107 | if (ieee80211_is_mgmt(hdr->frame_control)) |
108 | txdesc->txop = TXOP_BACKOFF; | 108 | txdesc->u.ht.txop = TXOP_BACKOFF; |
109 | else if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)) | 109 | else if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)) |
110 | txdesc->txop = TXOP_SIFS; | 110 | txdesc->u.ht.txop = TXOP_SIFS; |
111 | else | 111 | else |
112 | txdesc->txop = TXOP_HTTXOP; | 112 | txdesc->u.ht.txop = TXOP_HTTXOP; |
113 | } | 113 | } |
114 | 114 | ||
115 | u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev, | 115 | u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev, |