/*
 * ps_scsi.h
 *
 * $Header: /smsa/bsd:include/dev/ps_scsi.h:bsd  1.4  $
 * $Source: /smsa/bsd:include/dev/ps_scsi.h: $
 *
 * Copyright (c) 1989 Acorn Computers Ltd., Cambridge, England
 *
 */

#ifndef	__dev_ps_scsi_h
#define	__dev_ps_scsi_h

/*
 * structure for SCSIOP
 */

#define SCSI_CDB       12
#define SCSI_SENSE     20

struct scsiop {
  char  cdb[SCSI_CDB];		/* control block for the operation */
  int   xfer;			/* transfer count in bytes         */
  char *addr;			/* transfer address                */
  int   timeout;		/* timeout value in centiseconds   */
  int   flags;			/* Read/Write etc.                 */
  char  sense[SCSI_SENSE];	/* Extended Sense Information      */
  char  status;			/* completion status               */
};

#define SCSIDO      _IOWR('s', 0, struct scsiop)      /* generic scsi operation */

/* SCSI Status Codes */
#define SCSI_GOOD_STATUS           0x00
#define SCSI_CHECK_CONDITION       0x02
#define SCSI_TIMEOUT               0x04
#define SCSI_BUSY                  0x08
#define SCSI_RESERVATION_CONFLICT  0x10
#define SCSI_EXPIRED               0x20
#define SCSI_PARITY_ERROR          0x40

/* flags for SCSI Info Record */
#define SC_READ          	(1<<0)
#define SC_WRITE         	(1<<1)
#define SC_SENSE_VALID   	(1<<2)
#define SC_NO_SENSE      	(1<<3)
#define SC_ALLOW_DISCONNECT	(1<<11)

/* Special timeout value to indicate "do not timeout" */
#define NO_TIMEOUT        (-1)

/* Escape flag for generic device, held in minor device */
#define SCSI_ESCAPE     (1<<3)

/* Exclusive flag for generic device, held in minor device */
#define SCSI_EXCL       (1<<4)

#endif/*__dev_ps_scsi_h*/

/* EOF ps_scsi.h */
