[PARPORT] Parallel port mode

From: Andrius (andriusa@takas.lt)
Date: Mon May 01 2000 - 11:36:26 EDT

  • Next message: Gunther Mayer: "[PARPORT] Superio-4 for Linux-2.3-99pre6, please test"

    Hi
    I'm trying to write my own modules to access to a compaq scanner thru parallel
    port. The are something wrong with port mode and I don't understand what.

    I wrote a code in linux, and everything look good accesing control and status
    ports, but when trying to read data bits always got data bits filled with 1.

    In windows application I'm using initialization code :

    //--------------------------------------
    #define ECR_OFFSET 0x402
    #define CONTROL_PORT 0x2

    // set port base adress to 0x278
    _outp(0x3f0,1);
    _outp(0x3f1,0x97);// for 0x378 BA use 0x96

    // set mode to ECP+EPP
    _outp(0x3f0,4);
    _outp(0x3f1,3);

    // disable DMA
    _outp(0x278+ECR_OFFSET,0x34);
    _outp(0x278+CONTROL_PORT,0x00);

    // set ECP to emulate EPP
    _outp(0x278+ECR_OFFSET,0x80);
    _outp(0x278+CONTROL_PORT,0x04);
    //-------------------------------------

    after port initialization in windows, I'm booting linux on the same computer,
    and then got correct data in my linux application (the port mode remains from
    windows application initialization) until the computer is not turned off (I
    mean power supply, not just shutdown)

    In the BIOS parallel port is always set to EPP.

    What must be initialization code in linux to get "good" port mode ?

    -- 
    Andrius
    

    -- 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 : Mon May 01 2000 - 07:56:58 EDT