[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]
Kernel Extensions and Device Support Programming Concepts
A Typical IDE Driver Transaction Sequence
A simplified sequence of events
for a transaction between an IDE device driver and an IDE adapter driver
follows. In this sequence, routine names preceded by a dd_ are
part of the IDE device driver, while those preceded by an eide_ are
part of the IDE adapter driver.
- The IDE device driver receives a call to its dd_strategy routine; any required internal queuing occurs in this routine. The dd_strategy entry point then triggers the operation by
calling the dd_start entry point. The dd_start routine invokes the eide_strategy entry
point by calling the devstrat kernel
service with the relevant ataide_buf structure as a
parameter.
- The eide_strategy entry point initially checks
the ataide_buf structure for validity. These checks
include validating the devno field, matching
the IDE device ID to internal tables for configuration purposes, and validating
the request size.
- The IDE adapter driver does not queue transactions. Only a single transaction
is accepted per device (one master, one slave). If no transaction is currently
active, the eide_strategy routine immediately calls
the eide_start routine with the new transaction. If
there is a current transaction for the same device, the new transaction is
returned with an error indicated in the ataide_buf structure.
If there is a current transaction for the other device, the new transaction
is queued to the inactive device.
- At each interrupt, the eide_intr interrupt handler
verifies the current status. The IDE adapter driver fills in the ataide_buf status_validity field, updating the ata.status and ata.errval fields as required.
The IDE adapter driver also fills in the bufstruct.b_resid field with the number of bytes not transferred from the transaction.
If all the data was transferred, the b_resid field
is set to a value of 0. When a transaction completes, the eide_intr routine causes the ataide_buf entry
to be removed from the device queue and calls the iodone kernel service, passing the just dequeued ataide_buf structure for the device as the parameter. The eide_start routine is then called again to process the next transaction on the
device queue. The iodone kernel service calls the IDE
device driver dd_iodone entry point, signaling the
IDE device driver that the particular transaction has completed.
- The IDE device driver dd_iodone routine investigates
the I/O completion codes in the ataide_buf status entries
and performs error recovery, if required. If the operation completed correctly,
the IDE device driver dequeues the original buffer structures. It calls the iodone kernel service with the original buffer pointers
to notify the originator of the request.
[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]