I would like to use perl ioctl to provide a simple peek/poke user interface to my device driver. Unfortunately, it doesn't work for some fundamental reason that I don't understand. I suspect its because the driver is using streams. Here is the basic flow of my program:
open($fd, "+<:unix", $dev_path) || die "Failed to open $dev_path : $!" +; @regs = ($addr, 0x10111213, 0xaaaa, 0xbbbb); $regs = pack('QQQ', @regs); $rc = ioctl($fd, $REG_R, $regs); ($offset, $data0, $data1, $data2) = unpack('QQQ', $regs);
I see the correct device opened and correct driver ioctl called but no data from $regs is passed in or out. I have dumped the iocblk structure at the driver and all I see in it is the value of $REG_R, the ioctl command type. The symptom is as if the third arg of the perl ioctl call is being ignored. My question is: Is there any special consideration I need to make because this a device driver using streams ? The perl code snip above works fine on a non-streams device driver.
In reply to ioctl call of streams device driver ? by jeffd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |