Re: Interface for communicating from kernel to user mode

Peter Skvarka <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Organization Soft in Engines
Message-ID <[email protected]>
Thanks for detailed answer.

With help of your description I reached valid file_t* file_fd in kernel 
module.
In kernel module I used file_fd = fd_getfile2(lwp_ptr->l_proc, user_fd); 
which encapsulates your older code.
Also test for descriptor type:
if(file_fd->f_type != DTYPE_SOCKET) {...} is ok, so I have both:
valid file_fd
and
struct socket* so = file_fd->f_undata.fd_so; in kernel module.

What I cannot resolve is which function to use for receiving data sent 
from user mode on retrieved file_fd in kernel module.
When I tried soo_read(file_fd,...) then OS freezes and need to reboot.
I call soo_read() in kernel thread.

Should it be functional or am I doing something wrong ?
Is needed different function for receiving data ? Or needed some 
preparing of file_fd before calling soo_read(file_fd, ...) ?

Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.