Commit b9b23872 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Kalle Valo

rt2x00: convert rt2x00_desc_read return type

This is a semi-automated conversion to change rt2x00_desc_read to return
the register contents instead of passing them by value, resulting in
much better object code. The majority of the patch was done using:

sed -i 's:\(\<rt2x00_desc_read\>(.*, .*\), &\(.*\));:\2 = \1);:' \
    -i 's:\(\<_rt2x00_desc_read\>(.*, .*\), &\(.*\));:\2 = \1);:' \
drivers/net/wireless/ralink/rt2x00/rt*
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 5c6a2585
...@@ -728,11 +728,11 @@ static bool rt2400pci_get_entry_state(struct queue_entry *entry) ...@@ -728,11 +728,11 @@ static bool rt2400pci_get_entry_state(struct queue_entry *entry)
u32 word; u32 word;
if (entry->queue->qid == QID_RX) { if (entry->queue->qid == QID_RX) {
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
return rt2x00_get_field32(word, RXD_W0_OWNER_NIC); return rt2x00_get_field32(word, RXD_W0_OWNER_NIC);
} else { } else {
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
return (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || return (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) ||
rt2x00_get_field32(word, TXD_W0_VALID)); rt2x00_get_field32(word, TXD_W0_VALID));
...@@ -746,19 +746,19 @@ static void rt2400pci_clear_entry(struct queue_entry *entry) ...@@ -746,19 +746,19 @@ static void rt2400pci_clear_entry(struct queue_entry *entry)
u32 word; u32 word;
if (entry->queue->qid == QID_RX) { if (entry->queue->qid == QID_RX) {
rt2x00_desc_read(entry_priv->desc, 2, &word); word = rt2x00_desc_read(entry_priv->desc, 2);
rt2x00_set_field32(&word, RXD_W2_BUFFER_LENGTH, entry->skb->len); rt2x00_set_field32(&word, RXD_W2_BUFFER_LENGTH, entry->skb->len);
rt2x00_desc_write(entry_priv->desc, 2, word); rt2x00_desc_write(entry_priv->desc, 2, word);
rt2x00_desc_read(entry_priv->desc, 1, &word); word = rt2x00_desc_read(entry_priv->desc, 1);
rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
rt2x00_desc_write(entry_priv->desc, 1, word); rt2x00_desc_write(entry_priv->desc, 1, word);
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1); rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
rt2x00_desc_write(entry_priv->desc, 0, word); rt2x00_desc_write(entry_priv->desc, 0, word);
} else { } else {
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
rt2x00_set_field32(&word, TXD_W0_VALID, 0); rt2x00_set_field32(&word, TXD_W0_VALID, 0);
rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0); rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
rt2x00_desc_write(entry_priv->desc, 0, word); rt2x00_desc_write(entry_priv->desc, 0, word);
...@@ -1113,16 +1113,16 @@ static void rt2400pci_write_tx_desc(struct queue_entry *entry, ...@@ -1113,16 +1113,16 @@ static void rt2400pci_write_tx_desc(struct queue_entry *entry,
/* /*
* Start writing the descriptor words. * Start writing the descriptor words.
*/ */
rt2x00_desc_read(txd, 1, &word); word = rt2x00_desc_read(txd, 1);
rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
rt2x00_desc_write(txd, 1, word); rt2x00_desc_write(txd, 1, word);
rt2x00_desc_read(txd, 2, &word); word = rt2x00_desc_read(txd, 2);
rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, txdesc->length); rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, txdesc->length);
rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, txdesc->length); rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, txdesc->length);
rt2x00_desc_write(txd, 2, word); rt2x00_desc_write(txd, 2, word);
rt2x00_desc_read(txd, 3, &word); word = rt2x00_desc_read(txd, 3);
rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL, txdesc->u.plcp.signal); rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL, txdesc->u.plcp.signal);
rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL_REGNUM, 5); rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL_REGNUM, 5);
rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL_BUSY, 1); rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL_BUSY, 1);
...@@ -1131,7 +1131,7 @@ static void rt2400pci_write_tx_desc(struct queue_entry *entry, ...@@ -1131,7 +1131,7 @@ static void rt2400pci_write_tx_desc(struct queue_entry *entry,
rt2x00_set_field32(&word, TXD_W3_PLCP_SERVICE_BUSY, 1); rt2x00_set_field32(&word, TXD_W3_PLCP_SERVICE_BUSY, 1);
rt2x00_desc_write(txd, 3, word); rt2x00_desc_write(txd, 3, word);
rt2x00_desc_read(txd, 4, &word); word = rt2x00_desc_read(txd, 4);
rt2x00_set_field32(&word, TXD_W4_PLCP_LENGTH_LOW, rt2x00_set_field32(&word, TXD_W4_PLCP_LENGTH_LOW,
txdesc->u.plcp.length_low); txdesc->u.plcp.length_low);
rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_LOW_REGNUM, 8); rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_LOW_REGNUM, 8);
...@@ -1147,7 +1147,7 @@ static void rt2400pci_write_tx_desc(struct queue_entry *entry, ...@@ -1147,7 +1147,7 @@ static void rt2400pci_write_tx_desc(struct queue_entry *entry,
* the device, whereby the device may take hold of the TXD before we * the device, whereby the device may take hold of the TXD before we
* finished updating it. * finished updating it.
*/ */
rt2x00_desc_read(txd, 0, &word); word = rt2x00_desc_read(txd, 0);
rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1); rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1);
rt2x00_set_field32(&word, TXD_W0_VALID, 1); rt2x00_set_field32(&word, TXD_W0_VALID, 1);
rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
...@@ -1228,10 +1228,10 @@ static void rt2400pci_fill_rxdone(struct queue_entry *entry, ...@@ -1228,10 +1228,10 @@ static void rt2400pci_fill_rxdone(struct queue_entry *entry,
u32 rx_low; u32 rx_low;
u32 rx_high; u32 rx_high;
rt2x00_desc_read(entry_priv->desc, 0, &word0); word0 = rt2x00_desc_read(entry_priv->desc, 0);
rt2x00_desc_read(entry_priv->desc, 2, &word2); word2 = rt2x00_desc_read(entry_priv->desc, 2);
rt2x00_desc_read(entry_priv->desc, 3, &word3); word3 = rt2x00_desc_read(entry_priv->desc, 3);
rt2x00_desc_read(entry_priv->desc, 4, &word4); word4 = rt2x00_desc_read(entry_priv->desc, 4);
if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR)) if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR))
rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
...@@ -1285,7 +1285,7 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev, ...@@ -1285,7 +1285,7 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev,
while (!rt2x00queue_empty(queue)) { while (!rt2x00queue_empty(queue)) {
entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
entry_priv = entry->priv_data; entry_priv = entry->priv_data;
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) ||
!rt2x00_get_field32(word, TXD_W0_VALID)) !rt2x00_get_field32(word, TXD_W0_VALID))
......
...@@ -817,11 +817,11 @@ static bool rt2500pci_get_entry_state(struct queue_entry *entry) ...@@ -817,11 +817,11 @@ static bool rt2500pci_get_entry_state(struct queue_entry *entry)
u32 word; u32 word;
if (entry->queue->qid == QID_RX) { if (entry->queue->qid == QID_RX) {
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
return rt2x00_get_field32(word, RXD_W0_OWNER_NIC); return rt2x00_get_field32(word, RXD_W0_OWNER_NIC);
} else { } else {
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
return (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || return (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) ||
rt2x00_get_field32(word, TXD_W0_VALID)); rt2x00_get_field32(word, TXD_W0_VALID));
...@@ -835,15 +835,15 @@ static void rt2500pci_clear_entry(struct queue_entry *entry) ...@@ -835,15 +835,15 @@ static void rt2500pci_clear_entry(struct queue_entry *entry)
u32 word; u32 word;
if (entry->queue->qid == QID_RX) { if (entry->queue->qid == QID_RX) {
rt2x00_desc_read(entry_priv->desc, 1, &word); word = rt2x00_desc_read(entry_priv->desc, 1);
rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
rt2x00_desc_write(entry_priv->desc, 1, word); rt2x00_desc_write(entry_priv->desc, 1, word);
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1); rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
rt2x00_desc_write(entry_priv->desc, 0, word); rt2x00_desc_write(entry_priv->desc, 0, word);
} else { } else {
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
rt2x00_set_field32(&word, TXD_W0_VALID, 0); rt2x00_set_field32(&word, TXD_W0_VALID, 0);
rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0); rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
rt2x00_desc_write(entry_priv->desc, 0, word); rt2x00_desc_write(entry_priv->desc, 0, word);
...@@ -1266,18 +1266,18 @@ static void rt2500pci_write_tx_desc(struct queue_entry *entry, ...@@ -1266,18 +1266,18 @@ static void rt2500pci_write_tx_desc(struct queue_entry *entry,
/* /*
* Start writing the descriptor words. * Start writing the descriptor words.
*/ */
rt2x00_desc_read(txd, 1, &word); word = rt2x00_desc_read(txd, 1);
rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
rt2x00_desc_write(txd, 1, word); rt2x00_desc_write(txd, 1, word);
rt2x00_desc_read(txd, 2, &word); word = rt2x00_desc_read(txd, 2);
rt2x00_set_field32(&word, TXD_W2_IV_OFFSET, IEEE80211_HEADER); rt2x00_set_field32(&word, TXD_W2_IV_OFFSET, IEEE80211_HEADER);
rt2x00_set_field32(&word, TXD_W2_AIFS, entry->queue->aifs); rt2x00_set_field32(&word, TXD_W2_AIFS, entry->queue->aifs);
rt2x00_set_field32(&word, TXD_W2_CWMIN, entry->queue->cw_min); rt2x00_set_field32(&word, TXD_W2_CWMIN, entry->queue->cw_min);
rt2x00_set_field32(&word, TXD_W2_CWMAX, entry->queue->cw_max); rt2x00_set_field32(&word, TXD_W2_CWMAX, entry->queue->cw_max);
rt2x00_desc_write(txd, 2, word); rt2x00_desc_write(txd, 2, word);
rt2x00_desc_read(txd, 3, &word); word = rt2x00_desc_read(txd, 3);
rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL, txdesc->u.plcp.signal); rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL, txdesc->u.plcp.signal);
rt2x00_set_field32(&word, TXD_W3_PLCP_SERVICE, txdesc->u.plcp.service); rt2x00_set_field32(&word, TXD_W3_PLCP_SERVICE, txdesc->u.plcp.service);
rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_LOW, rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_LOW,
...@@ -1286,7 +1286,7 @@ static void rt2500pci_write_tx_desc(struct queue_entry *entry, ...@@ -1286,7 +1286,7 @@ static void rt2500pci_write_tx_desc(struct queue_entry *entry,
txdesc->u.plcp.length_high); txdesc->u.plcp.length_high);
rt2x00_desc_write(txd, 3, word); rt2x00_desc_write(txd, 3, word);
rt2x00_desc_read(txd, 10, &word); word = rt2x00_desc_read(txd, 10);
rt2x00_set_field32(&word, TXD_W10_RTS, rt2x00_set_field32(&word, TXD_W10_RTS,
test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags)); test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags));
rt2x00_desc_write(txd, 10, word); rt2x00_desc_write(txd, 10, word);
...@@ -1296,7 +1296,7 @@ static void rt2500pci_write_tx_desc(struct queue_entry *entry, ...@@ -1296,7 +1296,7 @@ static void rt2500pci_write_tx_desc(struct queue_entry *entry,
* the device, whereby the device may take hold of the TXD before we * the device, whereby the device may take hold of the TXD before we
* finished updating it. * finished updating it.
*/ */
rt2x00_desc_read(txd, 0, &word); word = rt2x00_desc_read(txd, 0);
rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1); rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1);
rt2x00_set_field32(&word, TXD_W0_VALID, 1); rt2x00_set_field32(&word, TXD_W0_VALID, 1);
rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
...@@ -1371,8 +1371,8 @@ static void rt2500pci_fill_rxdone(struct queue_entry *entry, ...@@ -1371,8 +1371,8 @@ static void rt2500pci_fill_rxdone(struct queue_entry *entry,
u32 word0; u32 word0;
u32 word2; u32 word2;
rt2x00_desc_read(entry_priv->desc, 0, &word0); word0 = rt2x00_desc_read(entry_priv->desc, 0);
rt2x00_desc_read(entry_priv->desc, 2, &word2); word2 = rt2x00_desc_read(entry_priv->desc, 2);
if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR)) if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR))
rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
...@@ -1413,7 +1413,7 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev, ...@@ -1413,7 +1413,7 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev,
while (!rt2x00queue_empty(queue)) { while (!rt2x00queue_empty(queue)) {
entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
entry_priv = entry->priv_data; entry_priv = entry->priv_data;
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) ||
!rt2x00_get_field32(word, TXD_W0_VALID)) !rt2x00_get_field32(word, TXD_W0_VALID))
......
...@@ -1074,7 +1074,7 @@ static void rt2500usb_write_tx_desc(struct queue_entry *entry, ...@@ -1074,7 +1074,7 @@ static void rt2500usb_write_tx_desc(struct queue_entry *entry,
/* /*
* Start writing the descriptor words. * Start writing the descriptor words.
*/ */
rt2x00_desc_read(txd, 0, &word); word = rt2x00_desc_read(txd, 0);
rt2x00_set_field32(&word, TXD_W0_RETRY_LIMIT, txdesc->retry_limit); rt2x00_set_field32(&word, TXD_W0_RETRY_LIMIT, txdesc->retry_limit);
rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
...@@ -1092,14 +1092,14 @@ static void rt2500usb_write_tx_desc(struct queue_entry *entry, ...@@ -1092,14 +1092,14 @@ static void rt2500usb_write_tx_desc(struct queue_entry *entry,
rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx); rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx);
rt2x00_desc_write(txd, 0, word); rt2x00_desc_write(txd, 0, word);
rt2x00_desc_read(txd, 1, &word); word = rt2x00_desc_read(txd, 1);
rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, txdesc->iv_offset); rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, txdesc->iv_offset);
rt2x00_set_field32(&word, TXD_W1_AIFS, entry->queue->aifs); rt2x00_set_field32(&word, TXD_W1_AIFS, entry->queue->aifs);
rt2x00_set_field32(&word, TXD_W1_CWMIN, entry->queue->cw_min); rt2x00_set_field32(&word, TXD_W1_CWMIN, entry->queue->cw_min);
rt2x00_set_field32(&word, TXD_W1_CWMAX, entry->queue->cw_max); rt2x00_set_field32(&word, TXD_W1_CWMAX, entry->queue->cw_max);
rt2x00_desc_write(txd, 1, word); rt2x00_desc_write(txd, 1, word);
rt2x00_desc_read(txd, 2, &word); word = rt2x00_desc_read(txd, 2);
rt2x00_set_field32(&word, TXD_W2_PLCP_SIGNAL, txdesc->u.plcp.signal); rt2x00_set_field32(&word, TXD_W2_PLCP_SIGNAL, txdesc->u.plcp.signal);
rt2x00_set_field32(&word, TXD_W2_PLCP_SERVICE, txdesc->u.plcp.service); rt2x00_set_field32(&word, TXD_W2_PLCP_SERVICE, txdesc->u.plcp.service);
rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_LOW, rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_LOW,
...@@ -1247,8 +1247,8 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry, ...@@ -1247,8 +1247,8 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
/* /*
* It is now safe to read the descriptor on all architectures. * It is now safe to read the descriptor on all architectures.
*/ */
rt2x00_desc_read(rxd, 0, &word0); word0 = rt2x00_desc_read(rxd, 0);
rt2x00_desc_read(rxd, 1, &word1); word1 = rt2x00_desc_read(rxd, 1);
if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR)) if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR))
rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
...@@ -1260,8 +1260,8 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry, ...@@ -1260,8 +1260,8 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
rxdesc->cipher_status = RX_CRYPTO_FAIL_KEY; rxdesc->cipher_status = RX_CRYPTO_FAIL_KEY;
if (rxdesc->cipher != CIPHER_NONE) { if (rxdesc->cipher != CIPHER_NONE) {
_rt2x00_desc_read(rxd, 2, &rxdesc->iv[0]); rxdesc->iv[0] = _rt2x00_desc_read(rxd, 2);
_rt2x00_desc_read(rxd, 3, &rxdesc->iv[1]); rxdesc->iv[1] = _rt2x00_desc_read(rxd, 3);
rxdesc->dev_flags |= RXDONE_CRYPTO_IV; rxdesc->dev_flags |= RXDONE_CRYPTO_IV;
/* ICV is located at the end of frame */ /* ICV is located at the end of frame */
......
...@@ -785,7 +785,7 @@ void rt2800_write_tx_data(struct queue_entry *entry, ...@@ -785,7 +785,7 @@ void rt2800_write_tx_data(struct queue_entry *entry,
/* /*
* Initialize TX Info descriptor * Initialize TX Info descriptor
*/ */
rt2x00_desc_read(txwi, 0, &word); word = rt2x00_desc_read(txwi, 0);
rt2x00_set_field32(&word, TXWI_W0_FRAG, rt2x00_set_field32(&word, TXWI_W0_FRAG,
test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
rt2x00_set_field32(&word, TXWI_W0_MIMO_PS, rt2x00_set_field32(&word, TXWI_W0_MIMO_PS,
...@@ -807,7 +807,7 @@ void rt2800_write_tx_data(struct queue_entry *entry, ...@@ -807,7 +807,7 @@ void rt2800_write_tx_data(struct queue_entry *entry,
rt2x00_set_field32(&word, TXWI_W0_PHYMODE, txdesc->rate_mode); rt2x00_set_field32(&word, TXWI_W0_PHYMODE, txdesc->rate_mode);
rt2x00_desc_write(txwi, 0, word); rt2x00_desc_write(txwi, 0, word);
rt2x00_desc_read(txwi, 1, &word); word = rt2x00_desc_read(txwi, 1);
rt2x00_set_field32(&word, TXWI_W1_ACK, rt2x00_set_field32(&word, TXWI_W1_ACK,
test_bit(ENTRY_TXD_ACK, &txdesc->flags)); test_bit(ENTRY_TXD_ACK, &txdesc->flags));
rt2x00_set_field32(&word, TXWI_W1_NSEQ, rt2x00_set_field32(&word, TXWI_W1_NSEQ,
...@@ -885,12 +885,12 @@ void rt2800_process_rxwi(struct queue_entry *entry, ...@@ -885,12 +885,12 @@ void rt2800_process_rxwi(struct queue_entry *entry,
__le32 *rxwi = (__le32 *) entry->skb->data; __le32 *rxwi = (__le32 *) entry->skb->data;
u32 word; u32 word;
rt2x00_desc_read(rxwi, 0, &word); word = rt2x00_desc_read(rxwi, 0);
rxdesc->cipher = rt2x00_get_field32(word, RXWI_W0_UDF); rxdesc->cipher = rt2x00_get_field32(word, RXWI_W0_UDF);
rxdesc->size = rt2x00_get_field32(word, RXWI_W0_MPDU_TOTAL_BYTE_COUNT); rxdesc->size = rt2x00_get_field32(word, RXWI_W0_MPDU_TOTAL_BYTE_COUNT);
rt2x00_desc_read(rxwi, 1, &word); word = rt2x00_desc_read(rxwi, 1);
if (rt2x00_get_field32(word, RXWI_W1_SHORT_GI)) if (rt2x00_get_field32(word, RXWI_W1_SHORT_GI))
rxdesc->enc_flags |= RX_ENC_FLAG_SHORT_GI; rxdesc->enc_flags |= RX_ENC_FLAG_SHORT_GI;
...@@ -911,7 +911,7 @@ void rt2800_process_rxwi(struct queue_entry *entry, ...@@ -911,7 +911,7 @@ void rt2800_process_rxwi(struct queue_entry *entry,
if (rxdesc->rate_mode == RATE_MODE_CCK) if (rxdesc->rate_mode == RATE_MODE_CCK)
rxdesc->signal &= ~0x8; rxdesc->signal &= ~0x8;
rt2x00_desc_read(rxwi, 2, &word); word = rt2x00_desc_read(rxwi, 2);
/* /*
* Convert descriptor AGC value to RSSI value. * Convert descriptor AGC value to RSSI value.
...@@ -972,7 +972,7 @@ void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi, ...@@ -972,7 +972,7 @@ void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi,
* Obtain the status about this packet. * Obtain the status about this packet.
*/ */
txdesc.flags = 0; txdesc.flags = 0;
rt2x00_desc_read(txwi, 0, &word); word = rt2x00_desc_read(txwi, 0);
mcs = rt2x00_get_field32(word, TXWI_W0_MCS); mcs = rt2x00_get_field32(word, TXWI_W0_MCS);
ampdu = rt2x00_get_field32(word, TXWI_W0_AMPDU); ampdu = rt2x00_get_field32(word, TXWI_W0_AMPDU);
......
...@@ -109,7 +109,7 @@ void rt2800mmio_fill_rxdone(struct queue_entry *entry, ...@@ -109,7 +109,7 @@ void rt2800mmio_fill_rxdone(struct queue_entry *entry,
__le32 *rxd = entry_priv->desc; __le32 *rxd = entry_priv->desc;
u32 word; u32 word;
rt2x00_desc_read(rxd, 3, &word); word = rt2x00_desc_read(rxd, 3);
if (rt2x00_get_field32(word, RXD_W3_CRC_ERROR)) if (rt2x00_get_field32(word, RXD_W3_CRC_ERROR))
rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
...@@ -175,7 +175,7 @@ static bool rt2800mmio_txdone_entry_check(struct queue_entry *entry, u32 status) ...@@ -175,7 +175,7 @@ static bool rt2800mmio_txdone_entry_check(struct queue_entry *entry, u32 status)
wcid = rt2x00_get_field32(status, TX_STA_FIFO_WCID); wcid = rt2x00_get_field32(status, TX_STA_FIFO_WCID);
txwi = rt2800_drv_get_txwi(entry); txwi = rt2800_drv_get_txwi(entry);
rt2x00_desc_read(txwi, 1, &word); word = rt2x00_desc_read(txwi, 1);
tx_wcid = rt2x00_get_field32(word, TXWI_W1_WIRELESS_CLI_ID); tx_wcid = rt2x00_get_field32(word, TXWI_W1_WIRELESS_CLI_ID);
return (tx_wcid == wcid); return (tx_wcid == wcid);
...@@ -696,11 +696,11 @@ bool rt2800mmio_get_entry_state(struct queue_entry *entry) ...@@ -696,11 +696,11 @@ bool rt2800mmio_get_entry_state(struct queue_entry *entry)
u32 word; u32 word;
if (entry->queue->qid == QID_RX) { if (entry->queue->qid == QID_RX) {
rt2x00_desc_read(entry_priv->desc, 1, &word); word = rt2x00_desc_read(entry_priv->desc, 1);
return (!rt2x00_get_field32(word, RXD_W1_DMA_DONE)); return (!rt2x00_get_field32(word, RXD_W1_DMA_DONE));
} else { } else {
rt2x00_desc_read(entry_priv->desc, 1, &word); word = rt2x00_desc_read(entry_priv->desc, 1);
return (!rt2x00_get_field32(word, TXD_W1_DMA_DONE)); return (!rt2x00_get_field32(word, TXD_W1_DMA_DONE));
} }
...@@ -715,11 +715,11 @@ void rt2800mmio_clear_entry(struct queue_entry *entry) ...@@ -715,11 +715,11 @@ void rt2800mmio_clear_entry(struct queue_entry *entry)
u32 word; u32 word;
if (entry->queue->qid == QID_RX) { if (entry->queue->qid == QID_RX) {
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
rt2x00_set_field32(&word, RXD_W0_SDP0, skbdesc->skb_dma); rt2x00_set_field32(&word, RXD_W0_SDP0, skbdesc->skb_dma);
rt2x00_desc_write(entry_priv->desc, 0, word); rt2x00_desc_write(entry_priv->desc, 0, word);
rt2x00_desc_read(entry_priv->desc, 1, &word); word = rt2x00_desc_read(entry_priv->desc, 1);
rt2x00_set_field32(&word, RXD_W1_DMA_DONE, 0); rt2x00_set_field32(&word, RXD_W1_DMA_DONE, 0);
rt2x00_desc_write(entry_priv->desc, 1, word); rt2x00_desc_write(entry_priv->desc, 1, word);
...@@ -730,7 +730,7 @@ void rt2800mmio_clear_entry(struct queue_entry *entry) ...@@ -730,7 +730,7 @@ void rt2800mmio_clear_entry(struct queue_entry *entry)
rt2x00mmio_register_write(rt2x00dev, RX_CRX_IDX, rt2x00mmio_register_write(rt2x00dev, RX_CRX_IDX,
entry->entry_idx); entry->entry_idx);
} else { } else {
rt2x00_desc_read(entry_priv->desc, 1, &word); word = rt2x00_desc_read(entry_priv->desc, 1);
rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 1); rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 1);
rt2x00_desc_write(entry_priv->desc, 1, word); rt2x00_desc_write(entry_priv->desc, 1, word);
} }
......
...@@ -456,7 +456,7 @@ static void rt2800usb_write_tx_desc(struct queue_entry *entry, ...@@ -456,7 +456,7 @@ static void rt2800usb_write_tx_desc(struct queue_entry *entry,
/* /*
* Initialize TXINFO descriptor * Initialize TXINFO descriptor
*/ */
rt2x00_desc_read(txi, 0, &word); word = rt2x00_desc_read(txi, 0);
/* /*
* The size of TXINFO_W0_USB_DMA_TX_PKT_LEN is * The size of TXINFO_W0_USB_DMA_TX_PKT_LEN is
...@@ -527,7 +527,7 @@ static bool rt2800usb_txdone_entry_check(struct queue_entry *entry, u32 reg) ...@@ -527,7 +527,7 @@ static bool rt2800usb_txdone_entry_check(struct queue_entry *entry, u32 reg)
*/ */
txwi = rt2800usb_get_txwi(entry); txwi = rt2800usb_get_txwi(entry);
rt2x00_desc_read(txwi, 1, &word); word = rt2x00_desc_read(txwi, 1);
tx_wcid = rt2x00_get_field32(word, TXWI_W1_WIRELESS_CLI_ID); tx_wcid = rt2x00_get_field32(word, TXWI_W1_WIRELESS_CLI_ID);
tx_ack = rt2x00_get_field32(word, TXWI_W1_ACK); tx_ack = rt2x00_get_field32(word, TXWI_W1_ACK);
tx_pid = rt2x00_get_field32(word, TXWI_W1_PACKETID); tx_pid = rt2x00_get_field32(word, TXWI_W1_PACKETID);
...@@ -652,7 +652,7 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry, ...@@ -652,7 +652,7 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry,
* | RXINFO | RXWI | header | L2 pad | payload | pad | RXD | USB pad | * | RXINFO | RXWI | header | L2 pad | payload | pad | RXD | USB pad |
* |<------------ rx_pkt_len -------------->| * |<------------ rx_pkt_len -------------->|
*/ */
rt2x00_desc_read(rxi, 0, &word); word = rt2x00_desc_read(rxi, 0);
rx_pkt_len = rt2x00_get_field32(word, RXINFO_W0_USB_DMA_RX_PKT_LEN); rx_pkt_len = rt2x00_get_field32(word, RXINFO_W0_USB_DMA_RX_PKT_LEN);
/* /*
...@@ -676,7 +676,7 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry, ...@@ -676,7 +676,7 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry,
/* /*
* It is now safe to read the descriptor on all architectures. * It is now safe to read the descriptor on all architectures.
*/ */
rt2x00_desc_read(rxd, 0, &word); word = rt2x00_desc_read(rxd, 0);
if (rt2x00_get_field32(word, RXD_W0_CRC_ERROR)) if (rt2x00_get_field32(word, RXD_W0_CRC_ERROR))
rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
......
...@@ -642,11 +642,10 @@ static inline int rt2x00queue_dma_timeout(struct queue_entry *entry) ...@@ -642,11 +642,10 @@ static inline int rt2x00queue_dma_timeout(struct queue_entry *entry)
* _rt2x00_desc_read - Read a word from the hardware descriptor. * _rt2x00_desc_read - Read a word from the hardware descriptor.
* @desc: Base descriptor address * @desc: Base descriptor address
* @word: Word index from where the descriptor should be read. * @word: Word index from where the descriptor should be read.
* @value: Address where the descriptor value should be written into.
*/ */
static inline void _rt2x00_desc_read(__le32 *desc, const u8 word, __le32 *value) static inline __le32 _rt2x00_desc_read(__le32 *desc, const u8 word)
{ {
*value = desc[word]; return desc[word];
} }
/** /**
...@@ -654,13 +653,10 @@ static inline void _rt2x00_desc_read(__le32 *desc, const u8 word, __le32 *value) ...@@ -654,13 +653,10 @@ static inline void _rt2x00_desc_read(__le32 *desc, const u8 word, __le32 *value)
* function will take care of the byte ordering. * function will take care of the byte ordering.
* @desc: Base descriptor address * @desc: Base descriptor address
* @word: Word index from where the descriptor should be read. * @word: Word index from where the descriptor should be read.
* @value: Address where the descriptor value should be written into.
*/ */
static inline void rt2x00_desc_read(__le32 *desc, const u8 word, u32 *value) static inline u32 rt2x00_desc_read(__le32 *desc, const u8 word)
{ {
__le32 tmp; return le32_to_cpu(_rt2x00_desc_read(desc, word));
_rt2x00_desc_read(desc, word, &tmp);
*value = le32_to_cpu(tmp);
} }
/** /**
......
...@@ -1386,11 +1386,11 @@ static bool rt61pci_get_entry_state(struct queue_entry *entry) ...@@ -1386,11 +1386,11 @@ static bool rt61pci_get_entry_state(struct queue_entry *entry)
u32 word; u32 word;
if (entry->queue->qid == QID_RX) { if (entry->queue->qid == QID_RX) {
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
return rt2x00_get_field32(word, RXD_W0_OWNER_NIC); return rt2x00_get_field32(word, RXD_W0_OWNER_NIC);
} else { } else {
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
return (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || return (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) ||
rt2x00_get_field32(word, TXD_W0_VALID)); rt2x00_get_field32(word, TXD_W0_VALID));
...@@ -1404,16 +1404,16 @@ static void rt61pci_clear_entry(struct queue_entry *entry) ...@@ -1404,16 +1404,16 @@ static void rt61pci_clear_entry(struct queue_entry *entry)
u32 word; u32 word;
if (entry->queue->qid == QID_RX) { if (entry->queue->qid == QID_RX) {
rt2x00_desc_read(entry_priv->desc, 5, &word); word = rt2x00_desc_read(entry_priv->desc, 5);
rt2x00_set_field32(&word, RXD_W5_BUFFER_PHYSICAL_ADDRESS, rt2x00_set_field32(&word, RXD_W5_BUFFER_PHYSICAL_ADDRESS,
skbdesc->skb_dma); skbdesc->skb_dma);
rt2x00_desc_write(entry_priv->desc, 5, word); rt2x00_desc_write(entry_priv->desc, 5, word);
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1); rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
rt2x00_desc_write(entry_priv->desc, 0, word); rt2x00_desc_write(entry_priv->desc, 0, word);
} else { } else {
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
rt2x00_set_field32(&word, TXD_W0_VALID, 0); rt2x00_set_field32(&word, TXD_W0_VALID, 0);
rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0); rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
rt2x00_desc_write(entry_priv->desc, 0, word); rt2x00_desc_write(entry_priv->desc, 0, word);
...@@ -1879,7 +1879,7 @@ static void rt61pci_write_tx_desc(struct queue_entry *entry, ...@@ -1879,7 +1879,7 @@ static void rt61pci_write_tx_desc(struct queue_entry *entry,
/* /*
* Start writing the descriptor words. * Start writing the descriptor words.
*/ */
rt2x00_desc_read(txd, 1, &word); word = rt2x00_desc_read(txd, 1);
rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, entry->queue->qid); rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, entry->queue->qid);
rt2x00_set_field32(&word, TXD_W1_AIFSN, entry->queue->aifs); rt2x00_set_field32(&word, TXD_W1_AIFSN, entry->queue->aifs);
rt2x00_set_field32(&word, TXD_W1_CWMIN, entry->queue->cw_min); rt2x00_set_field32(&word, TXD_W1_CWMIN, entry->queue->cw_min);
...@@ -1890,7 +1890,7 @@ static void rt61pci_write_tx_desc(struct queue_entry *entry, ...@@ -1890,7 +1890,7 @@ static void rt61pci_write_tx_desc(struct queue_entry *entry,
rt2x00_set_field32(&word, TXD_W1_BUFFER_COUNT, 1); rt2x00_set_field32(&word, TXD_W1_BUFFER_COUNT, 1);
rt2x00_desc_write(txd, 1, word); rt2x00_desc_write(txd, 1, word);
rt2x00_desc_read(txd, 2, &word); word = rt2x00_desc_read(txd, 2);
rt2x00_set_field32(&word, TXD_W2_PLCP_SIGNAL, txdesc->u.plcp.signal); rt2x00_set_field32(&word, TXD_W2_PLCP_SIGNAL, txdesc->u.plcp.signal);
rt2x00_set_field32(&word, TXD_W2_PLCP_SERVICE, txdesc->u.plcp.service); rt2x00_set_field32(&word, TXD_W2_PLCP_SERVICE, txdesc->u.plcp.service);
rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_LOW, rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_LOW,
...@@ -1904,7 +1904,7 @@ static void rt61pci_write_tx_desc(struct queue_entry *entry, ...@@ -1904,7 +1904,7 @@ static void rt61pci_write_tx_desc(struct queue_entry *entry,
_rt2x00_desc_write(txd, 4, skbdesc->iv[1]); _rt2x00_desc_write(txd, 4, skbdesc->iv[1]);
} }
rt2x00_desc_read(txd, 5, &word); word = rt2x00_desc_read(txd, 5);
rt2x00_set_field32(&word, TXD_W5_PID_TYPE, entry->queue->qid); rt2x00_set_field32(&word, TXD_W5_PID_TYPE, entry->queue->qid);
rt2x00_set_field32(&word, TXD_W5_PID_SUBTYPE, entry->entry_idx); rt2x00_set_field32(&word, TXD_W5_PID_SUBTYPE, entry->entry_idx);
rt2x00_set_field32(&word, TXD_W5_TX_POWER, rt2x00_set_field32(&word, TXD_W5_TX_POWER,
...@@ -1913,12 +1913,12 @@ static void rt61pci_write_tx_desc(struct queue_entry *entry, ...@@ -1913,12 +1913,12 @@ static void rt61pci_write_tx_desc(struct queue_entry *entry,
rt2x00_desc_write(txd, 5, word); rt2x00_desc_write(txd, 5, word);
if (entry->queue->qid != QID_BEACON) { if (entry->queue->qid != QID_BEACON) {
rt2x00_desc_read(txd, 6, &word); word = rt2x00_desc_read(txd, 6);
rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS, rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
skbdesc->skb_dma); skbdesc->skb_dma);
rt2x00_desc_write(txd, 6, word); rt2x00_desc_write(txd, 6, word);
rt2x00_desc_read(txd, 11, &word); word = rt2x00_desc_read(txd, 11);
rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0,
txdesc->length); txdesc->length);
rt2x00_desc_write(txd, 11, word); rt2x00_desc_write(txd, 11, word);
...@@ -1929,7 +1929,7 @@ static void rt61pci_write_tx_desc(struct queue_entry *entry, ...@@ -1929,7 +1929,7 @@ static void rt61pci_write_tx_desc(struct queue_entry *entry,
* the device, whereby the device may take hold of the TXD before we * the device, whereby the device may take hold of the TXD before we
* finished updating it. * finished updating it.
*/ */
rt2x00_desc_read(txd, 0, &word); word = rt2x00_desc_read(txd, 0);
rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1); rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1);
rt2x00_set_field32(&word, TXD_W0_VALID, 1); rt2x00_set_field32(&word, TXD_W0_VALID, 1);
rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
...@@ -2095,8 +2095,8 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry, ...@@ -2095,8 +2095,8 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry,
u32 word0; u32 word0;
u32 word1; u32 word1;
rt2x00_desc_read(entry_priv->desc, 0, &word0); word0 = rt2x00_desc_read(entry_priv->desc, 0);
rt2x00_desc_read(entry_priv->desc, 1, &word1); word1 = rt2x00_desc_read(entry_priv->desc, 1);
if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR)) if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR))
rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
...@@ -2105,11 +2105,11 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry, ...@@ -2105,11 +2105,11 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry,
rxdesc->cipher_status = rt2x00_get_field32(word0, RXD_W0_CIPHER_ERROR); rxdesc->cipher_status = rt2x00_get_field32(word0, RXD_W0_CIPHER_ERROR);
if (rxdesc->cipher != CIPHER_NONE) { if (rxdesc->cipher != CIPHER_NONE) {
_rt2x00_desc_read(entry_priv->desc, 2, &rxdesc->iv[0]); rxdesc->iv[0] = _rt2x00_desc_read(entry_priv->desc, 2);
_rt2x00_desc_read(entry_priv->desc, 3, &rxdesc->iv[1]); rxdesc->iv[1] = _rt2x00_desc_read(entry_priv->desc, 3);
rxdesc->dev_flags |= RXDONE_CRYPTO_IV; rxdesc->dev_flags |= RXDONE_CRYPTO_IV;
_rt2x00_desc_read(entry_priv->desc, 4, &rxdesc->icv); rxdesc->icv = _rt2x00_desc_read(entry_priv->desc, 4);
rxdesc->dev_flags |= RXDONE_CRYPTO_ICV; rxdesc->dev_flags |= RXDONE_CRYPTO_ICV;
/* /*
...@@ -2198,7 +2198,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev) ...@@ -2198,7 +2198,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
entry = &queue->entries[index]; entry = &queue->entries[index];
entry_priv = entry->priv_data; entry_priv = entry->priv_data;
rt2x00_desc_read(entry_priv->desc, 0, &word); word = rt2x00_desc_read(entry_priv->desc, 0);
if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) ||
!rt2x00_get_field32(word, TXD_W0_VALID)) !rt2x00_get_field32(word, TXD_W0_VALID))
......
...@@ -1462,7 +1462,7 @@ static void rt73usb_write_tx_desc(struct queue_entry *entry, ...@@ -1462,7 +1462,7 @@ static void rt73usb_write_tx_desc(struct queue_entry *entry,
/* /*
* Start writing the descriptor words. * Start writing the descriptor words.
*/ */
rt2x00_desc_read(txd, 0, &word); word = rt2x00_desc_read(txd, 0);
rt2x00_set_field32(&word, TXD_W0_BURST, rt2x00_set_field32(&word, TXD_W0_BURST,
test_bit(ENTRY_TXD_BURST, &txdesc->flags)); test_bit(ENTRY_TXD_BURST, &txdesc->flags));
rt2x00_set_field32(&word, TXD_W0_VALID, 1); rt2x00_set_field32(&word, TXD_W0_VALID, 1);
...@@ -1488,7 +1488,7 @@ static void rt73usb_write_tx_desc(struct queue_entry *entry, ...@@ -1488,7 +1488,7 @@ static void rt73usb_write_tx_desc(struct queue_entry *entry,
rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher); rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher);
rt2x00_desc_write(txd, 0, word); rt2x00_desc_write(txd, 0, word);
rt2x00_desc_read(txd, 1, &word); word = rt2x00_desc_read(txd, 1);
rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, entry->queue->qid); rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, entry->queue->qid);
rt2x00_set_field32(&word, TXD_W1_AIFSN, entry->queue->aifs); rt2x00_set_field32(&word, TXD_W1_AIFSN, entry->queue->aifs);
rt2x00_set_field32(&word, TXD_W1_CWMIN, entry->queue->cw_min); rt2x00_set_field32(&word, TXD_W1_CWMIN, entry->queue->cw_min);
...@@ -1498,7 +1498,7 @@ static void rt73usb_write_tx_desc(struct queue_entry *entry, ...@@ -1498,7 +1498,7 @@ static void rt73usb_write_tx_desc(struct queue_entry *entry,
test_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags)); test_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags));
rt2x00_desc_write(txd, 1, word); rt2x00_desc_write(txd, 1, word);
rt2x00_desc_read(txd, 2, &word); word = rt2x00_desc_read(txd, 2);
rt2x00_set_field32(&word, TXD_W2_PLCP_SIGNAL, txdesc->u.plcp.signal); rt2x00_set_field32(&word, TXD_W2_PLCP_SIGNAL, txdesc->u.plcp.signal);
rt2x00_set_field32(&word, TXD_W2_PLCP_SERVICE, txdesc->u.plcp.service); rt2x00_set_field32(&word, TXD_W2_PLCP_SERVICE, txdesc->u.plcp.service);
rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_LOW, rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_LOW,
...@@ -1512,7 +1512,7 @@ static void rt73usb_write_tx_desc(struct queue_entry *entry, ...@@ -1512,7 +1512,7 @@ static void rt73usb_write_tx_desc(struct queue_entry *entry,
_rt2x00_desc_write(txd, 4, skbdesc->iv[1]); _rt2x00_desc_write(txd, 4, skbdesc->iv[1]);
} }
rt2x00_desc_read(txd, 5, &word); word = rt2x00_desc_read(txd, 5);
rt2x00_set_field32(&word, TXD_W5_TX_POWER, rt2x00_set_field32(&word, TXD_W5_TX_POWER,
TXPOWER_TO_DEV(entry->queue->rt2x00dev->tx_power)); TXPOWER_TO_DEV(entry->queue->rt2x00dev->tx_power));
rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
...@@ -1694,8 +1694,8 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry, ...@@ -1694,8 +1694,8 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,
/* /*
* It is now safe to read the descriptor on all architectures. * It is now safe to read the descriptor on all architectures.
*/ */
rt2x00_desc_read(rxd, 0, &word0); word0 = rt2x00_desc_read(rxd, 0);
rt2x00_desc_read(rxd, 1, &word1); word1 = rt2x00_desc_read(rxd, 1);
if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR)) if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR))
rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
...@@ -1704,11 +1704,11 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry, ...@@ -1704,11 +1704,11 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,
rxdesc->cipher_status = rt2x00_get_field32(word0, RXD_W0_CIPHER_ERROR); rxdesc->cipher_status = rt2x00_get_field32(word0, RXD_W0_CIPHER_ERROR);
if (rxdesc->cipher != CIPHER_NONE) { if (rxdesc->cipher != CIPHER_NONE) {
_rt2x00_desc_read(rxd, 2, &rxdesc->iv[0]); rxdesc->iv[0] = _rt2x00_desc_read(rxd, 2);
_rt2x00_desc_read(rxd, 3, &rxdesc->iv[1]); rxdesc->iv[1] = _rt2x00_desc_read(rxd, 3);
rxdesc->dev_flags |= RXDONE_CRYPTO_IV; rxdesc->dev_flags |= RXDONE_CRYPTO_IV;
_rt2x00_desc_read(rxd, 4, &rxdesc->icv); rxdesc->icv = _rt2x00_desc_read(rxd, 4);
rxdesc->dev_flags |= RXDONE_CRYPTO_ICV; rxdesc->dev_flags |= RXDONE_CRYPTO_ICV;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment