aboutsummaryrefslogtreecommitdiff
path: root/include/linux/dma-mapping.h
AgeCommit message (Collapse)AuthorFilesLines
2008-04-29dma: add dma_*map*_attrs() interfacesArthur Kepner1-0/+17
Introduce new interfaces, dma_*map*_attrs(), for passing architecture-specific attributes when memory is mapped and unmapped for DMA. Give the interfaces default implementations which ignore attributes. Also introduce the dma_{set|get}_attr() interfaces for setting and retrieving individual attributes. Define one attribute, DMA_ATTR_WRITE_BARRIER, in anticipation of its use by ia64/sn. Select whether architectures implement arch-specific versions of the dma_*map*_attrs() interfaces via HAVE_DMA_ATTRS in Kconfig. [[email protected]: dma_{set,get}_attr() have to be static inline] Signed-off-by: Arthur Kepner <[email protected]> Cc: Tony Luck <[email protected]> Cc: Jesse Barnes <[email protected]> Cc: Jes Sorensen <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Roland Dreier <[email protected]> Cc: James Bottomley <[email protected]> Cc: David Miller <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Grant Grundler <[email protected]> Cc: Michael Ellerman <[email protected]> Signed-off-by: Mark Nelson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-05iommu sg merging: add accessors for segment_boundary_mask in ↵FUJITA Tomonori1-0/+15
device_dma_parameters() This adds new accessors for segment_boundary_mask in device_dma_parameters structure in the same way I did for max_segment_size. So we can easily change where to place struct device_dma_parameters in the future. dma_get_segment boundary returns 0xffffffff if dma_parms in struct device isn't set up properly. 0xffffffff is the default value used in the block layer and the scsi mid layer. Signed-off-by: FUJITA Tomonori <[email protected]> Cc: James Bottomley <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Greg KH <[email protected]> Cc: Jeff Garzik <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-05iommu sg merging: add device_dma_parameters structureFUJITA Tomonori1-0/+15
IOMMUs merges scatter/gather segments without considering a low level driver's restrictions. The problem is that IOMMUs can't access to the limitations because they are in request_queue. This patchset introduces a new structure, device_dma_parameters, including dma information. A pointer to device_dma_parameters is added to struct device. The bus specific structures (like pci_dev) includes device_dma_parameters. Low level drivers can use dma_set_max_seg_size to tell IOMMUs about the restrictions. We can move more dma stuff in struct device (like dma_mask) to struct device_dma_parameters later (needs some cleanups before that). This includes patches for all the IOMMUs that could merge sg (x86_64, ppc, IA64, alpha, sparc64, and parisc) though only the ppc patch was tested. The patches for other IOMMUs are only compile tested. This patch: Add a new structure, device_dma_parameters, including dma information. A pointer to device_dma_parameters is added to struct device. - there are only max_segment_size and segment_boundary_mask there but we'll move more dma stuff in struct device (like dma_mask) to struct device_dma_parameters later. segment_boundary_mask is not supported yet. - new accessors for the dma parameters are added. So we can easily change where to place struct device_dma_parameters in the future. - dma_get_max_seg_size returns 64K if dma_parms in struct device isn't set up properly. 64K is the default max_segment_size in the block layer. Signed-off-by: FUJITA Tomonori <[email protected]> Acked-by: Jeff Garzik <[email protected]> Cc: James Bottomley <[email protected]> Acked-by: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-03linux/dma-mapping.h: rename macro to prevent multiple inclusionRobert P. J. Day1-2/+2
Having the macro to prevent multiple inclusion of include/linux/dma-mapping.h contain the prefix "_ASM" is just begging for possible confusion some day. Signed-off-by: Robert P. J. Day <[email protected]> Signed-off-by: Adrian Bunk <[email protected]>
2007-10-18stop using DMA_xxBIT_MASKAndrew Morton1-2/+8
Now that we have DMA_BIT_MASK(), these macros are pointless. Cc: Jeremy Fitzhardinge <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-18unify DMA_..BIT_MASK definitions: v3.1Borislav Petkov1-10/+14
Remove redundant DMA_..BIT_MASK definitions across two drivers. The computation of the majority of the bitmasks is done by the compiler. The initial split of the patch touching each a different file got removed due to possible git bisect breakage. Signed-off-by: Borislav Petkov <[email protected]> Cc: Jeremy Fitzhardinge <[email protected]> Cc: Muli Ben-Yehuda <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: James Bottomley <[email protected]> Reviewed-by: Satyam Sharma <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-16introduce DMA_MASK_NONE as a signal for unable to do DMAJames Bottomley1-0/+7
Some devices are incapable of DMA and need to be recognised as such. Introduce a NONE dma mask to facilitate this plus an inline function: is_device_dma_capable() to check this. Signed-off-by: James Bottomley <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Alan Cox <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Natalie Protasevich <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: Dominik Brodowski <[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-07-16dma-mapping: prevent dma dependent code from linking on !HAS_DMA archsDan Williams1-0/+4
Continuing the work started in 411f0f3edc141a582190d3605cadd1d993abb6df ... This enables code with a dma path, that compiles away, to build without requiring additional code factoring. It also prevents code that calls dma_alloc_coherent and dma_free_coherent from linking whereas previously the code would hit a BUG() at run time. Finally, it allows archs that set !HAS_DMA to delete their asm/dma-mapping.h file. Cc: Cornelia Huck <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: John W. Linville <[email protected]> Cc: Kyle McMartin <[email protected]> Cc: James Bottomley <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Signed-off-by: Dan Williams <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-02-09devres: device resource managementTejun Heo1-1/+28
Implement device resource management, in short, devres. A device driver can allocate arbirary size of devres data which is associated with a release function. On driver detach, release function is invoked on the devres data, then, devres data is freed. devreses are typed by associated release functions. Some devreses are better represented by single instance of the type while others need multiple instances sharing the same release function. Both usages are supported. devreses can be grouped using devres group such that a device driver can easily release acquired resources halfway through initialization or selectively release resources (e.g. resources for port 1 out of 4 ports). This patch adds devres core including documentation and the following managed interfaces. * alloc/free : devm_kzalloc(), devm_kzfree() * IO region : devm_request_region(), devm_release_region() * IRQ : devm_request_irq(), devm_free_irq() * DMA : dmam_alloc_coherent(), dmam_free_coherent(), dmam_declare_coherent_memory(), dmam_pool_create(), dmam_pool_destroy() * PCI : pcim_enable_device(), pcim_pin_device(), pci_is_managed() * iomap : devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(), devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(), pcim_iomap(), pcim_iounmap() Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
2006-09-29[PATCH] Move valid_dma_direction() from x86_64 to generic codeRolf Eike Beer1-0/+7
As suggested by Muli Ben-Yehuda this function is moved to generic code as may be useful for all archs. [[email protected]: fix] Signed-off-by: Rolf Eike Beer <[email protected]> Cc: Muli Ben-Yehuda <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-05-10dl2k: use DMA_48BIT_MASK constantFrancois Romieu1-0/+1
Typo will be harder with this one. Signed-off-by: Francois Romieu <[email protected]> Signed-off-by: Stephen Hemminger <[email protected]>
2006-04-11[PATCH] Last DMA_xBIT_MASK cleanupsTobias Klauser1-1/+1
These are the last conversions of pci_set_dma_mask(), pci_set_consistent_dma_mask() and pci_dma_supported() to use DMA_xBIT_MASK constants from linux/dma-mapping.h Signed-off-by: Tobias Klauser <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-03-28[PATCH] Replace 0xff.. with correct DMA_xBIT_MASKMatthias Gehre1-0/+1
Replace all occurences of 0xff.. in calls to function pci_set_dma_mask() and pci_set_consistant_dma_mask() with the corresponding DMA_xBIT_MASK from linux/dma-mapping.h. Signed-off-by: Matthias Gehre <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-03-22[PATCH] Intruduce DMA_28BIT_MASKTobias Klauser1-0/+1
This patch introduces the DMA_28BIT_MASK constant in dma-mapping.h ALSA drivers using this mask are changed to use the new constant. Signed-off-by: Tobias Klauser <[email protected]> Acked-by: Takashi Iwai <[email protected]> Acked-by: Jaroslav Kysela <[email protected]>
2005-06-17[SCSI] Add DMA mask constants other than 32 and 64 bitLee Revell1-0/+5
Signed-Off-By: Lee Revell <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+56
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!