Menu

Problems with linux driver

Help
2009-01-29
2013-05-09
  • Nobody/Anonymous

    Of course I tried to find a solution before writing this post!!
    I can't compile the driver on linux.
    I saw on a thread on this forum that someone says taht it is necessary to change some values on the *.c file, includes path and to remove a line of a var "owner".
    I changed the include value and run make command and it returned some errors and warnings, so I removed the "owner" variable and run the make command.
    This is what I got:
    billy@umelbi:~/Programs/Drivers/usb2mpi-Linux-2.6$ make
    make -C /lib/modules/2.6.24-23-generic/build M=/home/billy/Programs/Drivers/usb2mpi-Linux-2.6 modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.24-23-generic'
      CC [M]  /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.o
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:40: error: variable ‘siemens_usb_mpi_device’ has initializer but incomplete type
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:41: error: unknown field ‘owner’ specified in initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:41: warning: excess elements in struct initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:41: warning: (near initialization for ‘siemens_usb_mpi_device’)
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:42: error: unknown field ‘name’ specified in initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:42: warning: excess elements in struct initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:42: warning: (near initialization for ‘siemens_usb_mpi_device’)
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:43: error: unknown field ‘id_table’ specified in initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:43: warning: excess elements in struct initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:43: warning: (near initialization for ‘siemens_usb_mpi_device’)
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:44: error: unknown field ‘num_interrupt_in’ specified in initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:44: warning: excess elements in struct initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:44: warning: (near initialization for ‘siemens_usb_mpi_device’)
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:45: error: unknown field ‘num_bulk_in’ specified in initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:45: warning: excess elements in struct initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:45: warning: (near initialization for ‘siemens_usb_mpi_device’)
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:46: error: unknown field ‘num_bulk_out’ specified in initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:46: warning: excess elements in struct initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:46: warning: (near initialization for ‘siemens_usb_mpi_device’)
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:47: error: unknown field ‘num_ports’ specified in initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:47: warning: excess elements in struct initializer
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:47: warning: (near initialization for ‘siemens_usb_mpi_device’)
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c: In function ‘siemens_usb_mpi_init’:
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:54: warning: passing argument 1 of ‘usb_serial_register’ from incompatible pointer type
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:64: warning: passing argument 1 of ‘usb_serial_deregister’ from incompatible pointer type
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c: In function ‘siemens_usb_mpi_exit’:
    /home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.c:72: warning: passing argument 1 of ‘usb_serial_deregister’ from incompatible pointer type
    make[2]: *** [/home/billy/Programs/Drivers/usb2mpi-Linux-2.6/siemens_mpi.o] Error 1
    make[1]: *** [_module_/home/billy/Programs/Drivers/usb2mpi-Linux-2.6] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-23-generic'
    make: *** [modules] Error 2

    can someone help me, please?
    thanks,
    bye.

     
    • Cpt. Spock

      Cpt. Spock - 2009-02-01

      Hi!

      A few days ago, I found the following site.

      http://kerneltrap.org/index.php?q=mailarchive/git-commits-head/2009/1/8/4638814

      I copied the three files in my kernel source tree, made a config and compiled everything. The new module loads fine, but I can't connect to my PLC. The command

      testMPI -3 -d /dev/ttyUSB0,

      which worked before I upgraded my OS to OpenSuSE 11.0 with kernel 2.6.25.18-0.2-pae, only returns "I/O possible". I use libnodave v0.8.4.4.

      Before the system upgrade, I used OpenSuSE 10.2 with kernel 2.6.18.8-0.5-default. I think something in the kernel changed, and that is why the kernel module doesn't work anymore.

      Live long and prosper!

      Cpt. Spock

       
      • Cpt. Spock

        Cpt. Spock - 2009-02-01

        Hi!

        I found a solution for my "I/O possible" problem. I had to edit setport.c and include the call

        signal(SIGIO, SIG_IGN);

        as mentioned here:

        http://www.linuxforums.org/forum/linux-programming-scripting/126497-read-i-o-possible-2.html

        Don't forget to include signal.h.

        Bye.

         
        • dirkte_bie

          dirkte_bie - 2009-03-09

          hello,

          i have the same problem on debian with the 2.6.26 kernel. with kernel 2.6.18 there is no problem with all.

          please post your new code of the "setport.c".
          so i can try the changes with the kernel 2.6.26 and my simatic s5 (cpu 942).

          best regards
          dirk t.

           
          • Cpt. Spock

            Cpt. Spock - 2009-03-13

            Hi!

            Here is my patch to setport.c. Use patch to add it to the source file.

            --> snip
            --- setport.c    2009-02-01 18:26:37.000000000 +0100
            +++ ../libnodave_v0.8.4.4_clean/setport.c    2007-10-26 13:56:54.000000000 +0200
            @@ -29,7 +29,6 @@
            #include <errno.h>
            #include <string.h>
            #include <ctype.h>
            -#include <signal.h>
            #include "setport.h"
            #define debug 0
            #define ThisModule "setPort : "
            @@ -38,9 +37,6 @@
            {
                 int fd,res;
                 struct termios oldtio, newtio;
            -   
            -    signal(SIGIO, SIG_IGN);
            -   
                 fd = open(name,  O_RDWR | O_NOCTTY | O_NONBLOCK);
            #if debug >3
                 printf(ThisModule "%s = %d\n", name, fd);  
            --> snip

            Live long and prosper!

            Cpt. Spock

             
    • Nobody/Anonymous

      Ok, thank you very much.
      I'll try this solution.

       

Anonymous
Anonymous

Add attachments
Cancel