mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 08:38:45 +02:00 
			
		
		
		
	 101d66828a
			
		
	
	
		101d66828a
		
	
	
	
	
		
			
			Implement `dma_set_mask()`, `dma_set_coherent_mask()` and `dma_set_mask_and_coherent()` in the `dma::Device` trait. Those methods are used to set up the device's DMA addressing capabilities. Reviewed-by: Abdiel Janulgue <abdiel.janulgue@gmail.com> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20250716150354.51081-3-dakr@kernel.org [ Add DmaMask::try_new(). - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
		
			
				
	
	
		
			21 lines
		
	
	
	
		
			584 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
	
		
			584 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0
 | |
| 
 | |
| #include <linux/dma-mapping.h>
 | |
| 
 | |
| void *rust_helper_dma_alloc_attrs(struct device *dev, size_t size,
 | |
| 				  dma_addr_t *dma_handle, gfp_t flag,
 | |
| 				  unsigned long attrs)
 | |
| {
 | |
| 	return dma_alloc_attrs(dev, size, dma_handle, flag, attrs);
 | |
| }
 | |
| 
 | |
| void rust_helper_dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
 | |
| 				dma_addr_t dma_handle, unsigned long attrs)
 | |
| {
 | |
| 	dma_free_attrs(dev, size, cpu_addr, dma_handle, attrs);
 | |
| }
 | |
| 
 | |
| int rust_helper_dma_set_mask_and_coherent(struct device *dev, u64 mask)
 | |
| {
 | |
| 	return dma_set_mask_and_coherent(dev, mask);
 | |
| }
 |