diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-03-13 17:05:37 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-03-13 17:05:37 -0800 |
| commit | 66b99421d118a5ddd98a72913670b0fcf0a38d45 (patch) | |
| tree | 34a7bfa51db844e23aca70851910f4a7b92ab505 /include/linux | |
| parent | e214725f749c1ca58ac87bcebb23d5c06170e62d (diff) | |
[PATCH] DMA: Fill gaping hole in DMA API interfaces.
From: "David S. Miller" <davem@redhat.com>
Currently, for an existing DMA mapping, there is a way to transfer buffer
ownership back to the cpu, yet there is no way to give it back to the device
again explicitly. The latter really is needed on platforms where the PCI
subsystem does not snoop the cpu caches, MIPS is one example.
Many drivers were expecting the existing DMA sync interface to handle both
directions, which was wrong.
Now, with this change, we have explicit interfaces for DMA syncing to/from
the device and the cpu.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/dma-mapping.h | 4 | ||||
| -rw-r--r-- | include/linux/pci.h | 4 | ||||
| -rw-r--r-- | include/linux/usb.h | 4 | ||||
| -rw-r--r-- | include/linux/usb_gadget.h | 2 |
4 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 9d88549ff2fc..5be0d81ba058 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -12,6 +12,10 @@ enum dma_data_direction { #include <asm/dma-mapping.h> +/* Backwards compat, remove in 2.7.x */ +#define dma_sync_single dma_sync_single_for_cpu +#define dma_sync_sg dma_sync_sg_for_cpu + #endif diff --git a/include/linux/pci.h b/include/linux/pci.h index 5618a68518a8..eb594a816bec 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -724,6 +724,10 @@ extern int msi_free_vectors(struct pci_dev* dev, int *vector, int nvec); #include <asm/pci.h> +/* Backwards compat, remove in 2.7.x */ +#define pci_dma_sync_single pci_dma_sync_single_for_cpu +#define pci_dma_sync_sg pci_dma_sync_sg_for_cpu + /* * If the system does not have PCI, clearly these return errors. Define * these as simple inline functions to avoid hair in drivers. diff --git a/include/linux/usb.h b/include/linux/usb.h index 45caca344ca3..bbed847a9165 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -830,14 +830,18 @@ void usb_buffer_free (struct usb_device *dev, size_t size, void *addr, dma_addr_t dma); struct urb *usb_buffer_map (struct urb *urb); +#if 0 void usb_buffer_dmasync (struct urb *urb); +#endif void usb_buffer_unmap (struct urb *urb); struct scatterlist; int usb_buffer_map_sg (struct usb_device *dev, unsigned pipe, struct scatterlist *sg, int nents); +#if 0 void usb_buffer_dmasync_sg (struct usb_device *dev, unsigned pipe, struct scatterlist *sg, int n_hw_ents); +#endif void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe, struct scatterlist *sg, int n_hw_ents); diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index 1cfb33ebf348..9bb39b8b16aa 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h @@ -117,7 +117,7 @@ struct usb_ep_ops { void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned bytes); // NOTE: on 2.5, drivers may also use dma_map() and - // dma_sync_single() to manage dma overhead. + // dma_sync_single_*() to manage dma overhead. int (*queue) (struct usb_ep *ep, struct usb_request *req, int gfp_flags); |
