summaryrefslogtreecommitdiffstats
path: root/drivers/net/tap.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2017-05-17 12:14:42 +0800
committerDavid S. Miller <davem@davemloft.net>2017-05-18 10:07:41 -0400
commit49f96fd0cb3808e5ff96573f28b3dceb16eb6998 (patch)
tree8813625dcfe4369f90f3b6018131876195a0640c /drivers/net/tap.c
parent83339c6b159ea6429a1db40b0d9d1083ab574733 (diff)
downloadlinux-49f96fd0cb3808e5ff96573f28b3dceb16eb6998.tar.gz
linux-49f96fd0cb3808e5ff96573f28b3dceb16eb6998.tar.bz2
linux-49f96fd0cb3808e5ff96573f28b3dceb16eb6998.zip
tap: export skb_array
This patch exports skb_array through tap_get_skb_array(). Caller can then manipulate skb array directly. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tap.c')
-rw-r--r--drivers/net/tap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 4d4173d25dd0..abdaf867774d 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -1193,6 +1193,19 @@ struct socket *tap_get_socket(struct file *file)
}
EXPORT_SYMBOL_GPL(tap_get_socket);
+struct skb_array *tap_get_skb_array(struct file *file)
+{
+ struct tap_queue *q;
+
+ if (file->f_op != &tap_fops)
+ return ERR_PTR(-EINVAL);
+ q = file->private_data;
+ if (!q)
+ return ERR_PTR(-EBADFD);
+ return &q->skb_array;
+}
+EXPORT_SYMBOL_GPL(tap_get_skb_array);
+
int tap_queue_resize(struct tap_dev *tap)
{
struct net_device *dev = tap->dev;