aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500pci.c
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@kpnplanet.nl>2008-06-16 13:56:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-26 16:49:16 -0400
commitc4da004857056e6ee034c4110ccdcba659077b7e (patch)
tree641f8d9ddab7b8b6ba41fefc57a517abce15e8e6 /drivers/net/wireless/rt2x00/rt2500pci.c
parent30caa6e3d586442f7c3ad081260ee1b22bb123de (diff)
rt2x00: Replace statically allocated DMA buffers with mapped skb's.
The current PCI drivers require a lot of pre-allocated DMA buffers. Reduce this by using dynamically mapped skb's (using pci_map_single) instead of the pre- allocated DMA buffers that are allocated at device start-up time. At the same time move common RX path code into rt2x00lib from rt2x00pci and rt2x00usb, as the RX paths now are now almost the same. Signed-off-by: Gertjan van Wingerde <gwingerde@kpnplanet.nl> 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/rt2500pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 5f0117f9a88b..5077b62dcc5a 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -727,10 +727,11 @@ static void rt2500pci_init_rxentry(struct rt2x00_dev *rt2x00dev,
727 struct queue_entry *entry) 727 struct queue_entry *entry)
728{ 728{
729 struct queue_entry_priv_pci *entry_priv = entry->priv_data; 729 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
730 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
730 u32 word; 731 u32 word;
731 732
732 rt2x00_desc_read(entry_priv->desc, 1, &word); 733 rt2x00_desc_read(entry_priv->desc, 1, &word);
733 rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, entry_priv->data_dma); 734 rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
734 rt2x00_desc_write(entry_priv->desc, 1, word); 735 rt2x00_desc_write(entry_priv->desc, 1, word);
735 736
736 rt2x00_desc_read(entry_priv->desc, 0, &word); 737 rt2x00_desc_read(entry_priv->desc, 0, &word);
@@ -1171,7 +1172,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1171 * Start writing the descriptor words. 1172 * Start writing the descriptor words.
1172 */ 1173 */
1173 rt2x00_desc_read(entry_priv->desc, 1, &word); 1174 rt2x00_desc_read(entry_priv->desc, 1, &word);
1174 rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, entry_priv->data_dma); 1175 rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
1175 rt2x00_desc_write(entry_priv->desc, 1, word); 1176 rt2x00_desc_write(entry_priv->desc, 1, word);
1176 1177
1177 rt2x00_desc_read(txd, 2, &word); 1178 rt2x00_desc_read(txd, 2, &word);
@@ -1752,9 +1753,10 @@ static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev)
1752 rt2500pci_probe_hw_mode(rt2x00dev); 1753 rt2500pci_probe_hw_mode(rt2x00dev);
1753 1754
1754 /* 1755 /*
1755 * This device requires the atim queue 1756 * This device requires the atim queue and DMA-mapped skbs.
1756 */ 1757 */
1757 __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); 1758 __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
1759 __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
1758 1760
1759 /* 1761 /*
1760 * Set the rssi offset. 1762 * Set the rssi offset.
@@ -1842,7 +1844,7 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
1842 * Write entire beacon with descriptor to register, 1844 * Write entire beacon with descriptor to register,
1843 * and kick the beacon generator. 1845 * and kick the beacon generator.
1844 */ 1846 */
1845 memcpy(entry_priv->data, skb->data, skb->len); 1847 rt2x00queue_map_txskb(rt2x00dev, intf->beacon->skb);
1846 rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc); 1848 rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc);
1847 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON); 1849 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON);
1848 1850