rpmsgdev: add tun device ioctl support

In a multi-core heterogeneous architecture, tun device nodes of protocol
stack core can be accessed by other cores through ioctl

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2023-04-06 14:27:11 +08:00 committed by Xiang Xiao
parent 86ae87b1ec
commit 7b11162b24

View File

@ -32,6 +32,7 @@
#include <poll.h> #include <poll.h>
#include <limits.h> #include <limits.h>
#include <debug.h> #include <debug.h>
#include <net/if.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
@ -39,6 +40,7 @@
#include <nuttx/video/fb.h> #include <nuttx/video/fb.h>
#include <nuttx/mutex.h> #include <nuttx/mutex.h>
#include <nuttx/rptun/openamp.h> #include <nuttx/rptun/openamp.h>
#include <nuttx/net/ioctl.h>
#include <nuttx/drivers/rpmsgdev.h> #include <nuttx/drivers/rpmsgdev.h>
#include "rpmsgdev.h" #include "rpmsgdev.h"
@ -639,6 +641,9 @@ static ssize_t rpmsgdev_ioctl_arglen(int cmd)
case FBIOSET_POWER: case FBIOSET_POWER:
case FBIOGET_POWER: case FBIOGET_POWER:
return sizeof(int); return sizeof(int);
case TUNSETIFF:
case TUNGETIFF:
return sizeof(struct ifreq);
default: default:
return -ENOTTY; return -ENOTTY;
} }