aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.c
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2011-03-03 13:42:35 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-03-04 14:06:47 -0500
commit26a1d07f4176099a7b6f45009dad054e6ad5b7e4 (patch)
tree432cabdfd4ffb4dcdd6121e4898598e2a5be842e /drivers/net/wireless/rt2x00/rt2x00queue.c
parent7fe7ee77765161217f60ec9facabd9d2b38d98fe (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/rt2x00queue.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index eebb564ee4da..7816c1c39d6e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -270,12 +270,12 @@ static void rt2x00queue_create_tx_descriptor_plcp(struct queue_entry *entry,
270 * PLCP setup 270 * PLCP setup
271 * Length calculation depends on OFDM/CCK rate. 271 * Length calculation depends on OFDM/CCK rate.
272 */ 272 */
273 txdesc->signal = hwrate->plcp; 273 txdesc->u.plcp.signal = hwrate->plcp;
274 txdesc->service = 0x04; 274 txdesc->u.plcp.service = 0x04;
275 275
276 if (hwrate->flags & DEV_RATE_OFDM) { 276 if (hwrate->flags & DEV_RATE_OFDM) {
277 txdesc->length_high = (data_length >> 6) & 0x3f; 277 txdesc->u.plcp.length_high = (data_length >> 6) & 0x3f;
278 txdesc->length_low = data_length & 0x3f; 278 txdesc->u.plcp.length_low = data_length & 0x3f;
279 } else { 279 } else {
280 /* 280 /*
281 * Convert length to microseconds. 281 * Convert length to microseconds.
@@ -290,18 +290,18 @@ static void rt2x00queue_create_tx_descriptor_plcp(struct queue_entry *entry,
290 * Check if we need to set the Length Extension 290 * Check if we need to set the Length Extension
291 */ 291 */
292 if (hwrate->bitrate == 110 && residual <= 30) 292 if (hwrate->bitrate == 110 && residual <= 30)
293 txdesc->service |= 0x80; 293 txdesc->u.plcp.service |= 0x80;
294 } 294 }
295 295
296 txdesc->length_high = (duration >> 8) & 0xff; 296 txdesc->u.plcp.length_high = (duration >> 8) & 0xff;
297 txdesc->length_low = duration & 0xff; 297 txdesc->u.plcp.length_low = duration & 0xff;
298 298
299 /* 299 /*
300 * When preamble is enabled we should set the 300 * When preamble is enabled we should set the
301 * preamble bit for the signal. 301 * preamble bit for the signal.
302 */ 302 */
303 if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) 303 if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
304 txdesc->signal |= 0x08; 304 txdesc->u.plcp.signal |= 0x08;
305 } 305 }
306} 306}
307 307
@@ -397,9 +397,12 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
397 * Apply TX descriptor handling by components 397 * Apply TX descriptor handling by components
398 */ 398 */
399 rt2x00crypto_create_tx_descriptor(entry, txdesc); 399 rt2x00crypto_create_tx_descriptor(entry, txdesc);
400 rt2x00ht_create_tx_descriptor(entry, txdesc, hwrate);
401 rt2x00queue_create_tx_descriptor_seq(entry, txdesc); 400 rt2x00queue_create_tx_descriptor_seq(entry, txdesc);
402 rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate); 401
402 if (test_bit(DRIVER_REQUIRE_HT_TX_DESC, &rt2x00dev->flags))
403 rt2x00ht_create_tx_descriptor(entry, txdesc, hwrate);
404 else
405 rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate);
403} 406}
404 407
405static int rt2x00queue_write_tx_data(struct queue_entry *entry, 408static int rt2x00queue_write_tx_data(struct queue_entry *entry,