nspvar.h revision 79697
1/* $FreeBSD: head/sys/dev/nsp/nspvar.h 79697 2001-07-14 00:38:51Z non $ */ 2/* $NecBSD: nspvar.h,v 1.7.14.5 2001/06/29 06:27:54 honda Exp $ */ 3/* $NetBSD$ */ 4 5/* 6 * [NetBSD for NEC PC-98 series] 7 * Copyright (c) 1998, 1999, 2000, 2001 8 * NetBSD/pc98 porting staff. All rights reserved. 9 * 10 * Copyright (c) 1998, 1999, 2000, 2001 11 * Naofumi HONDA. All rights reserved. 12 * 13 * Redistribution and use in source and binary forms, with or without 14 * modification, are permitted provided that the following conditions 15 * are met: 16 * 1. Redistributions of source code must retain the above copyright 17 * notice, this list of conditions and the following disclaimer. 18 * 2. Redistributions in binary form must reproduce the above copyright 19 * notice, this list of conditions and the following disclaimer in the 20 * documentation and/or other materials provided with the distribution. 21 * 3. The name of the author may not be used to endorse or promote products 22 * derived from this software without specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 28 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 32 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 33 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * POSSIBILITY OF SUCH DAMAGE. 35 */ 36 37#ifndef _NSPVAR_H_ 38#define _NSPVAR_H_ 39 40/***************************************************************** 41 * Host adapter structure 42 *****************************************************************/ 43struct nsp_softc { 44 struct scsi_low_softc sc_sclow; /* generic data */ 45 46#ifdef __NetBSD__ 47 bus_space_tag_t sc_iot; 48 bus_space_handle_t sc_ioh; 49 bus_space_tag_t sc_memt; 50 bus_space_handle_t sc_memh; 51 52 void *sc_ih; 53#endif /* __NetBSD__ */ 54 55#ifdef __FreeBSD__ 56 bus_space_tag_t sc_iot; 57 bus_space_handle_t sc_ioh; 58 bus_space_tag_t sc_memt; 59 bus_space_handle_t sc_memh; 60 61#if __FreeBSD_version >= 400001 62 int port_rid; 63 int irq_rid; 64 int mem_rid; 65 struct resource *port_res; 66 struct resource *irq_res; 67 struct resource *mem_res; 68 69 void *nsp_intrhand; 70#endif /* __FreeBSD_version */ 71#endif /* __FreeBSD__ */ 72 73 int sc_tmaxcnt; /* timeout count */ 74 int sc_seltout; /* selection timeout counter */ 75 int sc_timer; /* timer start */ 76 77 int sc_suspendio; /* SMIT: data suspendio bytes */ 78 u_int8_t sc_xfermr; /* SMIT: fifo control reg */ 79 int sc_dataout_timeout; /* data out timeout counter */ 80 81 u_int sc_idbit; /* host id bit pattern */ 82 u_int sc_cnt; /* fifo R/W count (host) */ 83 84 u_int8_t sc_iclkdiv; /* scsi chip clock divisor */ 85 u_int8_t sc_clkdiv; /* asic chip clock divisor */ 86 u_int8_t sc_icr; /* interrupt control reg */ 87 88 u_int8_t sc_busc; /* busc registers */ 89 u_int8_t sc_parr; /* parity control register */ 90}; 91 92/***************************************************************** 93 * Lun information 94 *****************************************************************/ 95struct nsp_targ_info { 96 struct targ_info nti_ti; /* generic lun info */ 97 98 u_int8_t nti_reg_syncr; /* sync registers per devices */ 99 u_int8_t nti_reg_ackwidth; /* ackwidth per devices */ 100}; 101 102/***************************************************************** 103 * Proto 104 *****************************************************************/ 105int nspprobesubr __P((bus_space_tag_t, bus_space_handle_t, u_int)); 106void nspattachsubr __P((struct nsp_softc *)); 107int nspprint __P((void *, const char *)); 108int nspintr __P((void *)); 109 110#if defined(i386) 111#define SOFT_INTR_REQUIRED(slp) (softintr((slp)->sl_irq)) 112#else /* !i386 */ 113#define SOFT_INTR_REQUIRED(slp) 114#endif /* !i386 */ 115#endif /* !_NSPVAR_H_ */ 116