Q: using named pipe in kernel-module2

Q: using named pipe in kernel-module2

Post by demus pete » Thu, 20 Jun 2002 17:02:04



Hello !

I want to do communication between tool-like tcp/ip application and a kernel
module. my
idea is to use a named pipe (created by mkpipe /tmp/XXin) i.e. a FIFO.

the communication using /dev/XXmy-module is already used to communicate via a
real device.

is there a better way by creating a Pipe in /proc fs ? or cummincating via
ioctl. i have to transfer streaming data....

this is the read_byte()-function of my module i have written: direction
Pipe --> /dev/XXmy-module

fSource = filp_open( sSource, O_RDONLY | O_NONBLOCK, 0);
if ( IS_ERR( fSource) )
{
   printk("Comserver: error %ld opening Pipe %s\n", -PTR_ERR(fSource),
sSource);

Quote:}

else
{
if ( fSource->f_op && fSource->f_op->read)
{
   ret = fSource->f_op->read( fSource, buffer , PAGE_SIZE, &fSource->f_pos );
   if ( ret < 0)

i'm getting always error 11 (EAGAIN) at the read statement. Why ? how should i
open and use a
Pipe ?

on the other side the write_byte() routine is working well. so i can do a cat
"hello" >/dev/XXmy-modul and it's going throught the module via the PIPE to the
TTCP/IP-appl.

thanks peter

 
 
 

Q: using named pipe in kernel-module2

Post by demus pete » Thu, 20 Jun 2002 17:02:10


Hello !

I want to do communication between tool-like tcp/ip application and a kernel
module. my
idea is to use a named pipe (created by mkpipe /tmp/XXin) i.e. a FIFO.

the communication using /dev/XXmy-module is already used to communicate via a
real device.

is there a better way by creating a Pipe in /proc fs ? or cummincating via
ioctl. i have to transfer streaming data....

this is the read_byte()-function of my module i have written: direction
Pipe --> /dev/XXmy-module

fSource = filp_open( sSource, O_RDONLY | O_NONBLOCK, 0);
if ( IS_ERR( fSource) )
{
   printk("Comserver: error %ld opening Pipe %s\n", -PTR_ERR(fSource),
sSource);

Quote:}

else
{
if ( fSource->f_op && fSource->f_op->read)
{
   ret = fSource->f_op->read( fSource, buffer , PAGE_SIZE, &fSource->f_pos );
   if ( ret < 0)

i'm getting always error 11 (EAGAIN) at the read statement. Why ? how should i
open and use a
Pipe ?

on the other side the write_byte() routine is working well. so i can do a cat
"hello" >/dev/XXmy-modul and it's going throught the module via the PIPE to the
TTCP/IP-appl.

thanks peter

 
 
 

1. Q: using named pipe in kernel-module

Hello !

I want to do communication between user application and a kernel module. my
idea is to use a named pipe (created by mkpipe /tmp/XXin)

this is the read_byte()-function of my module i have written: direction
Pipe --> /dev/XXmy-module

fSource = filp_open( sSource, O_RDONLY | O_NONBLOCK, 0);

if ( IS_ERR( fSource) )

{

printk("Comserver: error %ld opening Pipe %s\n", -PTR_ERR(fSource), sSource);

else

{

if ( fSource->f_op && fSource->f_op->read)

{

ret = fSource->f_op->read( fSource, buffer , PAGE_SIZE, &fSource->f_pos );

if ( ret < 0)

i'm getting always error 11 at the read statement. Whyy ? how should i use a
Pipe ? where can i find the error numbers and meaning ?

the other side the write_byte() routine is working well. so i can do a cat
"hello" >/dev/XXmy-modul.

thanks peter

2. finger : evulate ^[ ( ie ESC ) (Q)

3. Any compatibility between Unix Named Pipes and NT Named Pipes??

4. SLIP and gnuEmacs

5. Using Named Pipes

6. Q: Setup for Trident 3DImage985

7. client / server using named pipes

8. Linux and NT 4 Svr communication??

9. named pipes versus the unnamed pipeline using "|"

10. Using c++ ifstream with named pipe

11. Using named pipes in Linux

12. Please Help - Linux:Having trouble using fifo (named pipes)

13. Functions LOCK & UNLOCK using NAMED PIPES and CREATE & UNLINK