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

read and write

These routines initiate raw I/O to or from a device.

Syntax:

#include "sys/scsi.h"

int xxread(dev) dev_t dev;

int xxwrite(dev) dev_t dev;

These routines contain these logic steps:

  1. Extract the minor device number for use by physio(D3oddi) when performing physical I/O.

  2. Check the minor device number against the information in the scsi_dev_cfg(D4osdi) configuration table. If it is improper, use the cmn_err(D3oddi) function to issue an error message, set u.u_error to ENODEV, and return.

  3. For disk devices, get the size of the device from a local driver array of disk sizes.

  4. Call physck(D3oddi) to ensure that the I/O is correct for the device size.

  5. Call physio(D3oddi). This routine calls breakup( ), which then calls strategy( ) to perform the raw I/O.

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