diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2010-05-11 17:51:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-05-12 16:41:44 -0400 |
commit | e01f1ec35ff91c8a3f4a3e48a0c8ab476124b973 (patch) | |
tree | 495949f825157e5dc00694856e35eaa83afe0bb0 /drivers/net/wireless/rt2x00/rt73usb.c | |
parent | 6b97cb04f2766513c57b57f8ac4b44915296230f (diff) |
rt2x00: Re-order tx descriptor writing code in drivers.
Where possible, write the tx descriptor words from start to end, to
follow a logical ordering of words.
Where this is not possible (in rt2400pci, rt2500pci and rt61pci) add
a comment as to why word 0 needs to be written last.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 81f6db1b16f2..fa40d434e729 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1446,6 +1446,32 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1446 | /* | 1446 | /* |
1447 | * Start writing the descriptor words. | 1447 | * Start writing the descriptor words. |
1448 | */ | 1448 | */ |
1449 | rt2x00_desc_read(txd, 0, &word); | ||
1450 | rt2x00_set_field32(&word, TXD_W0_BURST, | ||
1451 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | ||
1452 | rt2x00_set_field32(&word, TXD_W0_VALID, 1); | ||
1453 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | ||
1454 | test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | ||
1455 | rt2x00_set_field32(&word, TXD_W0_ACK, | ||
1456 | test_bit(ENTRY_TXD_ACK, &txdesc->flags)); | ||
1457 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | ||
1458 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags)); | ||
1459 | rt2x00_set_field32(&word, TXD_W0_OFDM, | ||
1460 | (txdesc->rate_mode == RATE_MODE_OFDM)); | ||
1461 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | ||
1462 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, | ||
1463 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); | ||
1464 | rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, | ||
1465 | test_bit(ENTRY_TXD_ENCRYPT_MMIC, &txdesc->flags)); | ||
1466 | rt2x00_set_field32(&word, TXD_W0_KEY_TABLE, | ||
1467 | test_bit(ENTRY_TXD_ENCRYPT_PAIRWISE, &txdesc->flags)); | ||
1468 | rt2x00_set_field32(&word, TXD_W0_KEY_INDEX, txdesc->key_idx); | ||
1469 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); | ||
1470 | rt2x00_set_field32(&word, TXD_W0_BURST2, | ||
1471 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | ||
1472 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher); | ||
1473 | rt2x00_desc_write(txd, 0, word); | ||
1474 | |||
1449 | rt2x00_desc_read(txd, 1, &word); | 1475 | rt2x00_desc_read(txd, 1, &word); |
1450 | rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, txdesc->queue); | 1476 | rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, txdesc->queue); |
1451 | rt2x00_set_field32(&word, TXD_W1_AIFSN, txdesc->aifs); | 1477 | rt2x00_set_field32(&word, TXD_W1_AIFSN, txdesc->aifs); |
@@ -1473,32 +1499,6 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1473 | TXPOWER_TO_DEV(rt2x00dev->tx_power)); | 1499 | TXPOWER_TO_DEV(rt2x00dev->tx_power)); |
1474 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); | 1500 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); |
1475 | rt2x00_desc_write(txd, 5, word); | 1501 | rt2x00_desc_write(txd, 5, word); |
1476 | |||
1477 | rt2x00_desc_read(txd, 0, &word); | ||
1478 | rt2x00_set_field32(&word, TXD_W0_BURST, | ||
1479 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | ||
1480 | rt2x00_set_field32(&word, TXD_W0_VALID, 1); | ||
1481 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | ||
1482 | test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | ||
1483 | rt2x00_set_field32(&word, TXD_W0_ACK, | ||
1484 | test_bit(ENTRY_TXD_ACK, &txdesc->flags)); | ||
1485 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | ||
1486 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags)); | ||
1487 | rt2x00_set_field32(&word, TXD_W0_OFDM, | ||
1488 | (txdesc->rate_mode == RATE_MODE_OFDM)); | ||
1489 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | ||
1490 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, | ||
1491 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); | ||
1492 | rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, | ||
1493 | test_bit(ENTRY_TXD_ENCRYPT_MMIC, &txdesc->flags)); | ||
1494 | rt2x00_set_field32(&word, TXD_W0_KEY_TABLE, | ||
1495 | test_bit(ENTRY_TXD_ENCRYPT_PAIRWISE, &txdesc->flags)); | ||
1496 | rt2x00_set_field32(&word, TXD_W0_KEY_INDEX, txdesc->key_idx); | ||
1497 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); | ||
1498 | rt2x00_set_field32(&word, TXD_W0_BURST2, | ||
1499 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | ||
1500 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher); | ||
1501 | rt2x00_desc_write(txd, 0, word); | ||
1502 | } | 1502 | } |
1503 | 1503 | ||
1504 | /* | 1504 | /* |