1997-10-17 07:33:34 +04:00
|
|
|
/* $NetBSD: sivar.h,v 1.6 1997/10/17 03:33:47 gwr Exp $ */
|
1996-03-26 18:01:10 +03:00
|
|
|
|
1996-11-20 21:56:49 +03:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
1996-03-26 18:01:10 +03:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
1996-11-20 21:56:49 +03:00
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Adam Glass, David Jones, and Gordon W. Ross.
|
|
|
|
*
|
1996-03-26 18:01:10 +03:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
1996-11-20 21:56:49 +03:00
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
1996-03-26 18:01:10 +03:00
|
|
|
* must display the following acknowledgement:
|
1996-11-20 21:56:49 +03:00
|
|
|
* This product includes software developed by the NetBSD
|
|
|
|
* Foundation, Inc. and its contributors.
|
|
|
|
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
1996-03-26 18:01:10 +03:00
|
|
|
*
|
1996-11-20 21:56:49 +03:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
1997-01-27 22:40:46 +03:00
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
1996-11-20 21:56:49 +03:00
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
1996-03-26 18:01:10 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file defines the interface between si.c and
|
|
|
|
* the bus-specific files: si_obio.c, si_vme.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Transfers smaller than this are done using PIO
|
|
|
|
* (on assumption they're not worth DMA overhead)
|
|
|
|
*/
|
|
|
|
#define MIN_DMA_LEN 128
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Transfers lager than 65535 bytes need to be split-up.
|
|
|
|
* (Some of the FIFO logic has only 16 bits counters.)
|
|
|
|
* Make the size an integer multiple of the page size
|
|
|
|
* to avoid buf/cluster remap problems. (paranoid?)
|
|
|
|
*/
|
|
|
|
#define MAX_DMA_LEN 0xE000
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This structure is used to keep track of mapped DMA requests.
|
|
|
|
*/
|
|
|
|
struct si_dma_handle {
|
|
|
|
int dh_flags;
|
|
|
|
#define SIDH_BUSY 1 /* This DH is in use */
|
|
|
|
#define SIDH_OUT 2 /* DMA does data out (write) */
|
|
|
|
u_char * dh_addr; /* KVA of start of buffer */
|
|
|
|
int dh_maplen; /* Length of KVA mapping. */
|
1997-10-17 07:33:34 +04:00
|
|
|
void * dh_dvma; /* VA of buffer in DVMA space */
|
1996-03-26 18:01:10 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The first structure member has to be the ncr5380_softc
|
|
|
|
* so we can just cast to go back and fourth between them.
|
|
|
|
*/
|
|
|
|
struct si_softc {
|
|
|
|
struct ncr5380_softc ncr_sc;
|
|
|
|
volatile struct si_regs *sc_regs;
|
|
|
|
int sc_adapter_type;
|
|
|
|
int sc_adapter_iv_am; /* int. vec + address modifier */
|
1996-10-30 03:24:32 +03:00
|
|
|
int sc_options; /* options for this instance */
|
1996-03-26 18:01:10 +03:00
|
|
|
int sc_reqlen; /* requested transfer length */
|
|
|
|
struct si_dma_handle *sc_dma;
|
|
|
|
/* DMA command block for the OBIO controller. */
|
|
|
|
void *sc_dmacmd;
|
|
|
|
};
|
|
|
|
|
1997-02-27 01:26:00 +03:00
|
|
|
/* Options for disconnect/reselect, DMA, and interrupts. */
|
|
|
|
#define SI_NO_DISCONNECT 0xff
|
|
|
|
#define SI_NO_PARITY_CHK 0xff00
|
|
|
|
#define SI_FORCE_POLLING 0x10000
|
|
|
|
#define SI_DISABLE_DMA 0x20000
|
1996-10-30 03:24:32 +03:00
|
|
|
/* The options are taken from the config file (PR#1929) */
|
|
|
|
|
1996-03-26 18:01:10 +03:00
|
|
|
extern int si_debug;
|
|
|
|
|
|
|
|
void si_attach __P((struct si_softc *));
|
|
|
|
int si_intr __P((void *));
|
|
|
|
|
|
|
|
void si_dma_alloc __P((struct ncr5380_softc *));
|
|
|
|
void si_dma_free __P((struct ncr5380_softc *));
|
|
|
|
void si_dma_poll __P((struct ncr5380_softc *));
|