[PARPORT] Bug or feature?

From: David Lambert (dave_lambert@fbcc.com)
Date: Tue Jul 31 2001 - 10:18:26 EDT

  • Next message: Tim Waugh: "Re: [PARPORT] Bug or feature?"

    I think I may have found a slight problem with IEEE1284 (ECP) direction
    changing in ieee1284_ops.c. Consider the following scenario:

    Initially the phase is IEEE1284_PH_FWD_IDLE following a write. A read is
    posted that causes ecp_forward_to_reverse to be entered. If this fails (in
    this case due to faulty firmware on the peripheral) the read returns with 0
    bytes read (no error?). At this point the hardware may be in an indeterminate
    state. A subsequent write does not attempt to change direction because the
    state is still IEEE1284_PH_FWD_IDLE. See code snippet:

            if (port->ieee1284.phase != IEEE1284_PH_FWD_IDLE)
                    if (ecp_reverse_to_forward (port))
                            return 0;

    I would propose adding another state IEEE1284_PH_FWD_UNKNOWN that would be
    raised on such error conditions, thus forcing subsequent operations to retry.
    Also, why does the read operation apparently succeed?



    -- To unsubscribe, send mail to: linux-parport-request@torque.net --
    -- with the single word "unsubscribe" in the body of the message. --

    This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 10:29:23 EDT