aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2400pci.c
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2010-05-11 17:51:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-12 16:41:44 -0400
commit85b7a8b3871bde7885516fed2a1c8da699913318 (patch)
tree80c488fc082b06c9278e8e30db0033306404e8a1 /drivers/net/wireless/rt2x00/rt2400pci.c
parente01f1ec35ff91c8a3f4a3e48a0c8ab476124b973 (diff)
rt2x00: Simplify TXD handling of beacons.
The handling of tx descriptors for beacons can be simplified by updating write_tx_desc implementations of each driver to write directly to the queue entry descriptor instead of to a provided memory area. This is also a preparation for further clean ups where descriptors are properly reserved in the skb instead of fiddling with the skb data pointer. 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/rt2400pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 1eff6ec88457..def3fa45ae7a 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1006,15 +1006,15 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1006{ 1006{
1007 struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); 1007 struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
1008 struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; 1008 struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data;
1009 __le32 *txd = skbdesc->desc; 1009 __le32 *txd = entry_priv->desc;
1010 u32 word; 1010 u32 word;
1011 1011
1012 /* 1012 /*
1013 * Start writing the descriptor words. 1013 * Start writing the descriptor words.
1014 */ 1014 */
1015 rt2x00_desc_read(entry_priv->desc, 1, &word); 1015 rt2x00_desc_read(txd, 1, &word);
1016 rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); 1016 rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
1017 rt2x00_desc_write(entry_priv->desc, 1, word); 1017 rt2x00_desc_write(txd, 1, word);
1018 1018
1019 rt2x00_desc_read(txd, 2, &word); 1019 rt2x00_desc_read(txd, 2, &word);
1020 rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, txdesc->length); 1020 rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, txdesc->length);
@@ -1059,6 +1059,12 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1059 rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, 1059 rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
1060 test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); 1060 test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
1061 rt2x00_desc_write(txd, 0, word); 1061 rt2x00_desc_write(txd, 0, word);
1062
1063 /*
1064 * Register descriptor details in skb frame descriptor.
1065 */
1066 skbdesc->desc = txd;
1067 skbdesc->desc_len = TXD_DESC_SIZE;
1062} 1068}
1063 1069
1064/* 1070/*
@@ -1081,15 +1087,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
1081 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0); 1087 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0);
1082 rt2x00pci_register_write(rt2x00dev, CSR14, reg); 1088 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1083 1089
1084 /*
1085 * Replace rt2x00lib allocated descriptor with the
1086 * pointer to the _real_ hardware descriptor.
1087 * After that, map the beacon to DMA and update the
1088 * descriptor.
1089 */
1090 memcpy(entry_priv->desc, skbdesc->desc, skbdesc->desc_len);
1091 skbdesc->desc = entry_priv->desc;
1092
1093 rt2x00queue_map_txskb(rt2x00dev, entry->skb); 1090 rt2x00queue_map_txskb(rt2x00dev, entry->skb);
1094 1091
1095 rt2x00_desc_read(entry_priv->desc, 1, &word); 1092 rt2x00_desc_read(entry_priv->desc, 1, &word);