archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <>
To: Ingo Oeser <>
Cc:, Kernel Mailing List <>
Subject: Re: Make pipe data structure be a circular list of pages, rather
Date: Fri, 14 Jan 2005 13:29:59 -0800 (PST)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, 14 Jan 2005, Ingo Oeser wrote:
> But we have currently no suitable interface for this.
> We have socketpair(), we have pipe(), but we don't have
> dev_pipe() creating a pipe with the driver sitting in the middle.

Not exactly that, no.

But realize that what you are asking for is actually a _much_ simpler 
thing than even "fifo_open()". What you ask for (if somebody really starts 
doing this, and I'd love to see it) is not much more difficult than

	int device_open(struct inode *inode, struct file *filp)
		if (!pipe_new(inode))
			return -ENOMEM;

		/* The hardware is a writer */

		/* The new fd is a reader of the data the hardware generates */
		file->f_op = read_fifo_fops;

		 * This starts the hardware capture - although in real
		 * life there might be a "start it" ioctl or something
		 * that actually does that together with the parameters
		 * for capture..

		return 0;

ie we're definitely not talking rocket science here.

(Yes, I'm sure there are some details missing in the above, but you get 
the idea: the infrastructure really _is_ pretty much there, and any lack 
comes from the fact that nobody has actually ever _used_ it).

> Usage: "processing devices" like crypto processors, DSPs, 
>  MPEG-Encoding/-Decoding hardware, smart cards and the like.
> Synopsys: int dev_pipe(const char *dev_path, int fd_vec[2]);

No, I do NOT think that's what you'd want. 

What you want is more of a

	fd = open("/dev/mpeginput", O_RDONLY);

and then that device driver open just does the thing outlined above.

> We also don't have wire_fds(), which would wire up two fds by 
> connecting the underlying file pointers with each other and closing the fds.

But that is _exactly_ what splice() would do.

So you could have the above open of "/dev/mpeginput", and then you just 
sit and splice the result into a file or whatever.


(Or maybe it's me who doesn't see what it is you want).


  reply	other threads:[~2005-01-14 21:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-08  8:25 Make pipe data structure be a circular list of pages, rather linux
2005-01-08 18:41 ` Linus Torvalds
2005-01-08 21:47   ` Alan Cox
2005-01-13 21:46   ` Ingo Oeser
2005-01-13 22:32     ` Linus Torvalds
2005-01-14 21:03       ` Ingo Oeser
2005-01-14 21:29         ` Linus Torvalds [this message]
2005-01-14 22:12           ` Ingo Oeser
2005-01-14 22:44             ` Linus Torvalds
2005-01-14 23:34               ` Ingo Oeser
2005-01-15  0:16                 ` Linus Torvalds
2005-01-16  2:59                   ` Linus Torvalds
2005-01-17 16:03                     ` Ingo Oeser
2005-01-19 21:12                     ` Make pipe data structure be a circular list of pages, rather than linux
2005-01-20  2:06                       ` Robert White
2005-01-15 23:42 Make pipe data structure be a circular list of pages, rather linux
2005-01-15 22:55 ` Alan Cox
2005-01-16  0:12   ` Linus Torvalds
2005-01-16  2:02     ` Miquel van Smoorenburg
2005-01-16  2:06     ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).