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

ioctl

Establish conditional modules for each I/O control command.

Syntax:

#include "sys/scsi.h"

int xxioctl(dev, cmd, arg, mode) dev_t dev; int cmd, mode; caddr_t arg;

The logic is as follows:

  1. Call scsi_getdev(D3osdi) to ensure that the dev argument is for a legitimate device. If not, set u.u_error to ENODEV and return. Then check that the device is present. If not, set u.u_error to ENODEV and return.

  2. Provide for any other ioctls to fit your needs. If an improper command is specified, set u.u_error to EINVAL and return.

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