Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102777608
D30932.id91685.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D30932.id91685.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
--- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
@@ -63,13 +63,13 @@
void *vaddr, dma_addr_t dma_handle);
dma_addr_t (*map_page)(struct device *dev, struct page *page,
unsigned long offset, size_t size, enum dma_data_direction dir,
- struct dma_attrs *attrs);
+ unsigned long attrs);
void (*unmap_page)(struct device *dev, dma_addr_t dma_handle,
- size_t size, enum dma_data_direction dir, struct dma_attrs *attrs);
+ size_t size, enum dma_data_direction dir, unsigned long attrs);
int (*map_sg)(struct device *dev, struct scatterlist *sg,
- int nents, enum dma_data_direction dir, struct dma_attrs *attrs);
+ int nents, enum dma_data_direction dir, unsigned long attrs);
void (*unmap_sg)(struct device *dev, struct scatterlist *sg, int nents,
- enum dma_data_direction dir, struct dma_attrs *attrs);
+ enum dma_data_direction dir, unsigned long attrs);
void (*sync_single_for_cpu)(struct device *dev, dma_addr_t dma_handle,
size_t size, enum dma_data_direction dir);
void (*sync_single_for_device)(struct device *dev,
@@ -97,9 +97,11 @@
dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len);
void linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t size);
int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl,
- int nents, enum dma_data_direction dir, struct dma_attrs *attrs);
+ int nents, enum dma_data_direction dir __unused,
+ unsigned long attrs __unused);
void linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg,
- int nents, enum dma_data_direction dir, struct dma_attrs *attrs);
+ int nents, enum dma_data_direction dir __unused,
+ unsigned long attrs __unused);
static inline int
dma_supported(struct device *dev, u64 mask)
@@ -164,21 +166,11 @@
kmem_free((vm_offset_t)cpu_addr, size);
}
-static inline dma_addr_t
-dma_map_single_attrs(struct device *dev, void *ptr, size_t size,
- enum dma_data_direction dir, struct dma_attrs *attrs)
-{
+#define dma_map_single_attrs(dev, ptr, size, dir, attrs) \
+ linux_dma_map_phys(dev, vtophys(ptr), size)
- return (linux_dma_map_phys(dev, vtophys(ptr), size));
-}
-
-static inline void
-dma_unmap_single_attrs(struct device *dev, dma_addr_t dma_addr, size_t size,
- enum dma_data_direction dir, struct dma_attrs *attrs)
-{
-
- linux_dma_unmap(dev, dma_addr, size);
-}
+#define dma_unmap_single_attrs(dev, dma_addr, size, dir, attrs) \
+ linux_dma_unmap(dev, dma_addr, size)
static inline dma_addr_t
dma_map_page_attrs(struct device *dev, struct page *page, size_t offset,
@@ -188,21 +180,12 @@
return (linux_dma_map_phys(dev, VM_PAGE_TO_PHYS(page) + offset, size));
}
-static inline int
-dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents,
- enum dma_data_direction dir, struct dma_attrs *attrs)
-{
-
- return (linux_dma_map_sg_attrs(dev, sgl, nents, dir, attrs));
-}
+/* linux_dma_(un)map_sg_attrs does not support attrs yet */
+#define dma_map_sg_attrs(dev, sgl, nents, dir, attrs) \
+ linux_dma_map_sg_attrs(dev, sgl, nents, dir, 0)
-static inline void
-dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, int nents,
- enum dma_data_direction dir, struct dma_attrs *attrs)
-{
-
- linux_dma_unmap_sg_attrs(dev, sg, nents, dir, attrs);
-}
+#define dma_unmap_sg_attrs(dev, sg, nents, dir, attrs) \
+ linux_dma_unmap_sg_attrs(dev, sg, nents, dir, 0)
static inline dma_addr_t
dma_map_page(struct device *dev, struct page *page,
@@ -276,10 +259,10 @@
return (0);
}
-#define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL)
-#define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, NULL)
-#define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, NULL)
-#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, NULL)
+#define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, 0)
+#define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0)
+#define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, 0)
+#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0)
#define DEFINE_DMA_UNMAP_ADDR(name) dma_addr_t name
#define DEFINE_DMA_UNMAP_LEN(name) __u32 name
diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c
--- a/sys/compat/linuxkpi/common/src/linux_pci.c
+++ b/sys/compat/linuxkpi/common/src/linux_pci.c
@@ -881,7 +881,7 @@
int
linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents,
- enum dma_data_direction dir, struct dma_attrs *attrs)
+ enum dma_data_direction dir __unused, unsigned long attrs __unused)
{
struct linux_dma_priv *priv;
struct scatterlist *sg;
@@ -921,7 +921,8 @@
void
linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl,
- int nents, enum dma_data_direction dir, struct dma_attrs *attrs)
+ int nents, enum dma_data_direction dir __unused,
+ unsigned long attrs __unused)
{
struct linux_dma_priv *priv;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 1:21 AM (21 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14687977
Default Alt Text
D30932.id91685.diff (5 KB)
Attached To
Mode
D30932: LinuxKPI: Use macro for implementation of some dma_map_* functions
Attached
Detach File
Event Timeline
Log In to Comment