nspvar.h revision 79697
167468Snon/* $FreeBSD: head/sys/dev/nsp/nspvar.h 79697 2001-07-14 00:38:51Z non $ */ 279697Snon/* $NecBSD: nspvar.h,v 1.7.14.5 2001/06/29 06:27:54 honda Exp $ */ 367468Snon/* $NetBSD$ */ 467468Snon 567468Snon/* 667468Snon * [NetBSD for NEC PC-98 series] 779697Snon * Copyright (c) 1998, 1999, 2000, 2001 867468Snon * NetBSD/pc98 porting staff. All rights reserved. 979697Snon * 1079697Snon * Copyright (c) 1998, 1999, 2000, 2001 1179697Snon * Naofumi HONDA. All rights reserved. 1267468Snon * 1367468Snon * Redistribution and use in source and binary forms, with or without 1467468Snon * modification, are permitted provided that the following conditions 1567468Snon * are met: 1667468Snon * 1. Redistributions of source code must retain the above copyright 1767468Snon * notice, this list of conditions and the following disclaimer. 1867468Snon * 2. Redistributions in binary form must reproduce the above copyright 1967468Snon * notice, this list of conditions and the following disclaimer in the 2067468Snon * documentation and/or other materials provided with the distribution. 2167468Snon * 3. The name of the author may not be used to endorse or promote products 2267468Snon * derived from this software without specific prior written permission. 2367468Snon * 2467468Snon * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 2567468Snon * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 2667468Snon * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 2767468Snon * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 2867468Snon * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 2967468Snon * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 3067468Snon * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3167468Snon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 3267468Snon * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 3367468Snon * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3467468Snon * POSSIBILITY OF SUCH DAMAGE. 3567468Snon */ 3667468Snon 3767468Snon#ifndef _NSPVAR_H_ 3867468Snon#define _NSPVAR_H_ 3967468Snon 4067468Snon/***************************************************************** 4167468Snon * Host adapter structure 4267468Snon *****************************************************************/ 4367468Snonstruct nsp_softc { 4467468Snon struct scsi_low_softc sc_sclow; /* generic data */ 4567468Snon 4679697Snon#ifdef __NetBSD__ 4767468Snon bus_space_tag_t sc_iot; 4867468Snon bus_space_handle_t sc_ioh; 4967468Snon bus_space_tag_t sc_memt; 5067468Snon bus_space_handle_t sc_memh; 5167468Snon 5267468Snon void *sc_ih; 5379697Snon#endif /* __NetBSD__ */ 5467468Snon 5579697Snon#ifdef __FreeBSD__ 5679697Snon bus_space_tag_t sc_iot; 5779697Snon bus_space_handle_t sc_ioh; 5879697Snon bus_space_tag_t sc_memt; 5979697Snon bus_space_handle_t sc_memh; 6079697Snon 6179697Snon#if __FreeBSD_version >= 400001 6279697Snon int port_rid; 6379697Snon int irq_rid; 6479697Snon int mem_rid; 6579697Snon struct resource *port_res; 6679697Snon struct resource *irq_res; 6779697Snon struct resource *mem_res; 6879697Snon 6979697Snon void *nsp_intrhand; 7079697Snon#endif /* __FreeBSD_version */ 7179697Snon#endif /* __FreeBSD__ */ 7279697Snon 7379697Snon int sc_tmaxcnt; /* timeout count */ 7467468Snon int sc_seltout; /* selection timeout counter */ 7567468Snon int sc_timer; /* timer start */ 7667468Snon 7779697Snon int sc_suspendio; /* SMIT: data suspendio bytes */ 7879697Snon u_int8_t sc_xfermr; /* SMIT: fifo control reg */ 7979697Snon int sc_dataout_timeout; /* data out timeout counter */ 8067468Snon 8167468Snon u_int sc_idbit; /* host id bit pattern */ 8267468Snon u_int sc_cnt; /* fifo R/W count (host) */ 8379697Snon 8467468Snon u_int8_t sc_iclkdiv; /* scsi chip clock divisor */ 8567468Snon u_int8_t sc_clkdiv; /* asic chip clock divisor */ 8667468Snon u_int8_t sc_icr; /* interrupt control reg */ 8767468Snon 8867468Snon u_int8_t sc_busc; /* busc registers */ 8979697Snon u_int8_t sc_parr; /* parity control register */ 9067468Snon}; 9167468Snon 9267468Snon/***************************************************************** 9379697Snon * Lun information 9467468Snon *****************************************************************/ 9573025Snonstruct nsp_targ_info { 9679697Snon struct targ_info nti_ti; /* generic lun info */ 9767468Snon 9873025Snon u_int8_t nti_reg_syncr; /* sync registers per devices */ 9973025Snon u_int8_t nti_reg_ackwidth; /* ackwidth per devices */ 10067468Snon}; 10167468Snon 10267468Snon/***************************************************************** 10367468Snon * Proto 10467468Snon *****************************************************************/ 10567468Snonint nspprobesubr __P((bus_space_tag_t, bus_space_handle_t, u_int)); 10667468Snonvoid nspattachsubr __P((struct nsp_softc *)); 10767468Snonint nspprint __P((void *, const char *)); 10867468Snonint nspintr __P((void *)); 10967468Snon 11067468Snon#if defined(i386) 11167468Snon#define SOFT_INTR_REQUIRED(slp) (softintr((slp)->sl_irq)) 11267468Snon#else /* !i386 */ 11367468Snon#define SOFT_INTR_REQUIRED(slp) 11467468Snon#endif /* !i386 */ 11567468Snon#endif /* !_NSPVAR_H_ */ 116