/* $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: tm_device.h 1.7 90/05/04 $"

#ifndef	_SYS_TM_DEVICE_H_

/*
 * tm_device.h
 *	Configuration include file for SSM SCSI streaming tape driver
 */

/* $Log:	tm_device.h,v $
 */

/* 
 * A tm-device structure consists of generic
 * device fields followed by generic SCSI fields.
 */
struct tm_device {
	/* Generic device description */
    int         busnum;                    /* index into system bus table. */
    int         unit;                     /* Unit #, index into config table */
    int 	segsize;		  /* Size of a DMA segment */
    int		segalign;		  /* driver promises this alignment */
    int		nsegs;			  /* this device need this many segs */
    struct      driver_module   *driver;  /* pointer into "drivers[]" */
    struct      dev_on_bus      *on_bus;  /* points into drivers[].on_busses */
    struct      bus             *bus;
    struct      device_config   *config;
    struct      gen_device      *next;    /* Chain of devices on same bus */
    char       *map_origin;               /* sequent addr of map regs. */
    char       *bus_map_addr;             /* start of dma map, bus side. */
    long        map_extent;               /* # of bytes covered by map. */
    int         n_maps;                   /* Number of maps */
    int         nspaces;                  /* length of devreg, below */
    /* Devreg is really variable length, but the compiler wants a size... */
    char       *devreg[1];                 /* could point to CSR or CB */

    /*
     * SCSI specific fields for the wd_device.
     */
	ulong ident;			/* Adapter specific i.d. of device */
	int (*polled_cmd)();		/* Adapter specific scsi_polled_cmd
					 * interface for this device */
	ulong (*start_cmd)();		/* Adapter specific scsi_start_cmd
					 * interface for this device */
	caddr_t (*alloc)();		/* Adapter specific allocation function
					 * to ensure data alignment. */
	caddr_t adapt; 			/* Adapter specific info for device */

    /*
     * The driver wants saves the drive type here
     * at probe time so that it doesn't have to
     * inquire of the device again at boot time.
     */
        unchar  drive_type;              /* Type of tape drive this is */
};

/*
 * Values taken by dev->drive_type.
 */
#define TMT_MT02	0		/* Emulex MT02 non-embedded target 
					 * adapter */
#define TMT_TDC3600_S1	1		/* Tandberg TDC 3600 with SCSI-1
					 * command set */
#define TMT_TDC3600_S2  2		/* Tandberg TDC 3600 with SCSI-2
					 * command set */

extern struct dev_on_bus tm_on_busses[];

#define	_SYS_TM_DEVICE_H_
#endif	/* _SYS_TM_DEVICE_H_ */
