/* $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: sec_device.h 1.8 89/09/01 $"

#ifndef	_SYS_SEC_DEVICE_H_

/*
 * sec_device.c
 *	Configuration include file for SKED
 */

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

struct sec_device {
    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 */
    char       *devreg[1];                 /* could point to CSR or CB */
    /* here starts the sec specific per device fields */
    struct sec_desc *desc;
    struct sec_cib *cibs;
    unchar errvec;
    unchar *accerr;
    struct sec_scsi_device *sec_device_chain; /* integral devices */
    bool_t	*conscsi_yet;
    struct ctlr_desc *cd;		/* System TOC descriptor address */
};


/* Define the SCED SCSI device structure here for use by others */

struct sec_scsi_device {
    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... */
    long       *devreg;                 /* points to CB */
    /*
     * sec_scsi_device specific portion
     */
    struct sec_dev *sec_dev;		  /* The sced device structure. */
};


extern struct dev_on_bus sec_on_busses[];

extern sec_sec_scsi_probe_setup();

/* stubs for bus controller routines to work with the new autoconfig */
#define sec_sec_scsi_alloc_maps ((void (*)())0)
#define sec_sec_scsi_dma_setup ((int (*)())0)
#define sec_sec_scsi_dma_remap ((char *(*)())0)
#define sec_sec_scsi_dma_done ((void (*)())0)
#define sec_sec_scsi_dma_flush ((void (*)())0)
#define sec_sec_scsi_intr_setup ((int (*)())0)
#define sec_sec_scsi_ack_int ((void (*)())0)

#define	_SYS_SEC_DEVICE_H_
#endif	/* _SYS_SEC_DEVICE_H_ */
