1 /* $FreeBSD: src/sys/dev/snc/dp83932subr.h,v 1.1.2.1 2000/10/21 03:30:03 nyan Exp $ */
2 /* $DragonFly: src/sys/dev/netif/snc/Attic/dp83932subr.h,v 1.2 2003/06/17 04:28:29 dillon Exp $ */
3 /* $NecBSD: dp83932subr.h,v 1.5 1999/02/02 00:47:25 kmatsuda Exp $ */
7 * Copyright (c) 1997, 1998, 1999
8 * Kouichi Matsuda. All rights reserved.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Kouichi Matsuda for
22 * 4. The name of the author may not be used to endorse or promote products
23 * derived from this software without specific prior written permission
25 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 * Routines of NEC PC-9801-83, 84, 103, 104, PC-9801N-25 and PC-9801N-J02, J02R
38 * Ethernet interface for NetBSD/pc98, ported by Kouichi Matsuda.
40 * These cards use National Semiconductor DP83934AVQB as Ethernet Controller
41 * and National Semiconductor NS46C46 as (64 * 16 bits) Microwire Serial EEPROM.
44 int sncsetup __P((struct snc_softc *, u_int8_t *));
46 u_int8_t snc_nec16_validate_irq __P((int));
47 int snc_nec16_register_irq __P((struct snc_softc *, int));
48 int snc_nec16_validate_mem __P((int));
49 int snc_nec16_register_mem __P((struct snc_softc *, int));
51 u_int16_t snc_nec16_nic_get __P((struct snc_softc *, u_int8_t));
52 void snc_nec16_nic_put __P((struct snc_softc *, u_int8_t, u_int16_t));
55 void snc_nec16_writetodesc
56 __P((struct snc_softc *, u_int32_t, u_int32_t, u_int16_t));
57 u_int16_t snc_nec16_readfromdesc
58 __P((struct snc_softc *, u_int32_t, u_int32_t));
60 void snc_nec16_copyfrombuf __P((struct snc_softc *, void *, u_int32_t, size_t));
61 void snc_nec16_copytobuf __P((struct snc_softc *, void *, u_int32_t, size_t));
62 void snc_nec16_zerobuf __P((struct snc_softc *, u_int32_t, size_t));
64 int snc_nec16_detectsubr
65 __P((bus_space_tag_t, bus_space_handle_t, bus_space_tag_t,
66 bus_space_handle_t, int, int, u_int8_t));
67 int snc_nec16_check_memory
68 __P((bus_space_tag_t, bus_space_handle_t, bus_space_tag_t,
71 int snc_nec16_get_enaddr
72 __P((bus_space_tag_t, bus_space_handle_t, u_int8_t *));
73 u_int8_t *snc_nec16_detect_type __P((u_int8_t *));
74 void snc_nec16_read_eeprom
75 __P((bus_space_tag_t, bus_space_handle_t, u_int8_t *));
78 void snc_nec16_dump_reg __P((bus_space_tag_t, bus_space_handle_t));