167468Snon/*	$FreeBSD$	*/
279697Snon/*	$NecBSD: tmc18c30var.h,v 1.12.18.2 2001/06/13 05:51:23 honda Exp $	*/
367468Snon/*	$NetBSD$	*/
467468Snon
5139749Simp/*-
667468Snon * [NetBSD for NEC PC-98 series]
779697Snon *  Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001
867468Snon *	NetBSD/pc98 porting staff. All rights reserved.
979697Snon *  Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001
1067468Snon *	Naofumi HONDA. All rights reserved.
1167468Snon *  Copyright (c) 1996, 1997, 1998
1267468Snon *	Kouichi Matsuda. All rights reserved.
1367468Snon *
1467468Snon *  Redistribution and use in source and binary forms, with or without
1567468Snon *  modification, are permitted provided that the following conditions
1667468Snon *  are met:
1767468Snon *  1. Redistributions of source code must retain the above copyright
1867468Snon *     notice, this list of conditions and the following disclaimer.
1967468Snon *  2. Redistributions in binary form must reproduce the above copyright
2067468Snon *     notice, this list of conditions and the following disclaimer in the
2167468Snon *     documentation and/or other materials provided with the distribution.
2267468Snon *  3. The name of the author may not be used to endorse or promote products
2367468Snon *     derived from this software without specific prior written permission.
2467468Snon *
2567468Snon * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2667468Snon * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2767468Snon * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2867468Snon * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
2967468Snon * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
3067468Snon * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
3167468Snon * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3267468Snon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
3367468Snon * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
3467468Snon * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3567468Snon * POSSIBILITY OF SUCH DAMAGE.
3667468Snon */
3767468Snon
3867468Snon#ifndef	_TMC18C30VAR_H_
3967468Snon#define	_TMC18C30VAR_H_
4067468Snon
4167468Snon/*****************************************************************
4267468Snon * Host adapter structure
4367468Snon *****************************************************************/
4467468Snonstruct stg_softc {
4567468Snon	struct scsi_low_softc sc_sclow;	/* generic data */
4667468Snon
4767468Snon	bus_space_tag_t sc_iot;
4867468Snon	bus_space_tag_t sc_memt;
4967468Snon	bus_space_handle_t sc_ioh;
5067468Snon
5179697Snon	int port_rid;
5279697Snon	int irq_rid;
5379697Snon	int mem_rid;
5479697Snon	struct resource *port_res;
5579697Snon	struct resource *irq_res;
5679697Snon	struct resource *mem_res;
5779697Snon
5879697Snon	void *stg_intrhand;
5979697Snon
6079697Snon	int sc_tmaxcnt;
6167468Snon	u_int sc_chip;			/* chip type */
6267468Snon	u_int sc_fsz;			/* fifo size */
6367468Snon	u_int sc_idbit;			/* host id bit */
6479697Snon	u_int sc_wthold;		/* write thread */
6579697Snon	u_int sc_rthold;		/* read thread */
6679697Snon	u_int sc_maxwsize;		/* max write size */
6779697Snon	int sc_dataout_timeout;		/* data out timeout counter */
6879697Snon	int sc_ubf_timeout;		/* unexpected bus free timeout */
6967468Snon
7067468Snon	u_int8_t sc_fcWinit;		/* write flags */
7167468Snon	u_int8_t sc_fcRinit;		/* read flags */
7267468Snon
7367468Snon	u_int8_t sc_icinit;		/* interrupt masks */
7467468Snon	u_int8_t sc_busc;		/* default bus control register */
7567468Snon	u_int8_t sc_imsg;		/* identify msg required */
7667468Snon	u_int8_t sc_busimg;		/* bus control register image */
7767468Snon};
7867468Snon
7967468Snon/*****************************************************************
8079697Snon * Lun information
8167468Snon *****************************************************************/
8273025Snonstruct stg_targ_info {
8379697Snon	struct targ_info sti_ti;		/* generic data */
8467468Snon
8579697Snon	u_int8_t sti_reg_synch;		/* synch register per lun */
8667468Snon};
8767468Snon
8867468Snon/*****************************************************************
8967468Snon * Proto
9067468Snon *****************************************************************/
9192739Salfredint stgprobesubr(bus_space_tag_t, bus_space_handle_t, u_int);
9292739Salfredvoid stgattachsubr(struct stg_softc *);
9392739Salfredint stgintr(void *);
9467468Snon
9567468Snon#endif	/* !_TMC18C30VAR_H_ */
96