[PARPORT] Unable to open /dev/parport0

From: John O'Connor (joconnor@orga.com)
Date: Fri Oct 20 2000 - 08:31:24 EDT

  • Next message: Ulrich: "[PARPORT] Mustek ScanExpress 1200 CP+"

    Hi, I'm trying to write some code to use the parport interface unser
    2.4.0.

    I have an HP Vectra on which I am running the 2.4.0-test9 kernel.

    I built the kernel without modules but with the parport drivers
    statically included in the kernel.

    It appears that the software has recognised my hardware. If I do an ls
    -lR of /proc/sys/dev/parport then I see the following files and I have
    indicated their contents:

    /proc/sys/dev/parport > ls -lR
    .:
    total 8
    dr-xr-xr-x 2 root root 0 Oct 20 13:37 default
    dr-xr-xr-x 3 root root 0 Oct 20 13:37 parport0
     
    ./default:
    total 8
    -rw-r--r-- 1 root root 0 Oct 20 13:37 spintime
    500
    -rw-r--r-- 1 root root 0 Oct 20 13:37 timeslice
    200
     
    ./parport0:
    total 44
    -r--r--r-- 1 root root 0 Oct 20 13:37 autoprobe
    -r--r--r-- 1 root root 0 Oct 20 13:37 autoprobe0
    -r--r--r-- 1 root root 0 Oct 20 13:37 autoprobe1
    -r--r--r-- 1 root root 0 Oct 20 13:37 autoprobe2
    -r--r--r-- 1 root root 0 Oct 20 13:37 autoprobe3
    -r--r--r-- 1 root root 0 Oct 20 13:37 base-addr
    888 1912
    dr-xr-xr-x 2 root root 0 Oct 20 13:37 devices
    -r--r--r-- 1 root root 0 Oct 20 13:37 dma
    -1
    -r--r--r-- 1 root root 0 Oct 20 13:37 irq
    -1
    -r--r--r-- 1 root root 0 Oct 20 13:37 modes
    PCSPP,TRISTATE,EPP
    -rw-r--r-- 1 root root 0 Oct 20 13:37 spintime
    500
     
    ./parport0/devices:
    total 12
    -r--r--r-- 1 root root 0 Oct 20 13:37 active
    none

    If I run the code below, I always get an error. The error number is 19
    which is:

    #define ENODEV 19 /* No such device */

    I have set access on /dev/paeport0 so that all users have read write
    access. (If I do not, I get errno 13 and not 19 so I guess that the
    error 19 is not caused by access problems.

    #define EACCES 13 /* Permission denied */¨

    Any suggestions?

    int main(int argc, char **argv)
    {
      int fd;
      int mode; /* We'll need this later. */
     
      fd = open ("/dev/parport1", O_RDONLY);
      if (fd == -1) {
        printf ("Error trying to open the parallel port\n");
        printf("Errno is %i\n", errno);
        return 1;
      }
      return 0;
    }

    Thanks in advance

    John

    -- 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 Oct 20 2000 - 08:35:25 EDT