Re: [PARPORT] ECP read - FIFO/DMA

From: Tim Waugh (twaugh@redhat.com)
Date: Fri Mar 24 2000 - 04:31:37 EST

  • Next message: Sylvain.Brunet@AirLiquide.com: "[PARPORT] S.O.S S.O.S PLEASE HELP ME PLEASE HELP ME"

    On Fri, 24 Mar 2000, Peter Pregler wrote:

    > I can and am willing (actually EAGER) to test the patch with the
    > cpia-webcam driver, both fifo and dma. I wrote the dma-support for the
    > 2.2.x-version of the driver. So I guess I am able to test it. :)
    > However, I did not see the patch on this list.

    Great. Here it is again.

    Tim.
    */

    Index: drivers/parport/parport_pc.c
    ===================================================================
    RCS file: /usr/local/src/cvsroot/linux/drivers/parport/parport_pc.c,v
    retrieving revision 1.40
    diff -d -u -r1.40 parport_pc.c
    --- drivers/parport/parport_pc.c 2000/03/14 13:55:01 1.40
    +++ drivers/parport/parport_pc.c 2000/03/14 16:45:56
    @@ -178,9 +178,6 @@
             int cnfga;
             const struct parport_pc_private *priv = p->physport->private_data;
     
    - /* Prevent further data transfer. */
    - frob_econtrol (p, 0xe0, ECR_TST << 5);
    -
             /* Adjust for the contents of the FIFO. */
             for (residue = priv->fifo_depth; ; residue--) {
                     if (inb (ECONTROL (p)) & 0x2)
    @@ -862,7 +859,8 @@
                                                            length, flags);
     
             /* Switch to reverse mode if necessary. */
    - if (port->ieee1284.phase != IEEE1284_PH_REV_IDLE) {
    + if ((port->ieee1284.phase != IEEE1284_PH_REV_IDLE) &&
    + (port->ieee1284.phase != IEEE1284_PH_REV_DATA)) {
                     /* Event 38: Set nAutoFd low */
                     parport_frob_control (port,
                                           PARPORT_CONTROL_AUTOFD,
    @@ -879,7 +877,7 @@
                     parport_wait_peripheral (port, PARPORT_STATUS_PAPEROUT, 0);
             }
     
    - /* Set up ECP parallel port mode.*/
    + /* Set up ECP FIFO mode.*/
             parport_pc_data_reverse (port); /* Must be in PS2 mode */
             parport_pc_frob_control (port,
                                      PARPORT_CONTROL_STROBE |
    @@ -951,14 +949,23 @@
                     left--;
             }
     
    + port->ieee1284.phase = IEEE1284_PH_REV_IDLE;
    +
    + /* Go to forward idle mode to shut the peripheral up. */
    + parport_frob_control (port, PARPORT_CONTROL_INIT, 0);
    + parport_wait_peripheral (port,
    + PARPORT_STATUS_PAPEROUT,
    + PARPORT_STATUS_PAPEROUT);
    + port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
    +
             /* Finish up. */
    - if (change_mode (port, ECR_PS2) == -EBUSY) {
    + {
                     int lost = get_fifo_residue (port);
    - printk (KERN_DEBUG "%s: DATA LOSS (%d bytes)!\n", port->name,
    - lost);
    + if (lost)
    + /* Shouldn't happen with compliant peripherals. */
    + printk (KERN_DEBUG "%s: DATA LOSS (%d bytes)!\n",
    + port->name, lost);
             }
    -
    - port->ieee1284.phase = IEEE1284_PH_REV_IDLE;
     
             return length - left;
     }

    -- 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 : Fri Mar 24 2000 - 04:33:02 EST