/* $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

#ident	"$Header: xt_space.c 1.18 90/01/25 $"

/*
 * Configuration of tapes on the Xylogics 472
 */

/* $Log:	xt_space.c,v $
 */

#include "sys/types.h"
#include "sys/devsw.h"
#include "sys/param.h"
#include "sys/buf.h"
#include "sys/xt.h"
#include "sys/xt_device.h"


#define	XTCTLR	2		/* maximum number of controllers */

#ifdef FULLXT
/*
 * Set "xtdensel" non-zero *only* if the attached transport
 * allows density selection.
 */

int	xtdensel	= 0;
#endif	/* FULLXT  */

/*
 * per drive configuration information
 */

struct	xt_unit	xtunits[] = {
/*	 controller	drive	*/
	{ ANY,		ANY },		/* xt0: any controller, any drive */
	{ ANY,		  1 },		/* xt1: any controller, drive 1 */
	{ ANY,		  0 },		/* xt2: any controller, drive 0 */
	{ ANY,		  1 },		/* xt3: any controller, drive 1 */
};

#define	XTUNITS	(sizeof(xtunits) / sizeof(struct xt_unit))

/*
 * Static configuration information.
 *
 * DO NOT CHANGE ANYTHING BELOW THIS LINE.
 */

/*
 * per unit information
 */

int	xtmaxunit = XTUNITS;		/* number of units */
struct	buf	cxtbuf[XTUNITS];	/* headers for commands */
struct	buf	xtutab[XTUNITS];	/* heads of unit active queues */
struct	xt_softc xt_softc[XTUNITS];	/* software state */
struct	dev xtdevs[XTUNITS * XTNMINOR];	/* enough devs for each minor device */

/*
 * per controller information
 */

int	xtmaxctlr = XTCTLR;		/* number of controllers */
struct	buf	xttab[XTCTLR];		/* heads of active queues */
struct	xt_ctlr	xtctlr[XTCTLR];		/* software state */

/*
 * semaphores, locks, and gates
 */

lock_t	xtlock[XTCTLR];			/* lock per controller */
#include "sys/autoconf.h"
#include "sys/multibus.h"
#include "config.h"

unchar xt_bin = 5;
int xt_flags = 0;

/* configuration table for the xt device on the multibus bus */
struct device_config xt_multibus_config[] = {
	/* length, space, address, interrupt */
/* 0 */	{ 0x10, MULTIBUS_IO_SPACE, 0x300, 7 },
	{ -1, },
};

/* autoconfig structure linking device configuration with busses */
struct dev_on_bus xt_on_busses[] = {
	{ MULTIBUS, 1, xt_multibus_config }, 
	{ NOBUS,},
};
/* device operations */
extern	int	xtopen();
extern	int	xtclose();
extern	int	xtstrat();
extern	int	xtminphys();
extern	int	xtread();
extern	int	xtwrite();
extern	int	xtioctl();
extern	int	nulldev();
extern	int	nostrmsgio();
extern	int	nostrpoll();

struct devops xtdevops = {
	xtopen,			/* d_open */
	xtclose,		/* d_close */
	xtstrat,		/* d_strategy */
	xtminphys,		/* d_minphys */
	nulldev,		/* d_size */
	nulldev,		/* d_print */
	xtread,			/* d_read */
	xtwrite,		/* d_write */
	xtioctl,		/* d_ioctl */
	nulldev,		/* d_mmap */
	nulldev,		/* d_intr */
	NULL,			/* d_str */
	nostrmsgio,		/* d_strmsgio */
	nostrpoll		/* d_strpoll */
};

/* minor device number permutation matrix. */

int	xt_minor[] = {
	0,
	T_NOREWIND,
	T_HIDEN,
	T_NOREWIND | T_HIDEN,
#ifdef	FULLXT
	T_SWAB,
	T_SWAB | T_NOREWIND,
	T_SWAB | T_HIDEN,
	T_SWAB | T_NOREWIND | T_HIDEN,
	T_HISPEED,
	T_HISPEED | T_NOREWIND,
	T_HISPEED | T_HIDEN,
	T_HISPEED | T_NOREWIND | T_HIDEN,
	T_HISPEED | T_SWAB,
	T_HISPEED | T_SWAB | T_NOREWIND,
	T_HISPEED | T_SWAB | T_HIDEN,
	T_HISPEED | T_SWAB | T_NOREWIND | T_HIDEN,
#endif	/* FULLXT */
};

