[Linux-parport] Two processes, one parport
Brent Washburne
brent at fs2.com
Wed May 10 20:08:45 EDT 2006
Hello,
I've scoured the lists and googled everywhere but came up
short-handed. I'm trying to use parport on RedHat 8 (Linux 2.4.20-8) in
two parallel processes. One process handles the data transfer, the
other probes the device for status information.
With just one process, everything works fine. When the second
process tries to read or write data, it always fails. The code PPCLAIMs
the file descriptor (fd) before each read/write and PPRELEASEs it
afterward. There is no problem with claiming or releasing each fd in
each process, but the second process always writes zero bytes and hangs
on read.
When /dev/parport0 is opened with O_NOBLOCK, the read no longer
hangs but simply returns with status=-1 and errno=EAGAIN (Resource
temporarily unavailable). Monitoring the PPRSTATUS value before each
read in the first process always shows 0xD6 (PARPORT_STATUS_BUSY set),
but in the second process it always shows 0x56 (neither BUSY or ERROR
set).
What am I doing wrong, and how can I share the parport with both
processes? Thanks,
Brent Washburne
MIPS Technologies, Inc.
First Silicon Solutions (FS2) Division
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.infradead.org/pipermail/linux-parport/attachments/20060510/672ba56b/attachment.html
More information about the Linux-parport
mailing list