blob: ffaba07f50ab5e583c76ee87a8c69ef5e48a8618 [file] [log] [blame]
Jan Glauber828b35f2012-11-29 14:33:30 +01001#ifndef _ASM_S390_DMA_MAPPING_H
2#define _ASM_S390_DMA_MAPPING_H
3
4#include <linux/kernel.h>
5#include <linux/types.h>
6#include <linux/mm.h>
7#include <linux/scatterlist.h>
Jan Glauber828b35f2012-11-29 14:33:30 +01008#include <linux/dma-debug.h>
9#include <linux/io.h>
10
11#define DMA_ERROR_CODE (~(dma_addr_t) 0x0)
12
Christian Borntraegere82becfc2016-02-02 21:46:34 -080013extern struct dma_map_ops s390_pci_dma_ops;
Jan Glauber828b35f2012-11-29 14:33:30 +010014
15static inline struct dma_map_ops *get_dma_ops(struct device *dev)
16{
Christian Borntraegere82becfc2016-02-02 21:46:34 -080017 if (dev && dev->archdata.dma_ops)
18 return dev->archdata.dma_ops;
19 return &dma_noop_ops;
Jan Glauber828b35f2012-11-29 14:33:30 +010020}
21
Heiko Carstense9789482013-01-30 14:16:02 +010022static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
23 enum dma_data_direction direction)
24{
25}
Jan Glauber828b35f2012-11-29 14:33:30 +010026
Jan Glauber828b35f2012-11-29 14:33:30 +010027static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
28{
29 if (!dev->dma_mask)
Joe Perches1c6e4b182015-03-30 16:46:05 -070030 return false;
Jan Glauber828b35f2012-11-29 14:33:30 +010031 return addr + size - 1 <= *dev->dma_mask;
32}
33
Jan Glauber828b35f2012-11-29 14:33:30 +010034#endif /* _ASM_S390_DMA_MAPPING_H */