Kernel Request Queues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am working on a device driver that must accept the  HDIO_DRIVE_CMD
IOCTL. I recognize that this is a tricky operation that subverts the
usual block driver request mode of operation. Unfortunately, the device
targeted by the ioctl is only part of a much larger system of devices
using the same IDE type of driver and normal READ/WRITE requests. In
fact, there may be READ or WRITE commands in this device's request queue
already. In light of this fact, it is obvious that I can't simply start
doing I/O operations from the reception of the ioctl. That means that I
will need to enter the drive command in the request queue from within
the device driver.  While this does not appear to be a trivial matter,
there appeared, at first,  to be nothing magic about making a request
from within the queue. The problem began to get complicated when I
realized that requests are filtered for READ, READA, and WRITE commands.
The READ and WRITE services in my driver provide exactly that, read
block and write block operations...period. I suppose it would be
possible to somehow encode the drive command operation within either or
both od these operations, but I would like to avoid this if at all
possible.

I looked at the code in rw_ll_block.c and sched.c  to see how Linux
handles the requests in the hope that I could make a similar  function
or set of functions. It appears that entering a request on the request
queue is anything but simple. I also tried to figure out how this was
being accomplished in the ide.c code., and even thought I understood
what was being done there.  Alas my poor attempt to emulate this not
only failed, but seemed to kill the queue. The lack of a worthwhile
kernel debugger doesn't help matters. I am presently against a block
wall, and would very much appreciate any constructive suggestions.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux