I'm trying to use some old DAQs, and I had to jump over several hoops to get the old (around 2004) device driver to compile it ( DTI-DT340 Linux-DAQ-PCI ).
I got to the point where it compiles, I can load the kernel module, it finds a map, and I can create personal devices using mknod.
But I can’t open these devices and keep getting errno 19 (ENODEV) “There is no such device” when I try
open("/dev/dt340/0",O_RDWR);
but mknod did not complain about its creation, and he is there:
total 0
crw-rw-r
crw-rw-r
crw-rw-r
crw-rw-r
Is there something that I neglect to do? What reason could be the cause of failure?
Here I use the script to load the driver and create devices.
#!/bin/bash
module="dt340"
device="dt340"
mode="664"
insmod $module.ko
rm -f /dev/${device}/[0-3]
major=`awk "\\$2==\"$module\" {print \\$1}" /proc/devices`
mkdir -p /dev/${device}
mknod /dev/${device}/0 c $major 0
mknod /dev/${device}/1 c $major 1
mknod /dev/${device}/2 c $major 2
mknod /dev/${device}/3 c $major 3
group="staff"
grep '^staff:' /etc/group > /dev/null || group="users"
chgrp $group /dev/${device}/[0-3]
chmod $mode /dev/${device}/[0-3]
:
250 dt340
dt340 21516 0
Apr 23 11:59:26 ve kernel: [ 412.862139] dt340 0000:03:01.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
Apr 23 11:59:26 ve kernel: [ 412.862362] dt340: In function dt340_init_one:
Apr 23 11:59:26 ve kernel: [ 412.862363] Device DT340 Rev 0x0 detected at address 0xfebf0000
03:01.0 Multimedia controller: Data Translation DT340
: , -ENODEV open().
while ((pdev = pci_find_device(PCI_VENDOR_ID_DTI, PCI_ANY_ID, pdev)))
( ), if(!pdev) true -ENODEV.
- , pci, ...