153895Smckusick /* 2*63304Sbostic * Copyright (c) 1992, 1993 3*63304Sbostic * The Regents of the University of California. All rights reserved. 453895Smckusick * 553895Smckusick * This code is derived from software contributed to Berkeley by 653895Smckusick * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc. 753895Smckusick * 853895Smckusick * %sccs.include.redist.c% 953895Smckusick * 1053895Smckusick * from: $Hdr: scsic.h,v 4.300 91/06/09 06:22:24 root Rel41 $ SONY 1153895Smckusick * 12*63304Sbostic * @(#)scsic.h 8.1 (Berkeley) 06/11/93 1353895Smckusick */ 1453895Smckusick 1553895Smckusick /* 1653895Smckusick * Copyright (c) 1987- by SONY Corporation. 1753895Smckusick */ 1853895Smckusick 1953895Smckusick /* 2053895Smckusick * scsic.h ver 1.1 2153895Smckusick * 2253895Smckusick * Header file for scsi.c. 2353895Smckusick */ 2453895Smckusick 2553895Smckusick #define SCSI_NOTWAIT 0x2 /* don't wait cmd completion */ 2653895Smckusick 2753895Smckusick #define splhi spl7 /* IPL 7 Be careful to use this.*/ 2853895Smckusick 2953895Smckusick /* 3053895Smckusick * Delay units are in microseconds. 3153895Smckusick * 3253895Smckusick * 1ms = 1000 on news800 3353895Smckusick * so 1ms = 1500 on 25MHz 3453895Smckusick */ 3553895Smckusick #define HDELAY(n) \ 3653895Smckusick { \ 3753895Smckusick register int N = (n)*1500 ; \ 3853895Smckusick while(--N > 0); \ 3953895Smckusick } 4053895Smckusick 4153895Smckusick struct scsi_stat { 4253895Smckusick int wbc; /* # of channel that is waiting for scsi bus free */ 4353895Smckusick int wrc; /* # of channel that is waiting for reselection */ 4453895Smckusick struct sc_chan_stat *ip; 4553895Smckusick /* In progress channel. Same as ISTAT.IP */ 4653895Smckusick int ipc; /* number of in progress channel. */ 4753895Smckusick int dma_stat; /* OFF = DMAC is not used */ 4853895Smckusick #define SC_DMAC_RD 1 4953895Smckusick #define SC_DMAC_WR 2 5053895Smckusick }; 5153895Smckusick 5253895Smckusick #undef VOLATILE 5353895Smckusick #ifdef mips 5453895Smckusick #define VOLATILE volatile 5553895Smckusick #else 5653895Smckusick #define VOLATILE 5753895Smckusick #endif 5853895Smckusick 5953895Smckusick struct sc_chan_stat { 6053895Smckusick struct scsi *sc ; /* scsi struct address */ 6153895Smckusick u_char comflg; /* flag for save comand pointer */ 6253895Smckusick u_int stcnt; /* save transfer count */ 6353895Smckusick u_char *spoint; /* save transfer point */ 6453895Smckusick u_int stag; /* save tag register */ 6553895Smckusick u_int soffset; /* save offset register */ 6653895Smckusick u_char intr_flg; /* interrupt flag. SCSI_INTEN/INTDIS */ 6753895Smckusick int chan_num; /* channel NO. */ 6853895Smckusick VOLATILE struct sc_chan_stat *wb_next; /* wait bus channel queue */ 6953895Smckusick }; 7053895Smckusick 7153895Smckusick #undef VOLATILE 7253895Smckusick 7353895Smckusick extern struct scintsw scintsw[]; 7453895Smckusick 7553895Smckusick extern struct scsi_stat scsi_stat; 76