handling multiple sorts of data from device

From: Capstar (spam0_at_deleg.homeip.net)
Date: 04/22/04


Date: Thu, 22 Apr 2004 09:42:33 +0200

Hi NG,

I'm writing a device driver for a PCI-device, which contains an embedded
processor. Nothing fancy or anything, but this processor can on occasion
send messages or some data over the bus. The real functionality of the
device is to proces data. So the read and write operations are used to
read and write the data, which needs to be processed.
So what I want is to have an extra thread (not a kernel thread) that
wait's for data from the embedded processor, and fetches it. The waiting
is not a problem, I'll just use a blocking ioctl-call, since select only
works for the (to-be-)processed data. But I'm quite lost on how to fetch
the data. The driver already takes care of retreiving the buffer over
the bus and storing it in kernel memory, so I just need to get it to
userspace.

I can probably mmap the page I use for storing the buffer, but that
means I need to also lock that page so I don't write and read it at the
same time. And I don't realy like the idea of accessing kernel space
direcly altough it would probably be handled from a library.

Another approach would be to register to devices in the /dev/filesystem,
one for the (to-be-)processed data, and one for the stuff from this
embedded processor. But I'm not quite sure how to do that.

Any suggestions are welcome.

   Mark

-- 
<<Remove the del for email>>


Relevant Pages

  • Re: Trap number: how a system software recognise it?
    ... MINIX has no concept of "device recognition". ... discuss how to implement a new device driver - not so much documentation ... > driver code at the kernel space to perform the low level instructions. ... User program issues readlibc function to read some bytes from ...
    (comp.os.linux.misc)
  • Re: Trap number: how a system software recognise it?
    ... MINIX has no concept of "device recognition". ... discuss how to implement a new device driver - not so much documentation ... > driver code at the kernel space to perform the low level instructions. ... User program issues readlibc function to read some bytes from ...
    (comp.os.linux.development.system)
  • Re: Process D-stated in generic_unplug_device
    ... After a recent kernel upgrade (essentially 2.6.15.4 + a selection of other ... Please test vanilla 2.6.16-rc3 and let us know what block device driver is ... element of the production server that I can't duplicate in the lab right now ... Given that we can't replicate the problem on our lab hardware, ...
    (Linux-Kernel)
  • waiting process in procfs read
    ... I submitted this as a bugzilla kernel bug report but was directed here. ... My device driver sets up an entry in the /proc tree. ... If I kill the waiting process I do see "WOKE UP" and "returns error due to ... I can not see any reason why the waiting process wouldn't wake up. ...
    (Linux-Kernel)
  • 11i: Kernel build error - +ES1.Xindirect_calls
    ... We're trying to get a kernel built (with our non-DLKM device driver) on ... an 11i system that's using vPars ... ... Loading the kernel... ... If we put a printf() into our device ...
    (comp.sys.hp.hpux)