/* $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: zd_space.c 1.16 90/01/25 $"

/*
 * configuration of disks on the ZDC
 *
 * WARNING: If the tables are partially filled in unpredictable results
 *	    *WILL* occur.
 */

/* $Log:	zd_space.c,v $
 */
#include "sys/types.h"
#include "sys/param.h"
#include "sys/devsw.h"
#include "sys/buf.h"
#include "sys/autoconf.h"
#include "sys/zdc.h"
#include "sys/zd.h"
#include "config.h"
#include "sys/zd_device.h"


/*
 *	Part B. Global Information.
 */

/*
 * If the number of zdc_iovpercb is 0 then the driver will automatically
 * allocate enough iovecs to handle max_RAW_IO (see physio()).
 * If the number of zdc_iovpercb is non-zero, then the value specified
 * is allocated if it is less than max_RAW_IO. If the specified value is
 * greater than max_RAW_IO the number is reduced to handle max_RAW_IO.
 */
int	zdc_iovpercb	= 0;			/* no of iovecs per cb */

int	zdc_err_bin	= 7;			/* Error interrupt bin */
int	zdc_cb_bin	= 5;			/* CB interrupt bin */
short	zdcretry	= 10;			/* retry count */
int	zdc_AB_throttle	= 2;			/* Channel A&B DMA throttle */
int	zdc_C_throttle	= 2;			/* Channel C DMA throttle */
unchar	zdctrl = ZDC_DUMPONPANIC;		/* ZDC_INIT control bits */


/*
 * Configuration table for the zd device on the zdc's SMD-E bus.  All entries
 * with dev_len == 0 are considered wild cards by the driver.  The first 16
 * entries (0-15) must have drive number equal to index--this is 
 */
struct device_config zd_smde_config[] = {
	/* dev_len, space, drive_number */
/*  0 */	{ 0, 0, -1 },		  /* unit wild */
/*  1 */	{ 1, 0,  0 },
/*  2 */	{ 1, 0,  1 },
/*  3 */	{ 1, 0,  2 },
/*  4 */	{ 1, 0,  3 },
/*  5 */	{ 1, 0,  4 },
/*  6 */	{ 1, 0,  5 },
/*  7 */	{ 1, 0,  6 },
/*  8 */	{ 1, 0,  7 },
/*  9 */	{ 1, 0,  8 },
/* 10 */	{ 1, 0,  9 },
/* 11 */	{ 1, 0, 10 },
/* 12 */	{ 1, 0, 11 },
/* 13 */	{ 1, 0, 12 },
/* 14 */	{ 1, 0, 13 },
/* 15 */	{ 1, 0, 14 },
/* 16 */	{ 1, 0, 15 },
	{ -1 },
};

/* autoconfig structure linking device configuration with busses */
struct dev_on_bus zd_on_busses[] = {
	{ SMDE, 1, zd_smde_config }, 
	{ NOBUS,},
};

/* device operations */

extern	int	zdopen();
extern	int	zdclose();
extern	int	zdstrat();
extern	int	zdminphys();
extern	int	zdsize();
extern	int	zdprint();
extern	int	zdread();
extern	int	zdwrite();
extern	int	zdioctl();
extern	int	zdfirstsect();
extern	int	nulldev();
extern	int	nostrmsgio();
extern	int	nostrpoll();

struct	devops	zddevops = {
	zdopen,			/* d_open */
	zdclose,		/* d_close */
	zdstrat,		/* d_strategy */
	zdminphys,		/* d_minphys */
	zdsize,			/* d_psize */
	zdprint,		/* d_print */
	zdread,			/* d_read */
	zdwrite,		/* d_write */
	zdioctl,		/* d_ioctl */
	nulldev,		/* d_mmap */
	nulldev,		/* d_shutdown */
	NULL,			/* d_str */
	nostrmsgio,		/* d_strmsgio */
	nostrpoll,		/* d_strpoll */
	zdfirstsect,		/* d_firstsect */
	nulldev,		/* d_set_history */
};
