2 /* $FreeBSD: src/sys/dev/awi/am79c930var.h,v 1.1.2.1 2000/12/07 04:09:39 imp Exp $ */
3 /* $DragonFly: src/sys/dev/netif/awi/Attic/am79c930var.h,v 1.3 2003/08/27 09:38:29 rob Exp $ */
6 * Copyright (c) 1999 The NetBSD Foundation, Inc.
9 * This code is derived from software contributed to The NetBSD Foundation
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
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.
41 #define AM79C930_BUS_PCMCIA 1
42 #define AM79C930_BUS_ISAPNP 2 /* not implemented */
46 bus_space_tag_t sc_iot;
47 bus_space_handle_t sc_ioh;
49 bus_space_tag_t sc_memt;
50 bus_space_handle_t sc_memh;
52 struct am79c930_ops *sc_ops;
59 void (*write_1) (struct am79c930_softc *, u_int32_t, u_int8_t);
60 void (*write_2) (struct am79c930_softc *, u_int32_t, u_int16_t);
61 void (*write_4) (struct am79c930_softc *, u_int32_t, u_int32_t);
62 void (*write_bytes) (struct am79c930_softc *, u_int32_t, u_int8_t *, size_t);
64 u_int8_t (*read_1) (struct am79c930_softc *, u_int32_t);
65 u_int16_t (*read_2) (struct am79c930_softc *, u_int32_t);
66 u_int32_t (*read_4) (struct am79c930_softc *, u_int32_t);
67 void (*read_bytes) (struct am79c930_softc *, u_int32_t, u_int8_t *, size_t);
70 void am79c930_chip_init (struct am79c930_softc *sc, int);
72 void am79c930_gcr_setbits (struct am79c930_softc *sc, u_int8_t bits);
73 void am79c930_gcr_clearbits (struct am79c930_softc *sc, u_int8_t bits);
75 u_int8_t am79c930_gcr_read (struct am79c930_softc *sc);
77 #define am79c930_hard_reset(sc) am79c930_gcr_setbits(sc, AM79C930_GCR_CORESET)
78 #define am79c930_hard_reset_off(sc) am79c930_gcr_clearbits(sc, AM79C930_GCR_CORESET)