/* dsc.h	1.5 (CARL) 8/19/85  11:36:03 */

#include	<sys/ioctl.h>



# ifdef CARL
/*
 * THIS IS SITE-SPECIFIC
 * CONFIGURED FOR CARL
 * produces 49152 Hz sampling rate when ASCSRT is set to 0x80
 * 4 dacs, 2 adcs, 20KHz and 6.5KHz filters
 */
# define D0BLPT		32		/* number of blocks per CDC track */
# define D1BLPT		51		/* number of blocks per ra81 track */
# define D0MINDSB	(D0BLPT*512)
# define D1MINDSB	(D0BLPT*512)
# define D2MINDSB	(D1BLPT*512)
# endif CARL

# ifdef IRCAM

# define UNIXFILES
/* # define CARLFILES */
# define ONEBDP
# define SYNC

/*
 * THIS IS SITE-SPECIFIC
 * CONFIGURED FOR IRCAM MACHINES
 * produces 48000 Hz sampling rate when ASCSRT is set to 0x80
 * 2 dacs, 2 adcs, 12.8KHz and 6.4KHz filters
 */
# define D0BLPT		31		/* number of blocks per rm80 track */
# define D1BLPT		31		/* additional disks go here */
# define D0MINDSB	(D0BLPT*512)
# define D1MINDSB	(D1BLPT*512)	/* additional disks go here */
# define DSCMRCLK	7680000
# define DSCMRTIC	(DSCMRCLK/2)
# endif IRCAM

# ifdef AMOS
/*
 * THIS IS SITE-SPECIFIC
 * CONFIGURED FOR AMOS
 * produces 49152.0 Hz sampling rate when ASCSRT is set to 0x80
 * 2 dacs, 1 adc, no filters
 */
# define D0BLPT		32		/* number of blocks per FUJI track */
# define D1BLPT		32		/* additional disks go here */
# define D0MINDSB	(D0BLPT*512)
# define D1MINDSB	(D0BLPT*512)	/* additional disks go here */
# endif AMOS

/*
 * reg specifies a sequence register (0-15).
 * conv specifies a converter.
 * dirt specifies the direction when
 * setting up the sequence ram (DSSEQ) or the
 * sampling rate (DSRATE).
 */
struct ds_seq {
	short reg;
	short conv;
	short dirt;			/* shared by DSSEQ and DSRATE */
};

/*
 * Format of returned converter
 * errors.
 */
struct ds_err {
	short dma_csr;
	short asc_csr;
	short errors;
};

/*
 * File information.
 * The member bnosiz is used for
 * lots of things; starting block number
 * of the file, size of the file, amount
 * to convert, etc.
 * Onthe vax this structure
 * is the wrong size; 8 bytes instead
 * of the desired 6; fs_unused isn't
 * used so this shouldn't be a problem.
 */
struct ds_fs {
	daddr_t bnosiz;
	short fs_unused;
};
/*
 * Errors.
 * Returned in ds_err.errors.
 */
# define EDS_ARGS	01	/* missing arguments/parameters */
# define EDS_ACC	02	/* converters in use */
# define EDS_MOD	04	/* buffer size wasn't modulo MINDSB */
# define EDS_SIZE	010	/* buffer size was too small */
# define EDS_DISK	020	/* disk error */
# define EDS_CERR	040	/* converter error */
# define EDS_RST	0100	/* dsreset clobbered us */


/*
 * Ioctl commands.
 */
# define DSRATE		_IOW(s,	1,	struct ds_seq)	/* rate */
# define DSWORD         _IOW(s, 2,      struct ds_fs)   /* dma functions */
# define DSERRS		_IOR(s,	6,	struct ds_err)	/* get errors */
# define DSBNO		_IOW(s,	7,	struct ds_fs)	/* starting block */
# define DSTODO		_IO(s,	8)			/* # of bytes to do */
# define DSCOUNT	_IOW(s,	9,	struct ds_fs)	/* amnt. to convert */
# define DSBOFF		_IOW(s,	10,	struct ds_fs)	/* 1st buffer offset */
# define DSNODSK	_IO(s,	11)			/* no disking */
# define DSLAST		_IOW(s,	12,	struct ds_seq)	/* last seq ram */

# ifdef CARLFILES
# define DSDEV		_IOW(s,	13,	struct ds_seq)	/* disk to use */
# endif CARLFILES

# define DSDONE		_IOR(s,	14,	struct ds_fs)	/* amnt. done */
# define DSMON		_IO(s,	15)			/* set monitor mode */
# define DSNBLKS	_IOW(s,	17,	struct ds_fs)	/* size of block list */

/*
 * this one is peculiar. instead of
 * letting the system do the copyin
 * for us we do it ourselves.
 */
# define DSBLKS		_IO(s, 18)			/* block list */

# ifdef UNIXFILES
# define DS42BSD	_IOW(s, 20,	struct ds_fs)	/* Use 4.2 sys */
# define DSSYNCTIMEVAL	_IOW(s, 21,	struct ds_fs)/* Set time out for sync*/
# ifdef EVIL
# define DSEVIL		_IOW(s, 22,	struct ds_fs)/*for nefarious purposes*/ 
# endif EVIL
# endif UNIXFILES

# ifdef UNIXFILES
# define NDSB		4		/* number of buffers chaining with */
# else UNIXFILES
# define NDSB		2		/* number of buffers chaining with */
# endif UNIXFILES
