The Linux parport_pc driver seems to detect epp mode based on whether it
is possible to clear the EPP timeout bit:

    static int parport_EPP_supported(struct parport *pb)
    {
            const struct parport_pc_private *priv = pb->private_data;

            /*
             * Theory:
             *      Bit 0 of STR is the EPP timeout bit, this bit is 0
             *      when EPP is possible and is set high when an EPP timeout
             *      occurs (EPP uses the HALT line to stop the CPU while it does
             *      the byte transfer, an EPP timeout occurs if the attached
             *      device fails to respond after 10 micro seconds).
             *
             *      This bit is cleared by either reading it (National Semi)
             *      or writing a 1 to the bit (SMC, UMC, WinBond), others ???
             *      This bit is always high in non EPP modes.
             */

            /* If EPP timeout bit clear then EPP available */
            if (!clear_epp_timeout(pb))
                    return 0;  /* No way to clear timeout */
            ...
    }

It detects ECPEPP (that is, EPP mode where you must manipulate ECR to enter and
leave it) by doing the ECR write and then the EPP test above:
    static int parport_ECPEPP_supported(struct parport *pb)
    {
            struct parport_pc_private *priv = pb->private_data;
            int result;
            unsigned char oecr;
            
            if (!priv->ecr)
                    return 0;

            oecr = inb(ECONTROL(pb));
            /* Search for SMC style EPP+ECP mode */
            ECR_WRITE(pb, 0x80);
            outb(0x04, CONTROL(pb));
            result = parport_EPP_supported(pb);
    ....
    }

Of course, all this code is dependant on CONFIG_PARPORT_1284, and I don't know
whether your kernel has that enabled.

Jeff

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to