wjasper / Linux_Drivers

Open source Linux device drivers
GNU General Public License v3.0
110 stars 64 forks source link

Support for pcim-das16jr #44

Open kejava opened 2 years ago

kejava commented 2 years ago

Hi, I have a large set of MCC PCI boards (7) that I'm trying to use under Linux (I don't any MS Windows with PCI slots). I'm mostly trying to confirm functionality before moving on to the next step of development. I can test most of the boards with the Comedi kernel modules and xoscope, with the exception of one, the "PCIM-DAS16JR/16". For some reason, it's never been supported under Comedi. So did some searching and found your work via the MCC site.

So I downloaded the source, went to the pcim-das16jr directory, and ran 'make'. I'm running kernel 5.4.0-105 so got the error "Your kernel is too new for the current driver". I saw that other people had contributed patches for other devices for this same issue.

I'm new to this. Can you give me some suggestions on what changes I can make to get this to build properly?

Also, if you need help testing updates for other hardware, I have several PCI boards. Here's my list: PCI-DAS08, PCI-DAS6071, PCI-DAS6402/16, PCI-DIO96H, PCIM-DAS1602/16, PCIM-DAS16JR/16, PCIM-DDA06/16

Sorry if this gets asked a lot ... have you considered combining efforts with the Comedi project?

-KevinV

wjasper commented 2 years ago

cp a2dc_4_10_0.c a2dc_5_0.c

In the file a2dc.c add the lines

if LINUX_VERSION_CODE >= VERSION_CODE(5,0,0) && LINUX_VERSION_CODE < VERSION_CODE(5,99,0)

include "a2dc_5_0.c"

endif

and

if LINUX_VERSION_CODE >= VERSION_CODE(5,99,0)

error "Your kernel is too new for the current driver. It may work but is untested."

endif

that will at least get it to compile. You will then need to resolve the errors.
like remove the first argument in

access_ok((void *) arg, size)

kejava commented 2 years ago

Hi Warren,

Sorry for the lag. I had the hardware removed. I made the changes you suggested and was able to compile. To test the kernel module, I ran "sudo insmod pcim_das16jr.ko" but the command line locked up. So I looked at the dmesg output in a different terminal. You can see the kernel oops here. I also looked in /dev/das16jr/ and it looked like all 16 ai channels were created. I'm running this through a PCIexpress to PCI expansion chassis right now. That could be adding to the problem so I'll try running with a direct pci plugin next.

[UPDATE] Tried with the board directly plugged (no pci expansion chassis) and got the same results.

-KevinV