Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

VM_RESERVED and create_proc_read_entry deprecated in 3.x kernels

I am trying to compile nirlpk 2.0 on Ubuntu 14.04 LTS but the code provided by NI has not been updated to address several kernel deprecations.

 

The first deprecation was easy to fix:

 

VM_RESERVED is deprecated in kernel 3.7, so I added the following to the "Misc. definitions" section of nirlpk.h:

 

#define VM_RESERVED (VM_DONTEXPAND | VM_DONTDUMP)

 

The second deprecation is trickier:

 

nimhddk_linuxkernel/LinuxKernel/nirlpk/objects/nirlpk.c:1076:5: error: implicit declaration of function ‘create_proc_read_entry’ [-Werror=implicit-function-declaration]
if (create_proc_read_entry(nNIRLP_kDriverAlias, 0, nNIRLP_procDir, nNIRLP_procRead, NULL))
^

 

create_proc_read_entry appears to have been deprecated in kernel 3.10. I attempted to update the code to implement proc files the "new way" but so far without success. I did manage to get my rewrite to compile, but installing the driver and reading the proc files is clearly not working correctly.

 

It would be great if NI could update the kernel driver in light of these deprecations. I can take another shot at this as well, if someone can point me to some documentation on the new way to implement proc files.

 

Thanks,

Drew

Message 1 of 6
(11,643 Views)

Nevermind, I fixed it. I still wish NI would maintain this code though.

-D

0 Kudos
Message 2 of 6
(11,608 Views)

Hi,

 

how did you fixed that one with the

implicit declaration of function ‘create_proc_read_entry’ [-Werror=implicit-function-declaration]

 Is there an update for nirplk and/or a patch available for Kerenels >= 3.10 (I´m on 3.10.47)

 

 

# make objects/nirlpk.h <- nirlpk.h make[1]: Entering directory `/usr/src/kernels/linux-3.10.47-rt50' CC [M] /root/Downloads/nimhddk_linuxkernel/LinuxKernel/nirlpk/objects/nirlpk.o /root/Downloads/nimhddk_linuxkernel/LinuxKernel/nirlpk/objects/nirlpk.c: In function ‘nNIRLP_mkProcEntries’: /root/Downloads/nimhddk_linuxkernel/LinuxKernel/nirlpk/objects/nirlpk.c:1076:5: error: implicit declaration of function ‘create_proc_read_entry’ [-Werror=implicit-function-declaration] if (create_proc_read_entry(nNIRLP_kDriverAlias, 0, nNIRLP_procDir, nNIRLP_procRead, NULL)) ^ cc1: some warnings being treated as errors make[2]: *** [/root/Downloads/nimhddk_linuxkernel/LinuxKernel/nirlpk/objects/nirlpk.o] Error 1 make[1]: *** [_module_/root/Downloads/nimhddk_linuxkernel/LinuxKernel/nirlpk/objects] Error 2 make[1]: Leaving directory `/usr/src/kernels/linux-3.10.47-rt50' make: *** [objects/nirlpk.ko] Error 2 


 

0 Kudos
Message 3 of 6
(11,601 Views)

Ask NI to update their kernel driver code. Hopefully you will have better luck than I did, since they never even replied to my post.

 

If NI asks me nicely, I can provide my fix to them so they can update their code. I still think they should be capable of doing this themselves, but given how terrible their Mac/Linux support is, I guess I shouldn't be suprised.

Message 4 of 6
(11,579 Views)

I think you`re right!

I need to switch to the DDK since 64bit support isn`t in DAQmx (64bit is only about 10years old...) -

 

I`d prefer to have a DDK which works for Kernel >= 3.10  from NI.

0 Kudos
Message 5 of 6
(11,575 Views)

For all those interested in the future, here is the patched nirlpk.c containing the fix that drobson didn't want to share. It is quite straightforward, the only thing needed is to change the old /proc file generation methods based on create_proc_read_entry to the new system based on seq files using single_open and file_operations structures. I have been using it for about a week and a half and everything works fine. Enjoy!

Message 6 of 6
(11,396 Views)