On Mon, Sep 03, 2001 at 05:01:19PM +0800, Jeff Murphy wrote:
> /* lines i'm interested in - is that what PPWCTLONIRQ means?? */
> int busy = PARPORT_STATUS_PAPEROUT | PARPORT_STATUS_ERROR;
> int ready = PARPORT_STATUS_PAPEROUT | PARPORT_STATUS_ERROR;
No. It means 'write this to the control port the next time an
> ioctl( fd, PPWCTLONIRQ, &busy );
> ioctl( fd, PPWCONTROL, &ready );
So what you're doing here is writing a value to the control port with
PPWCONTROL, and queuing up a response to an interrupt: but the
response is 'no change'.
> res = select( fd+1, &readfds, NULL, NULL, NULL );
And then you're waiting for the interrupt, which never comes since
it's tied to nAck (which presumably your device doesn't touch).
The point about PPWCTLONIRQ is that it's for implementing handshakes.
You write control lines to say 'give me data and then shake nAck', the
peripheral writes data and shakes nAck to trigger an interrupt, and
then the kernel driver (since it's faster than user space) writes the
control lines to say 'okay, thanks, now hold on while I deal with
it'. Then, if user space is in select() it can wake it up.
Does that make sense?
-- To unsubscribe, send mail to: email@example.com --
-- with the single word "unsubscribe" in the body of the message. --
This archive was generated by hypermail 2b29 : Mon Sep 03 2001 - 13:07:56 EDT