jeffd has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ioctl call of streams device driver ?
by dave_the_m (Monsignor) on Feb 11, 2017 at 08:04 UTC | |
|
Re: ioctl call of streams device driver ?
by jeffd (Initiate) on Feb 11, 2017 at 18:31 UTC | |
|
Re: ioctl call of streams device driver ?
by Anonymous Monk on Feb 11, 2017 at 01:26 UTC |