From: Ivo van Doorn <ivdoorn@gmail.com>
To: netdev@vger.kernel.org
Cc: rt2x00-devel@lfcorreia.dyndns.org
Subject: [PATCH 3/32] rt2x00: use pci_*_consistent for DMA mapping
Date: Fri, 28 Apr 2006 00:02:52 +0200 [thread overview]
Message-ID: <200604280002.52839.IvDoorn@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2842 bytes --]
From: Ivo van Doorn <IvDoorn@gmail.com>
Add linux/dma-mapping.h header to allow compilation
on some architectures. Instead of dma_*_coherent
use pci_*consistent functions.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 2006-04-27 21:36:17.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 2006-04-27 21:37:02.000000000 +0200
@@ -29,6 +29,7 @@
#include <linux/version.h>
#include <linux/init.h>
#include <linux/pci.h>
+#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
@@ -928,8 +929,8 @@ rt2400pci_alloc_ring(
/*
* Allocate DMA memory for descriptor and buffer.
*/
- ring->data_addr = dma_alloc_coherent(&rt2x00pci->pci_dev->dev,
- rt2x00_get_ring_size(ring), &ring->data_dma, GFP_KERNEL);
+ ring->data_addr = pci_alloc_consistent(rt2x00pci->pci_dev,
+ rt2x00_get_ring_size(ring), &ring->data_dma);
if (!ring->data_addr) {
kfree(ring->entry);
return -ENOMEM;
@@ -959,7 +960,7 @@ static void
rt2400pci_free_ring(struct rt2x00_pci *rt2x00pci, struct data_ring *ring)
{
if (ring->data_addr)
- dma_free_coherent(&rt2x00pci->pci_dev->dev,
+ pci_free_consistent(rt2x00pci->pci_dev,
rt2x00_get_ring_size(ring),
ring->data_addr, ring->data_dma);
ring->data_addr = NULL;
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 2006-04-27 21:36:17.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 2006-04-27 21:37:02.000000000 +0200
@@ -29,6 +29,7 @@
#include <linux/version.h>
#include <linux/init.h>
#include <linux/pci.h>
+#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
@@ -964,8 +965,8 @@ rt2500pci_alloc_ring(
/*
* Allocate DMA memory for descriptor and buffer.
*/
- ring->data_addr = dma_alloc_coherent(&rt2x00pci->pci_dev->dev,
- rt2x00_get_ring_size(ring), &ring->data_dma, GFP_KERNEL);
+ ring->data_addr = pci_alloc_consistent(rt2x00pci->pci_dev,
+ rt2x00_get_ring_size(ring), &ring->data_dma);
if (!ring->data_addr) {
kfree(ring->entry);
return -ENOMEM;
@@ -995,7 +996,7 @@ static void
rt2500pci_free_ring(struct rt2x00_pci *rt2x00pci, struct data_ring *ring)
{
if (ring->data_addr)
- dma_free_coherent(&rt2x00pci->pci_dev->dev,
+ pci_free_consistent(rt2x00pci->pci_dev,
rt2x00_get_ring_size(ring),
ring->data_addr, ring->data_dma);
ring->data_addr = NULL;
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2006-04-27 22:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-27 22:02 Ivo van Doorn [this message]
2006-04-27 22:11 ` [PATCH 3/32] rt2x00: use pci_*_consistent for DMA mapping Christoph Hellwig
2006-04-28 12:57 ` Ivo van Doorn
2006-04-28 13:15 ` Christoph Hellwig
2006-04-28 13:24 ` Ivo van Doorn
2006-04-28 13:33 ` Michael Buesch
2006-04-28 13:39 ` Ivo van Doorn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200604280002.52839.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rt2x00-devel@lfcorreia.dyndns.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).