Announcement

Collapse
No announcement yet.

driver installation Sensoray 626 card

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    driver installation Sensoray 626 card

    Hi,
    I do not know if I am at the right place but I have a problem with the driver installation for the DAQ card.

    root@ED209:/home/manikantan/Documents/s626_mar07# make
    make -C /lib/modules/2.6.24-22-generic/build M=/home/manikantan/Documents/s626_mar07 SUBDIRS=/home/manikantan/Documents/s626_mar07
    make[1]: Entering directory `/usr/src/linux-headers-2.6.24-22-generic'
    LD /home/manikantan/Documents/s626_mar07/built-in.o
    CC [M] /home/manikantan/Documents/s626_mar07/s626drv.o
    /home/manikantan/Documents/s626_mar07/s626drv.c:64:26: error: linux/config.h: No such file or directory
    /home/manikantan/Documents/s626_mar07/s626drv.c: In function 'S626_init':
    /home/manikantan/Documents/s626_mar07/s626drv.c:777: error: implicit declaration of function 'pci_module_init'
    /home/manikantan/Documents/s626_mar07/s626drv.c: In function 'S626DRV_RequestIRQ':
    /home/manikantan/Documents/s626_mar07/s626drv.c:948: error: 'SA_SHIRQ' undeclared (first use in this function)
    /home/manikantan/Documents/s626_mar07/s626drv.c:948: error: (Each undeclared identifier is reported only once
    /home/manikantan/Documents/s626_mar07/s626drv.c:948: error: for each function it appears in.)
    /home/manikantan/Documents/s626_mar07/s626drv.c:953: warning: passing argument 2 of 'request_irq' from incompatible pointer type
    make[2]: *** [/home/manikantan/Documents/s626_mar07/s626drv.o] Error 1
    make[1]: *** [_module_/home/manikantan/Documents/s626_mar07] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-22-generic'
    make: *** [all] Error 2
    Want to know what the parts passing argument 2 of 'request_irq' from incompatible pointer type and implicit declaration of function 'pci_module_init' mean....

    I am trying to compile and install drivers.

    Prem


    #2
    Re: driver installation Sensoray 626 card

    From the look of:

    /home/manikantan/Documents/s626_mar07/s626drv.c:64:26: error: linux/config.h: No such file or directory

    I'd say you have one of more dependent development library files missing or can't be found, does it come with a ./configure script? and if so have you run it to check system sanity?

    Failing that can you point to a web site where the driver came from.

    Comment


      #3
      Re: driver installation Sensoray 626 card

      Ok, just found and downloaded a copy...
      The config.h file is because the name change in kernel 2.6.21 (I think) it's now called autoconf.h;
      that isn't the only problem...a number of the API's used by this driver changed at the same time...

      Comment


        #4
        Re: driver installation Sensoray 626 card

        Got it building...

        In s626drv.c add/change just after all the ifdef DEBUG stuff

        ~~
        #define DBGI(x...)
        #endif

        //Added for post-2.6.21 kernel
        #ifndef SA_SHIRQ
        #define SA_SHIRQ IRQF_SHARED
        #endif

        #ifndef pci_module_init
        #define pci_module_init pci_register_driver
        #endif

        // The necessary header files
        #include <linux/version.h>
        #include <linux/autoconf.h>

        ~~
        ~~

        I can't test if it works, but at least it now builds.

        I quite enjoyed that little bit of exercise... got any more?

        Comment


          #5
          Re: driver installation Sensoray 626 card

          Thanks a lot Windy...
          It got it running and installed modules and other stuff
          Now I am trying the make install function... Will tell you if I have any more problems

          Comment


            #6
            Re: driver installation Sensoray 626 card

            Windy...

            I used your pointers and it helped me as well, thank you. but i am getting another warning; now i know its a warning but it seems like it might be kind of important. I have not hacked any C for a loooong time and certainly no kernel hacking; what do you make of this:

            /sensoray/s626drv.c:964: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type

            969: request = request_irq (irq, handleallinterrupts, flags, board->name, dev_id)

            handleallinterupts: static void handleallinterrupts( int irq, void *dev_id, struct pt_regs *regs)

            the definition for request_irq is as follows:
            int request_irq (unsigned int irq, void (*handler) (int, void *, struct pt_regs *), unsigned long irqflags, const char *devname, void *dev_id);

            It looks like the second argument is expecting a pointer, but i cant seem to get a cast to respond properly; i may be asking a noobish question so please be nice

            thanks in advance.



            Comment


              #7
              Re: driver installation Sensoray 626 card

              From what I can see it just needs a cast on the interrupt handler (handleallinterrupts), something like this:

              request = request_irq (irq, (void *)handleallinterrupts, flags, board->name, dev_id);

              As before, I can't test it, so I'm not 100% certain...

              Let me know if it works, these problems and changes need to be fed back to the suppliers; then they can fix things properly .

              Comment

              Working...
              X