Skip to contentSkip to conversation

: net: Add SKB DMA mapping helper functions.

PATCH In review David Miller 1 participant 1 message Sep 11, 2008

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 2/3 : net: Add SKB DMA mapping helper functions.

net: Add SKB DMA mapping helper functions.

---
 include/linux/skbuff.h |    8 ++++++
 net/core/Makefile      |    1 +
 net/core/skb_dma_map.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 75 insertions(+), 0 deletions(-)
 create mode 100644 net/core/skb_dma_map.c
include/linux/skbuff.h +8 -0
index 4b2be23..aa80ad9 100644
@@ -359,6 +359,14 @@ struct sk_buff {
 
 #include <asm/system.h>
 
+#ifdef CONFIG_HAS_DMA
+#include <linux/dma-mapping.h>
+extern int skb_dma_map(struct device *dev, struct sk_buff *skb,
+		       enum dma_data_direction dir);
+extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb,
+			  enum dma_data_direction dir);
+#endif
+
 extern void kfree_skb(struct sk_buff *skb);
 extern void	       __kfree_skb(struct sk_buff *skb);
 extern struct sk_buff *__alloc_skb(unsigned int size,
net/core/Makefile +1 -0
index b1332f6..26a37cb 100644
@@ -6,6 +6,7 @@ obj-y := sock.o request_sock.o skbuff.o iovec.o datagram.o stream.o scm.o \
 	 gen_stats.o gen_estimator.o net_namespace.o
 
 obj-$(CONFIG_SYSCTL) += sysctl_net_core.o
+obj-$(CONFIG_HAS_DMA) += skb_dma_map.o
 
 obj-y		     += dev.o ethtool.o dev_mcast.o dst.o netevent.o \
 			neighbour.o rtnetlink.o utils.o link_watch.o filter.o
net/core/skb_dma_map.c new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
1.5.6.5.GIT