Commit 04df9389 authored by Sebastian Smolorz's avatar Sebastian Smolorz Committed by Jan Kiszka

rtdm: expose user-side file descriptors to drivers

RTDM drivers refer to open files or sockets by using struct rtdm_fd.
Normally, the user-side file descriptors returned by socket() or open()
calls are not necessary for driver operations. However, in some special
cases the user-side fd has to be determined, for example as return
value of rt_tcp_accept() which is a driver function of RTnet's TCP
protocol driver.
Signed-off-by: default avatarSebastian Smolorz <sebastian.smolorz@gmx.de>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent bed7acf3
......@@ -298,6 +298,7 @@ struct rtdm_fd {
struct rtdm_fd_ops *ops;
struct cobalt_ppd *owner;
unsigned int refs;
int ufd;
int minor;
int oflags;
#ifdef CONFIG_XENO_ARCH_SYS3264
......@@ -320,6 +321,11 @@ static inline struct cobalt_ppd *rtdm_fd_owner(const struct rtdm_fd *fd)
return fd->owner;
}
static inline int rtdm_fd_ufd(const struct rtdm_fd *fd)
{
return fd->ufd;
}
static inline int rtdm_fd_minor(const struct rtdm_fd *fd)
{
return fd->minor;
......
......@@ -166,6 +166,7 @@ int rtdm_fd_enter(struct rtdm_fd *fd, int ufd, unsigned int magic,
fd->magic = magic;
fd->ops = ops;
fd->owner = ppd;
fd->ufd = ufd;
fd->refs = 1;
set_compat_bit(fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment