[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts

A Typical Initiator-Mode SCSI Driver Transaction Sequence

A simplified sequence of events for a transaction between a SCSI device driver and a SCSI adapter device driver follows. In this sequence, routine names preceded by a dd_ are part of the SCSI device driver, while those preceded by a sc_ are part of the SCSI adapter device driver.

  1. The SCSI 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 sc_strategy entry point by calling the devstrategy kernel service with the relevant sc_buf structure as a parameter.
  2. The sc_strategy entry point initially checks the sc_buf structure for validity. These checks include validating the devno field, matching the SCSI ID/LUN to internal tables for configuration purposes, and validating the request size.
  3. Although the SCSI adapter device driver cannot reorder transactions, it does perform queue chaining. If no other transactions are pending for the requested device, the sc_strategy routine immediately calls the sc_start routine with the new transaction. If there are other transactions pending, the new transaction is added to the tail of the device chain.
  4. At each interrupt, the sc_intr interrupt handler verifies the current status. The SCSI adapter device driver fills in the sc_buf status_validity field, updating the scsi_status and general_card_status fields as required. The SCSI adapter device driver also fills in the bufstruct.b_resid field with the number of bytes not transferred from the request. If all the data was transferred, the b_resid field is set to a value of 0. When a transaction completes, the sc_intr routine causes the sc_buf entry to be removed from the device queue and calls the iodone kernel service, passing the just dequeued sc_buf structure for the device as the parameter. The sc_start routine is then called again to process the next transaction on the device queue. The iodone kernel service calls the SCSI device driver dd_iodone entry point, signaling the SCSI device driver that the particular transaction has completed.
  5. The SCSI device driver dd_iodone routine investigates the I/O completion codes in the sc_buf status entries and performs error recovery, if required. If the operation completed correctly, the SCSI 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.

Related Information

Required SCSI Adapter Device Driver ioctl Commands.

Understanding the Execution of Initiator I/O Requests.

Understanding the Execution of SCSI Target-Mode Requests

SCSI Error Recovery.

Understanding the sc_buf Structure.

[ Previous | Next | Contents | Home | Search ]