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

/*
 * wd_space.c
 *	SSM scsi disk device driver configuration file
 */

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

#include "sys/types.h"
#include "sys/param.h"
#include "sys/devsw.h"
#include "sys/buf.h"
#include "sys/wd.h"			/* driver local structures */
#include "sys/wd_device.h"

#define WD_CB_IOVEC	howmany(WD_MAX_XFER * DEV_BSIZE, CLBYTES) 

/*
 * Configure the device's tuning parameters.
 *
 * The commented number to the far right in the table below will be the 
 * drive unit number portion of the devices major/minor pair.
 *
 * num_iovecs:	number of iat's which are allocated for operation.
 * 		This is a per command block number, the SSM has 
 * 		NCB_SCSI_DEV command blocks per disk.
 *		This parameter must be large enough to handle 
 * 		the maximum device transfer request. Where
 *		each iat maps CLBYTES.
 */

struct wd_bconf wdbconf[] = { 
/*	   num_iovecs		   */
	{  WD_CB_IOVEC },	/*0*/
	{  WD_CB_IOVEC },	/*1*/
	{  WD_CB_IOVEC },	/*2*/
	{  WD_CB_IOVEC },	/*3*/
	{  WD_CB_IOVEC },	/*4*/
	{  WD_CB_IOVEC },	/*5*/
	{  WD_CB_IOVEC },	/*6*/
	{  WD_CB_IOVEC }	/*7*/
};

int	wdretrys = 4;	/* Number of retrys before allowing a hard error   */
#ifndef	i386
gate_t	wdgate = 58;	/* gate for this device driver */
#endif

/*
 * NOTE, supported disks must have the following characterisitics:
 * Byte 3 of an INQUIRY command must 1 to indicate embedded scsi
 * drives.
 * Byte 0 of an INQUIRY command must be 0 on all recognized SCSI disks.
 */

int	wdmaxmin = sizeof(wdbconf)/sizeof(struct wd_bconf);
#include "sys/autoconf.h"
#include "config.h"

unchar wd_bin = 5;

/* All ssm_scsi devices use the same configuration */
extern struct device_config ssm_scsi_config[];

/* autoconfig structure linking device configuration with busses */
struct dev_on_bus wd_on_busses[] = {
	{ SSM_SCSI, 1, ssm_scsi_config }, 
	{ NOBUS,},
};


/* device operations */

extern	int	wdopen();
extern	int	wdclose();
extern	int	wdstrat();
extern	int	wdminphys();
extern	int	wdsize();
extern	int	wdprint();
extern	int	wdread();	
extern	int	wdwrite();
extern	int	wdioctl();
extern	int	wdfirstsect();
extern	int	nulldev();
extern	int	nostrmsgio();
extern	int	nostrpoll();

struct	devops	wddevops = {
	wdopen,				/* d_open */
	wdclose,			/* d_close */
	wdstrat,			/* d_strat */
	wdminphys,			/* d_minphys */
	wdsize,				/* d_size */
	wdprint,			/* d_print */
	wdread,				/* d_read */
	wdwrite,			/* d_write */
	wdioctl,			/* d_ioctl */
	nulldev,			/* d_mmap */
	nulldev,			/* d__intr */
	NULL,				/* d_str */
	nostrmsgio,			/* d_strmsgio */
	nostrpoll,			/* d_strpoll */
	wdfirstsect,			/* d_firstsect */
};
