public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI Update for 2.6.3-rc1
Date: Mon, 9 Feb 2004 15:22:17 -0800	[thread overview]
Message-ID: <10763689371868@kroah.com> (raw)
In-Reply-To: <10763689362918@kroah.com>

ChangeSet 1.1500.11.5, 2004/02/02 11:05:17-08:00, dsaxena@plexity.net

[PATCH] PCI: Replace pci_pool with generic dma_pool, part 2

include/linux changes:

- Add dma_pools member to struct device
- Add include/linux/dmapool.h
- Remove pools memober from struct pci_dev
- Replace pci_pool_* functions with macros that map to dma_pool_* functions


 include/linux/device.h  |    1 +
 include/linux/dmapool.h |   27 +++++++++++++++++++++++++++
 include/linux/pci.h     |   14 ++++++++------
 3 files changed, 36 insertions(+), 6 deletions(-)


diff -Nru a/include/linux/device.h b/include/linux/device.h
--- a/include/linux/device.h	Mon Feb  9 14:59:31 2004
+++ b/include/linux/device.h	Mon Feb  9 14:59:31 2004
@@ -284,6 +284,7 @@
 					   detached from its driver. */
 
 	u64		*dma_mask;	/* dma mask (if dma'able device) */
+	struct list_head	dma_pools;	/* dma pools (if dma'ble) */
 
 	void	(*release)(struct device * dev);
 };
diff -Nru a/include/linux/dmapool.h b/include/linux/dmapool.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/linux/dmapool.h	Mon Feb  9 14:59:31 2004
@@ -0,0 +1,27 @@
+/*
+ * include/linux/dmapool.h
+ *
+ * Allocation pools for DMAable (coherent) memory.
+ *
+ * This file is licensed under  the terms of the GNU General Public 
+ * License version 2. This program is licensed "as is" without any 
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef LINUX_DMAPOOL_H
+#define	LINUX_DMAPOOL_H
+
+#include <asm/io.h>
+#include <asm/scatterlist.h>
+
+struct dma_pool *dma_pool_create(const char *name, struct device *dev, 
+			size_t size, size_t align, size_t allocation);
+
+void dma_pool_destroy(struct dma_pool *pool);
+
+void *dma_pool_alloc(struct dma_pool *pool, int mem_flags, dma_addr_t *handle);
+
+void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr);
+
+#endif
+
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Mon Feb  9 14:59:31 2004
+++ b/include/linux/pci.h	Mon Feb  9 14:59:31 2004
@@ -393,7 +393,6 @@
 					   0xffffffff.  You only need to change
 					   this if your device has broken DMA
 					   or supports 64-bit transfers.  */
-	struct list_head pools;		/* pci_pools tied to this device */
 
 	u64		consistent_dma_mask;/* Like dma_mask, but for
 					       pci_alloc_consistent mappings as
@@ -692,12 +691,15 @@
 int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
 
 /* kmem_cache style wrapper around pci_alloc_consistent() */
-struct pci_pool *pci_pool_create (const char *name, struct pci_dev *dev,
-		size_t size, size_t align, size_t allocation);
-void pci_pool_destroy (struct pci_pool *pool);
 
-void *pci_pool_alloc (struct pci_pool *pool, int flags, dma_addr_t *handle);
-void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr);
+#include <linux/dmapool.h>
+
+#define	pci_pool dma_pool
+#define pci_pool_create(name, pdev, size, align, allocation) \
+		dma_pool_create(name, &pdev->dev, size, align, allocation)
+#define	pci_pool_destroy(pool) dma_pool_destroy(pool)
+#define	pci_pool_alloc(pool, flags, handle) dma_pool_alloc(pool, flags, handle)
+#define	pci_pool_free(pool, vaddr, addr) dma_pool_free(pool, vaddr, addr)
 
 #if defined(CONFIG_ISA) || defined(CONFIG_EISA)
 extern struct pci_dev *isa_bridge;


  reply	other threads:[~2004-02-10  0:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-09 23:13 [BK PATCH] PCI update for 2.6.3-rc1 Greg KH
2004-02-09 23:22 ` [PATCH] PCI Update " Greg KH
2004-02-09 23:22   ` Greg KH
2004-02-09 23:22     ` Greg KH
2004-02-09 23:22       ` Greg KH
2004-02-09 23:22         ` Greg KH [this message]
2004-02-09 23:22           ` Greg KH
2004-02-09 23:22             ` Greg KH
2004-02-09 23:22               ` Greg KH
2004-02-09 23:22                 ` Greg KH
2004-02-09 23:22                   ` Greg KH
2004-02-09 23:22                     ` Greg KH
2004-02-09 23:22                       ` Greg KH
2004-02-09 23:22                         ` Greg KH
2004-02-09 23:22                           ` Greg KH
2004-02-09 23:22                             ` Greg KH
2004-02-09 23:22                               ` Greg KH
2004-02-09 23:22                                 ` Greg KH
2004-02-09 23:22                                   ` Greg KH
2004-02-09 23:22                                     ` Greg KH
2004-02-09 23:22                                       ` Greg KH
2004-02-09 23:22                                         ` Greg KH
2004-02-09 23:22                                           ` Greg KH
2004-02-09 23:22                                             ` Greg KH
2004-02-10 11:11                                               ` Marcelo Tosatti
2004-02-10 16:03     ` Geert Uytterhoeven
2004-02-10 16:46       ` Greg KH
2004-02-10 17:03         ` Kai Germaschewski
2004-02-10 17:49         ` Karsten Keil
2004-02-11 22:27           ` Adrian Bunk
2004-02-10 18:05         ` Adam Belay
2004-02-18 19:40           ` Greg KH

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=10763689371868@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.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