/* ps_sequential.h
 *
 * Support for SCSI Sequential Access Devices
 *
 * $Header: /smsa/bsd:include/dev/ps_sequential.h:bsd  1.11  $
 * $Source: /smsa/bsd:include/dev/ps_sequential.h: $
 *
 * Copyright (c) 1989 Acorn Computers Ltd., Cambridge, England
 */

#ifndef __dev_ps_sequential_h
#define __dev_ps_sequential_h

#ifdef _KERNEL
#ifndef __dev_ps_device_h
#include "ps_device.h"
#endif

extern Proc_Vec sequential;
#endif

/* SCSI Sequential Access Commands */
#define READ              (0x08)
#define WRITE             (0x0a)
#define REWIND            (0x01)
#define WRITE_FILE_MARKS  (0x10)
#define SPACE             (0x11)
#define UNLOAD            (0x1B)

/*
 *              ** YUK **
 *
 * the LOAD & UNLOAD commands use the same opcode, but we need
 * to differentiate between the two operations. The driver will never
 * be configured for specific devices, so use a vendor unique opcode
 * to identify the LOAD command.
 */
#define LOAD_IDENTIFY     (0x02)		/* distinguish the LOAD command */
#define LOAD              (0x1B)		/* the proper opcode */
#define LOAD_BIT	  (0x01)		/* specify this is a load in the cdb */

/* Flags set in the minor device number */
#define REWIND_ON_CLOSE   (1<<0)

/*
 * The SCSI_Info Record data field is divided into blocksize and
 * flags. These fields are:
 * bits  0-15: block size
 * bits 16-23: generic device flags
 * bits 24-31: device class specific flags
 */
#define FILEMARK_ON_CLOSE      (1<<24)
#define TAPE_WRITTEN           (1<<25)
#define REACHED_FILEMARK       (1<<26)
#define AT_END_OF_TAPE         (1<<27)

/*
 * defines used for MTIOCGET ioctl
 */
#define FLAG_SHIFT	(16)
#define UNWANTED_MASK	(~(DEVICE_OPENED))

#define CTDS_BITS	"\20\7WP\6EOT\5FM\4OFFL\3WRT\2FOC"
#define CTER_BITS	"\20\20WP\17BM2\16BM1\15BM0"

#endif/*__dev_ps_sequential_h*/

/* EOF ps_sequential.h */
