This is to match the dma_map_sg() API which this function will have to call in an future patch. Add a pci_p2pdma_map_sg_attrs() function and helper to call it with no attributes just like the dma_map_sg() function.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -30,8 +30,8 @@ struct scatterlist *pci_p2pmem_alloc_sgl(struct pci_dev *pdev, · 29 unmodified lines | |||
| 30 | unsigned int *nents, u32 length); | 30 | unsigned int *nents, u32 length); |
| 31 | void pci_p2pmem_free_sgl(struct pci_dev *pdev, struct scatterlist *sgl); | 31 | void pci_p2pmem_free_sgl(struct pci_dev *pdev, struct scatterlist *sgl); |
| 32 | void pci_p2pmem_publish(struct pci_dev *pdev, bool publish); | 32 | void pci_p2pmem_publish(struct pci_dev *pdev, bool publish); |
| 33 | int pci_p2pdma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | 33 | int pci_p2pdma_map_sg_attrs(struct device *dev, struct scatterlist *sg, |
| 34 | enum dma_data_direction dir); | 34 | int nents, enum dma_data_direction dir, unsigned long attrs); |
| 35 | int pci_p2pdma_enable_store(const char *page, struct pci_dev **p2p_dev, | 35 | int pci_p2pdma_enable_store(const char *page, struct pci_dev **p2p_dev, |
| 36 | bool *use_p2pdma); | 36 | bool *use_p2pdma); |
| 37 | ssize_t pci_p2pdma_enable_show(char *page, struct pci_dev *p2p_dev, | 37 | ssize_t pci_p2pdma_enable_show(char *page, struct pci_dev *p2p_dev, |
| @@ -81,8 +81,9 @@ static inline void pci_p2pmem_free_sgl(struct pci_dev *pdev, · 43 unmodified lines | |||
| 81 | static inline void pci_p2pmem_publish(struct pci_dev *pdev, bool publish) | 81 | static inline void pci_p2pmem_publish(struct pci_dev *pdev, bool publish) |
| 82 | { | 82 | { |
| 83 | } | 83 | } |
| 84 | static inline int pci_p2pdma_map_sg(struct device *dev, | 84 | static inline int pci_p2pdma_map_sg_attrs(struct device *dev, |
| 85 | struct scatterlist *sg, int nents, enum dma_data_direction dir) | 85 | struct scatterlist *sg, int nents, enum dma_data_direction dir, |
| 86 | unsigned long attrs) | ||
| 86 | { | 87 | { |
| 87 | return 0; | 88 | return 0; |
| 88 | } | 89 | } |
| @@ -111,4 +112,10 @@ static inline struct pci_dev *pci_p2pmem_find(struct device *client) · 22 unmodified lines | |||
| 111 | return pci_p2pmem_find_many(&client, 1); | 112 | return pci_p2pmem_find_many(&client, 1); |
| 112 | } | 113 | } |
| 113 | 114 | ||
| 115 | static inline int pci_p2pdma_map_sg(struct device *dev, struct scatterlist *sg, | ||
| 116 | int nents, enum dma_data_direction dir) | ||
| 117 | { | ||
| 118 | return pci_p2pdma_map_sg_attrs(dev, sg, nents, dir, 0); | ||
| 119 | } | ||
| 120 | |||
| 114 | #endif /* _LINUX_PCI_P2P_H */ | 121 | #endif /* _LINUX_PCI_P2P_H */ |