Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

0.1.5 lirc_mod_mce 2.6.23 compile error

Help
PLC Man
2008-04-22
2013-04-15
  • PLC Man
    PLC Man
    2008-04-22

    Florian

    lirc_mod_mce 0.1.5
    lirc-0.8.3-CVS-pvr150-2
    Knoppmyth
    Debian sarge 2.6.23
    MCE remote model 1039 hardware discription 0471:0815 Phillips
    MCE Multimedia keyboard

    We have had two different people with different hardware report the same compile errors with 0.1.5.
    Have built with included lirc files and lirc-0.8.3-pre1 with identical outcome.
    /config.h
    /lirc.h
    /lirc_dev.h

    > make
    make -C /lib/modules/2.6.23-chw-4/build SUBDIRS=/tmp/lirc_mod_mce_org modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.23-chw-4'
      CC [M]  /tmp/lirc_mod_mce_org/lirc_mod_mce.o
    /tmp/lirc_mod_mce_org/lirc_mod_mce.c: In function 'usb_remote_probe':
    /tmp/lirc_mod_mce_org/lirc_mod_mce.c:1112: error: implicit declaration of function 'BIT_WORD'
    /tmp/lirc_mod_mce_org/lirc_mod_mce.c:1112: error: implicit declaration of function 'BIT_MASK'
    make[2]: *** [/tmp/lirc_mod_mce_org/lirc_mod_mce.o] Error 1
    make[1]: *** [_module_/tmp/lirc_mod_mce_org] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.23-chw-4'
    make: *** [default] Error 2

    In the lirc_mod_mce.c file I find these two error words but do not know how to correct them.

    input_dev->evbit[BIT_WORD(EV_KEY)] |= BIT_MASK(EV_KEY);
        input_dev->evbit[BIT_WORD(EV_REL)] |= BIT_MASK(EV_REL);
        input_dev->relbit[BIT_WORD(REL_X)] |= BIT_MASK(REL_X);
        input_dev->relbit[BIT_WORD(REL_Y)] |= BIT_MASK(REL_Y);
       
        for (i=0; i<256; i++) {
          set_bit(usb_kbd_keycode[i], input_dev->keybit);
        }
       
        clear_bit(0, input_dev->keybit);
        input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT);
        input_dev->keybit[BIT_WORD(BTN_RIGHT)] |= BIT_MASK(BTN_RIGHT);

    If I search for ether of these two statements most of the hits come back as problems only occurring in 2.6.23.
    error: implicit declaration of function 'BIT_WORD'
    error: implicit declaration of function 'BIT_MASK'

    Please Advise
    Brad

     
    • Florian Demski
      Florian Demski
      2008-04-23

      Brad,

      as I quickly looked up, the BIT_* macros have been introduced in kernel 2.6.24.

      Just put those lines somewhere after the #include lines in the source code. I'll see if I can modify the source code to be compilable with older kernel versions, too.

      #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
      #define BIT_WORD(nr) ((nr) / BITS_PER_LONG)

      Florian

       
    • PLC Man
      PLC Man
      2008-04-23

      Florian

      Modify by your instructions

      #include "lirc.h"
      #include "kcompat.h"
      #include "lirc_dev.h"

      #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
      #define BIT_WORD(nr) ((nr) / BITS_PER_LONG)

      #define DRIVER_VERSION          "0.1.5"
      #define DRIVER_AUTHOR           "Florian Demski"
      #define DRIVER_DESC             "Input driver for Microsoft MCE 2005 keyboard"
      #define DRIVER_NAME             "lirc_mod_mce"

      I ran "make" with included lirc files and lirc-0.8.3-pre1, both produced the same verbose. Both produced a .ko file. Both modules would load. Only the "make" run with lirc-0.8.3-pre1 files would work after being loaded.

      kcompat.h................Version 5.32 2007/12/15..............lirc version pre 8.3
      lirc.h........................Version 5.13 2007/09/27..............lirc version pre 8.3
      lirc_dev.h.................Version 1.21 2007/09/27..............lirc version pre 8.3 

      > make
      make -C /lib/modules/2.6.23-chw-4/build SUBDIRS=/tmp/lirc_mod_mce modules
      make[1]: Entering directory `/usr/src/linux-headers-2.6.23-chw-4'
        CC [M]  /tmp/lirc_mod_mce/lirc_mod_mce.o
        Building modules, stage 2.
        MODPOST 1 modules
      WARNING: "lirc_register_plugin" [/tmp/lirc_mod_mce/lirc_mod_mce.ko] undefined!
      WARNING: "lirc_get_pdata" [/tmp/lirc_mod_mce/lirc_mod_mce.ko] undefined!
      WARNING: "lirc_unregister_plugin" [/tmp/lirc_mod_mce/lirc_mod_mce.ko] undefined!
        CC      /tmp/lirc_mod_mce/lirc_mod_mce.mod.o
        LD [M]  /tmp/lirc_mod_mce/lirc_mod_mce.ko
      make[1]: Leaving directory `/usr/src/linux-headers-2.6.23-chw-4'

      We have only warnings and no errors both produced this verbose.

      This is the non working dmesg built with original lirc files

      > dmesg | grep lirc
      lirc_dev: IR Remote Control driver registered, major 61
      lirc_mod_mce: Input driver for Microsoft MCE 2005 keyboard v0.1.5
      lirc_mod_mce: Florian Demski
      lirc_dev: lirc_register_plugin: sample_rate: 0
      lirc_dev: lirc_register_plugin: no module owner registered
      lirc_mod_mce[3]: out of memory (code=9)
      lirc_mod_mce: probe of 1-1:1.0 failed with error -12
      usbcore: registered new interface driver lirc_mod_mce

      This is the working dmesg build with lirc-0.8.3-pre1 files

      > dmesg | grep lirc
      lirc_dev: IR Remote Control driver registered, major 61
      lirc_mod_mce: Input driver for Microsoft MCE 2005 keyboard v0.1.5
      lirc_mod_mce: Florian Demski
      lirc_dev: lirc_register_plugin: sample_rate: 0
      lirc_mod_mce[3]: Philips eHome Infrared Transceiver on usb1:3
      usbcore: registered new interface driver lirc_mod_mce

      Your six hardware descriptions show up so it must be lirc_mod_mce 0.1.5

      > modinfo lirc_mod_mce
      filename:       /lib/modules/2.6.23-chw-4/misc/lirc_mod_mce.ko
      license:        GPL
      author:         Florian Demski
      description:    Input driver for Microsoft MCE 2005 keyboard
      alias:          usb:v2304p0225d*dc*dsc*dp*ic*isc*ip*
      alias:          usb:v107Bp3009d*dc*dsc*dp*ic*isc*ip*
      alias:          usb:v1308pC001d*dc*dsc*dp*ic*isc*ip*
      alias:          usb:v1460p9150d*dc*dsc*dp*ic*isc*ip*
      alias:          usb:v0609p031Dd*dc*dsc*dp*ic*isc*ip*
      alias:          usb:v0471p0815d*dc*dsc*dp*ic*isc*ip*
      depends:        usbcore
      vermagic:       2.6.23-chw-4 SMP preempt mod_unload 586
      parm:           debug:Debug enabled or not (bool)

      How can mouse speed and acceleration be adjusted for only the MCE keyboard?
      I have looked in /etc/X11/xorg.conf but only the hardwire mouse and keyboard show up there. Even an adjustment in the lirc_mod_mce.c would work for me.

      I will test your updates for you when you are ready. Just post back here.
      Thank you
      Brad

       
      • richard joss
        richard joss
        2008-04-24

        Brad/Florian - just for your info.  I do not get the BIT warnings when I run make with the ubuntu 2.6.24.16-generic kernel.  But I do get the rest which is the same as yours:

        richard@antec:~/downloads/lirc_mod_mce$ make
        make -C /lib/modules/2.6.24-16-generic/build SUBDIRS=/home/richard/downloads/lirc_mod_mce modules
        make[1]: Entering directory `/usr/src/linux-headers-2.6.24-16-generic'
          Building modules, stage 2.
          MODPOST 1 modules
        WARNING: "lirc_register_plugin" [/home/richard/downloads/lirc_mod_mce/lirc_mod_mce.ko] undefined!
        WARNING: "lirc_get_pdata" [/home/richard/downloads/lirc_mod_mce/lirc_mod_mce.ko] undefined!
        WARNING: "lirc_unregister_plugin" [/home/richard/downloads/lirc_mod_mce/lirc_mod_mce.ko] undefined!
        make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-16-generic'
        richard@antec:~/downloads/lirc_mod_mce$

        Also, I discovered (you probably know this already) that the main keys on the mce keyboard and the mouse both work just fine without lirc running.  I am typing on the keyboard at this moment, but see:

        richard@antec:~$ ps aux |grep lirc
        richard   6406  0.0  0.0   3004   764 pts/0    S+   09:47   0:00 grep lirc
        richard@antec:~$
        richard@antec:~$ lsmod |grep lirc
        lirc_mod_mce           18052  0
        lirc_dev               15732  1 lirc_mod_mce
        usbcore               146028  5 lirc_mod_mce,usbhid,ehci_hcd,uhci_hcd
        richard@antec:~$

        Presumably this means no lirc loaded?

        The driver still seems to be loading fine:

        richard@antec:~/downloads/lirc_mod_mce$ dmesg |grep lirc
        [   29.668747] lirc_dev: IR Remote Control driver registered, at major 61
        [   29.755662] lirc_mod_mce: no version for "lirc_get_pdata" found: kernel tainted.
        [   29.775994] lirc_mod_mce: Input driver for Microsoft MCE 2005 keyboard v0.1.5
        [   29.776141] lirc_mod_mce: Florian Demski
        [   30.065680] lirc_dev: lirc_register_plugin: sample_rate: 0
        [   30.143464] lirc_mod_mce[2]: SMK eHome Infrared Transceiver on usb3:2
        [   30.143589] usbcore: registered new interface driver lirc_mod_mce
        richard@antec:~/downloads/lirc_mod_mce$

        If I then fire up the original lirc I get this:

        richard@antec:~/downloads/lirc_mod_mce$ sudo /etc/init.d/lirc start
        * Loading LIRC modules                                                             [ OK ]
        * Starting remote control daemon(s) : LIRC                                         [ OK ]
        richard@antec:~/downloads/lirc_mod_mce$
        richard@antec:~/downloads/lirc_mod_mce$ ps aux |grep lirc
        root      6678  0.0  0.0   2932   496 ?        Ss   10:00   0:00 /usr/sbin/lircd --device=/dev/lirc0

        But if I remove the driver and then reinsert it while lirc is running I get similar warnings to your post, and the keyboard stops working (had to switch to PS2 keyboard):

        richard@antec:~/downloads/lirc_mod_mce$ sudo rmmod lirc_mod_mce
        richard@antec:~/downloads/lirc_mod_mce$
        richard@antec:~/downloads/lirc_mod_mce$ sudo insmod /lib/modules/2.6.24-16-generic/ubuntu/misc/lirc_mod_mce.ko

        richard@antec:~/downloads/lirc_mod_mce$ dmesg |grep lirc
        [   29.668747] lirc_dev: IR Remote Control driver registered, at major 61
        [   29.755662] lirc_mod_mce: no version for "lirc_get_pdata" found: kernel tainted.
        [   29.775994] lirc_mod_mce: Input driver for Microsoft MCE 2005 keyboard v0.1.5
        [   29.776141] lirc_mod_mce: Florian Demski
        [   30.065680] lirc_dev: lirc_register_plugin: sample_rate: 0
        [   30.143464] lirc_mod_mce[2]: SMK eHome Infrared Transceiver on usb3:2
        [   30.143589] usbcore: registered new interface driver lirc_mod_mce
        [  919.291057] usbcore: deregistering interface driver lirc_mod_mce
        [  919.341884] lirc_mod_mce[2]: usb remote disconnected
        [ 1021.016314] lirc_mod_mce: Input driver for Microsoft MCE 2005 keyboard v0.1.5
        [ 1021.016326] lirc_mod_mce: Florian Demski
        [ 1021.277107] lirc_dev: lirc_register_plugin: sample_rate: 0
        [ 1021.277114] lirc_dev: lirc_register_plugin: no module owner registered
        [ 1021.277126] lirc_mod_mce[2]: out of memory (code=9)
        [ 1021.277158] lirc_mod_mce: probe of 3-1:1.0 failed with error -12
        [ 1021.277192] usbcore: registered new interface driver lirc_mod_mce
        richard@antec:~/downloads/lirc_mod_mce$

        Nothing I do will get the keyboard working again (even if I stop lirc and then reinsert the driver).

        I will try with the 0.8.3 lirc and see if i get the same results.

        Regards

        Richard

         
        • richard joss
          richard joss
          2008-04-24

          OK - I installed lirc_0.8.3.

          First, what happens is that during the boot I get the message "lirc-0.8.3 Already Installed on this Kernel".  Then I find that lirc has not loaded:

          richard@antec:~$ ps aux |grep lirc
          richard   6542  0.0  0.0   3004   768 pts/0    S+   10:33   0:00 grep lirc
          richard@antec:~$

          and the same problems with the driver it seems:

          richard@antec:~$ dmesg |grep lirc
          [   29.479773] lirc_dev: IR Remote Control driver registered, major 61
          [   29.557104] lirc_mod_mce: no version for "lirc_get_pdata" found: kernel tainted.
          [   29.559526] lirc_mod_mce: Input driver for Microsoft MCE 2005 keyboard v0.1.5
          [   29.559663] lirc_mod_mce: Florian Demski
          [   29.926110] lirc_dev: lirc_register_plugin: sample_rate: 0
          [   29.926207] lirc_dev: lirc_register_plugin: no module owner registered
          [   29.926307] lirc_mod_mce[2]: out of memory (code=9)
          [   29.926409] lirc_mod_mce: probe of 3-2:1.0 failed with error -12
          [   29.926533] usbcore: registered new interface driver lirc_mod_mce
          richard@antec:~$

          So I load lirc and then check dmesg again.  Same thing:

          richard@antec:~$ sudo /etc/init.d/lirc start
          * Loading LIRC modules                                                                    [ OK ]
          * Starting remote control daemon(s) : LIRC                                                [ OK ]
          richard@antec:~$
          richard@antec:~$
          richard@antec:~$ dmesg |grep lirc
          [   29.479773] lirc_dev: IR Remote Control driver registered, major 61
          [   29.557104] lirc_mod_mce: no version for "lirc_get_pdata" found: kernel tainted.
          [   29.559526] lirc_mod_mce: Input driver for Microsoft MCE 2005 keyboard v0.1.5
          [   29.559663] lirc_mod_mce: Florian Demski
          [   29.926110] lirc_dev: lirc_register_plugin: sample_rate: 0
          [   29.926207] lirc_dev: lirc_register_plugin: no module owner registered
          [   29.926307] lirc_mod_mce[2]: out of memory (code=9)
          [   29.926409] lirc_mod_mce: probe of 3-2:1.0 failed with error -12
          [   29.926533] usbcore: registered new interface driver lirc_mod_mce

          So I remove and reinsert the driver, still with lirc running, and get better results:

          [  139.699335] usbcore: registered new interface driver lirc_mod_mce
          [  205.434584] usbcore: deregistering interface driver lirc_mod_mce
          [  210.977227] lirc_mod_mce: Input driver for Microsoft MCE 2005 keyboard v0.1.5
          [  210.977235] lirc_mod_mce: Florian Demski
          [  211.238220] lirc_dev: lirc_register_plugin: sample_rate: 0
          [  211.285091] lirc_mod_mce[2]: SMK eHome Infrared Transceiver on usb3:2
          [  211.285152] usbcore: registered new interface driver lirc_mod_mce

          And now the keyboard starts working again.

          Hope this is of help

          Richard