Спасибо, вроде все работает.
Можете подсказать с другой ошибкой?
CentOS 8 4.18.0-240.22.1.el8_3.x86_64, ставлю real-tty-drivers-for-linux-4_x_x-driver-v4_0_2.tgz. Какие пакеты нужно дополнительно ставить? Погуглив нашел:
dnf groupinstall 'Development Tools'
dnf install kernel-devel make elfutils-libelf-devel gcc
драйвер выдает ошибку при установке:
[root@zbxasu moxa]# ./mxinst m64
===============================================================================
Copyright (C) 2002-2019 Moxa Inc.
All Rights Reserved.
MOXA NPort Server Real TTY Driver Ver4.0 Installation.
System Information: Kernel 4.18.0-240.22.1.el8_3.x86_64; Machine x86_64.
===============================================================================
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/4.18.0-240.22.1.el8_3.x86_64/build M=/root/moxa modules
make[1]: Entering directory '/usr/src/kernels/4.18.0-240.22.1.el8_3.x86_64'
CC [M] /root/moxa/npreal2.o
/root/moxa/npreal2.c: In function ‘npreal_ioctl’:
/root/moxa/npreal2.c:1368:60: error: macro "access_ok" passed 3 arguments, but takes just 2
error = ACCESS_OK(VERIFY_WRITE, (void *)arg, sizeof(long))?0:-EFAULT;
^
/root/moxa/npreal2.c:93:26: error: ‘access_ok’ undeclared (first use in this function)
#define ACCESS_OK(x,y,z) access_ok(x,y,z)
^~~~~~~~~
/root/moxa/npreal2.c:1368:11: note: in expansion of macro ‘ACCESS_OK’
error = ACCESS_OK(VERIFY_WRITE, (void *)arg, sizeof(long))?0:-EFAULT;
^~~~~~~~~
/root/moxa/npreal2.c:93:26: note: each undeclared identifier is reported only once for each function it appears in
#define ACCESS_OK(x,y,z) access_ok(x,y,z)
^~~~~~~~~
/root/moxa/npreal2.c:1368:11: note: in expansion of macro ‘ACCESS_OK’
error = ACCESS_OK(VERIFY_WRITE, (void *)arg, sizeof(long))?0:-EFAULT;
^~~~~~~~~
/root/moxa/npreal2.c:1375:59: error: macro "access_ok" passed 3 arguments, but takes just 2
error = ACCESS_OK(VERIFY_READ, (void *)arg, sizeof(long))?0:-EFAULT;
^
/root/moxa/npreal2.c:1391:33: error: macro "access_ok" passed 3 arguments, but takes just 2
sizeof(struct serial_struct))?0:-EFAULT;
^
/root/moxa/npreal2.c:1398:33: error: macro "access_ok" passed 3 arguments, but takes just 2
sizeof(struct serial_struct))?0:-EFAULT;
^
/root/moxa/npreal2.c:1405:25: error: macro "access_ok" passed 3 arguments, but takes just 2
sizeof(unsigned int))?0:-EFAULT;
^
/root/moxa/npreal2.c:1462:42: error: macro "access_ok" passed 3 arguments, but takes just 2
sizeof(struct serial_icounter_struct))?0:-EFAULT;
^
/root/moxa/npreal2.c: In function ‘npreal_net_ioctl’:
/root/moxa/npreal2.c:3494:50: error: macro "access_ok" passed 3 arguments, but takes just 2
rtn = ACCESS_OK( VERIFY_WRITE, (void *)arg, len)?0:-EFAULT;
^
/root/moxa/npreal2.c:93:26: error: ‘access_ok’ undeclared (first use in this function)
#define ACCESS_OK(x,y,z) access_ok(x,y,z)
^~~~~~~~~
/root/moxa/npreal2.c:3494:9: note: in expansion of macro ‘ACCESS_OK’
rtn = ACCESS_OK( VERIFY_WRITE, (void *)arg, len)?0:-EFAULT;
^~~~~~~~~
/root/moxa/npreal2.c:3522:52: error: macro "access_ok" passed 3 arguments, but takes just 2
rtn = ACCESS_OK( VERIFY_READ, (void *)arg, size )?0:-EFAULT;
^
/root/moxa/npreal2.c:3651:52: error: macro "access_ok" passed 3 arguments, but takes just 2
rtn = ACCESS_OK( VERIFY_READ, (void *)arg, size )?0:-EFAULT;
^
/root/moxa/npreal2.c:3676:52: error: macro "access_ok" passed 3 arguments, but takes just 2
rtn = ACCESS_OK( VERIFY_READ, (void *)arg, size )?0:-EFAULT;
^
make[2]: *** [scripts/Makefile.build:322: /root/moxa/npreal2.o] Error 1
make[1]: *** [Makefile:1544: _module_/root/moxa] Error 2
make[1]: Leaving directory '/usr/src/kernels/4.18.0-240.22.1.el8_3.x86_64'
make: *** [Makefile:72: module] Error 2
Check Driver...
FAILED !!!
Install Not Completed !