Correct off-by-one error.
[dragonfly.git] / sys / dev / netif / cm / smc90cx6var.h
blob2b0cbaa5003d324ebd5dcb2cc25fe0e5037e2270
1 /* $NetBSD: smc90cx6var.h,v 1.5 2000/03/23 07:01:32 thorpej Exp $ */
2 /* $FreeBSD: src/sys/dev/cm/smc90cx6var.h,v 1.1.2.1 2002/02/13 22:33:41 fjoe Exp $ */
3 /* $DragonFly: src/sys/dev/netif/cm/Attic/smc90cx6var.h,v 1.5 2005/08/30 12:33:49 sephe Exp $ */
5 /*-
6 * Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
7 * All rights reserved.
9 * This code is derived from software contributed to The NetBSD Foundation
10 * by Ignatios Souvatzis.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. All advertising materials mentioning features or use of this software
21 * must display the following acknowledgement:
22 * This product includes software developed by the NetBSD
23 * Foundation, Inc. and its contributors.
24 * 4. Neither the name of The NetBSD Foundation nor the names of its
25 * contributors may be used to endorse or promote products derived
26 * from this software without specific prior written permission.
28 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
29 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
32 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGE.
42 * BAH (SMC 8bit ARCnet chipset) k/dpi
44 * The SMC 8bit ARCnet chip family uses a register and a memory window, which
45 * we get passed via bus_space_tags and bus_space_handles.
47 * As the reset functionality differs between the Amiga boards (using the
48 * 90c26 chip) and middle-aged ISA boards (using the 90c56 chip), we have
49 * a sc_reset callback function in the softc, which does a stop function
50 * (reset and leave dead) or a reset function depending on wether the 2nd
51 * parameter is 0 or 1.
54 #ifndef _SMC90CX6VAR_H_
55 #define _SMC90CX6VAR_H_
57 #include <sys/callout.h>
59 struct cm_softc {
60 struct arccom sc_arccom; /* Common arcnet structures */
62 int port_rid; /* resource id for port range */
63 struct resource *port_res; /* resource for port range */
64 int port_used; /* ports used */
66 int mem_rid; /* resource id for memory range */
67 struct resource *mem_res; /* resource for memory range */
68 int mem_used; /* memory used */
70 int irq_rid; /* resource id for irq */
71 struct resource *irq_res; /* resource for irq */
72 void * irq_handle; /* handle for irq handler */
74 struct callout sc_recon_ch;
75 u_long sc_recontime; /* seconds only, I'm lazy */
76 u_long sc_reconcount; /* for the above */
77 u_long sc_reconcount_excessive; /* for the above */
78 #define ARC_EXCESSIVE_RECONS 20
79 #define ARC_EXCESSIVE_RECONS_REWARN 400
80 u_char sc_intmask;
81 u_char sc_rx_act; /* 2..3 */
82 u_char sc_tx_act; /* 0..1 */
83 u_char sc_rx_fillcount;
84 u_char sc_tx_fillcount;
85 u_char sc_broadcast[2]; /* is it a broadcast packet? */
86 u_char sc_retransmits[2]; /* unused at the moment */
89 int cm_attach (device_t);
90 void cmintr (void *);
92 int cm_probe (device_t dev);
93 void cm_stop (struct cm_softc *sc);
95 int cm_alloc_port (device_t dev, int rid, int size);
96 int cm_alloc_memory (device_t dev, int rid, int size);
97 int cm_alloc_irq (device_t dev, int rid);
98 void cm_release_resources (device_t dev);
100 extern devclass_t cm_devclass;
102 #endif