DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing a SCSI peripheral driver

strategy

This routine schedules I/O and manages the buffer cache for driver I/O.

Syntax:

#include "sys/scsi.h"

int xxstrategy(bp) struct buf *bp;

The logic is as follows:

  1. Check the configuration table for the device pointed to by bp->b_dev. If it is improper, set u.u_error to ENXIO and return.

  2. Check bp->b_blkno and, if less than zero, set b_flags to an error condition, call iodone(D3oddi) and return.

  3. Check that the I/O request is reasonable. If not, set an error condition, call iodone and return.

  4. Get an empty request block; sleep if necessary to obtain one.

  5. Call spl5(D3oddi) and then call disksort(D3oddi) to put the buffer pointed to by bp into the proper spot in the request queue.

  6. Call start(D2osdi) to start the request on the queue for the logical unit. When done, restore the previously set spl level and return.


© 2005 The SCO Group, Inc. All rights reserved.