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