Device Driver problems For Nat Inst PCI-DIO-32HS Card
Using SuSE 9.1 on a 32 bit machine. The only available Linux driver for the National Instruments PCI-DIO-32HS I/O Card appears to be the ni_pcidio driver from comedi.org. However, the DMA mode is not fully functional. It only works in a "timed input mode", and we need it to work in burst mode. Adding code to this driver to gain the burst mode functionality seems quite formidable to someone with very little device driver experience, given the myriad of data structures in the code. A second option we pursued was some Linux code from the National Instruments web site. The code to perform DMA transfers is there except for one small issue. There are function stubs bufAlloc and bufFree to perform the DMA memory allocation and freeing. I found some code in Chapter 7 of "The Linux Kernel Module Programming Guide" from the Linux Documentation Project that performed the following functionality: One is a LKM that copies a buffer from user space to a static buffer in kernel space. The other code runs in user space and uses a /dev/xxxx file and an ioctl function call to direct the kernel to copy the user space buffer to the kernel space buffer. There is also functionality in the latter to direct the kernel to copy a kernel space buffer into a user space buffer. I modified the LKM code to dynamically allocate and free a kernel buffer using pci_allocate_consistent and pci_free_consistent, and it works as described above. The problem is that the bufAlloc and bufFree stubs are called directly from user space in the NI code. I have tried modifying the NI code so that it uses the LKM with no success. My questions: Is the only way to allocate DMA memory in Linux with a LKM that runs in kernel space? Is the only way to access the DMA memory via a /dev/xxxx device? Any suggestions or pointers or even constructive comments would be greatly appreciated! Sorry for the long note!
participants (1)
-
Charles Hicks