2

I used MOXA devices on Debian 7.0 with kernel 3.2. I was able to successfully compiled Moxa RealTTY driver for this kernel, but after I upgraded to Debian 8.0 with kernel 3.16 I can't compile it. I asked MOXA for newest driver, but so far no answer. Latest driver was downloaded from this link http://mtsc.moxa.com:8888/Software/DN/NPort/Driver/RealTTY/ , but this link does not work anymore.

When I run ./mxinst it crash on this error: =============================================================================== Copyright (C) 2002-2014 Moxa Inc. All Rights Reserved.

MOXA NPort Server Real TTY Driver V1.18.33 Installation.
System Information: Kernel 3.16.0-4-amd64; Machine x86_64.
===============================================================================


Tar files, please wait ... OK!  
Building driver...

If you want to use secure communication with target,
you might choose [y] to enable the SSL function.
Note: This function support RealCOM with secure mode only.
Do you want to enable secure function? [y/N].
n
make -C /lib/modules/3.16.0-4-amd64/build SUBDIRS=/opt/moxa.git/npreal2 modules
make[1]: Entering directory '/usr/src/linux-headers-3.16.0-4-amd64'
Makefile:10: *** mixed implicit and normal rules: deprecated syntax
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-4-amd64'
  CC [M]  /opt/moxa.git/npreal2/npreal2.o
/opt/moxa.git/npreal2/npreal2.c: In function ‘npreal_wait_command_completed’:
/opt/moxa.git/npreal2/npreal2.c:4744:13: error: implicit declaration of function ‘interruptible_sleep_on_timeout’ [-Werror=implicit-function-declaration]
             interruptible_sleep_on_timeout(&nd->cmd_rsp_wait,timeout);
             ^
cc1: some warnings being treated as errors
/usr/src/linux-headers-3.16.0-4-common/scripts/Makefile.build:268: recipe for target '/opt/moxa.git/npreal2/npreal2.o' failed
make[4]: *** [/opt/moxa.git/npreal2/npreal2.o] Error 1
/usr/src/linux-headers-3.16.0-4-common/Makefile:1350: recipe for target '_module_/opt/moxa.git/npreal2' failed
make[3]: *** [_module_/opt/moxa.git/npreal2] Error 2
Makefile:181: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2 
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-3.16.0-4-amd64'
Makefile:67: recipe for target 'module' failed
make: *** [module] Error 2
Check Driver...
FAILED !!!

Install Not Completed !

I have uploaded latest driver to GitHub (https://github.com/rchovan/npreal2). Can someone help me to fix this module to compile it on Linux kernel 3.16 and newest ?

Thank You

3
  • what have you done to resolve the problem with the missing function: 'interruptible_sleep_on_timeout()' Commented May 3, 2015 at 19:15
  • Hi, I didn't solved it yet. I'm not familiar with C language and Linux kernel module development. My experiences end with source compilation.
    – Coudy
    Commented May 4, 2015 at 8:45
  • Hello. A new version of the driver is available. Please contact [email protected] and ask for the new linux driver (beta driver, but so far has worked on almost every linux system). I will then supply you with the required driver.
    – H_squared
    Commented Sep 15, 2015 at 7:29

1 Answer 1

2

Function interruptible_sleep_on_timeout has been removed in kernel version 3.15.

The workaround for the missing function can be found in many patches, for example this lm-sensors patch:

-           timeout = interruptible_sleep_on_timeout(&w1_control_wait, timeout);
+           prepare_to_wait(&w1_control_wait, &wait, TASK_INTERRUPTIBLE);
+           timeout = schedule_timeout(timeout);
+           finish_wait(&w1_control_wait, &wait);

I patched moxa driver according to this solution and made a pull request on your github repo. Please test it.

1
  • Hi, patch is OK. Module was compiled and is fully functional. Thank You
    – Coudy
    Commented May 4, 2015 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.