dp83932subr.h revision 256281
1268999Sdteske/*	$FreeBSD: stable/10/sys/dev/snc/dp83932subr.h 139749 2005-01-06 01:43:34Z imp $	*/
2268999Sdteske/*	$NecBSD: dp83932subr.h,v 1.5 1999/02/02 00:47:25 kmatsuda Exp $	*/
3268999Sdteske/*	$NetBSD$	*/
4268999Sdteske
5268999Sdteske/*-
6268999Sdteske * Copyright (c) 1997, 1998, 1999
7268999Sdteske *	Kouichi Matsuda.  All rights reserved.
8268999Sdteske *
9268999Sdteske * Redistribution and use in source and binary forms, with or without
10268999Sdteske * modification, are permitted provided that the following conditions
11268999Sdteske * are met:
12268999Sdteske * 1. Redistributions of source code must retain the above copyright
13268999Sdteske *    notice, this list of conditions and the following disclaimer.
14268999Sdteske * 2. Redistributions in binary form must reproduce the above copyright
15268999Sdteske *    notice, this list of conditions and the following disclaimer in the
16268999Sdteske *    documentation and/or other materials provided with the distribution.
17268999Sdteske * 3. All advertising materials mentioning features or use of this software
18268999Sdteske *    must display the following acknowledgement:
19268999Sdteske *      This product includes software developed by Kouichi Matsuda for
20268999Sdteske *      NetBSD/pc98.
21268999Sdteske * 4. The name of the author may not be used to endorse or promote products
22268999Sdteske *    derived from this software without specific prior written permission
23268999Sdteske *
24268999Sdteske * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25268999Sdteske * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26268999Sdteske * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27268999Sdteske * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
28268999Sdteske * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29268999Sdteske * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30268999Sdteske * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31268999Sdteske * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32268999Sdteske * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33268999Sdteske * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34268999Sdteske */
35268999Sdteske/*
36268999Sdteske * Routines of NEC PC-9801-83, 84, 103, 104, PC-9801N-25 and PC-9801N-J02, J02R
37268999Sdteske * Ethernet interface for NetBSD/pc98, ported by Kouichi Matsuda.
38268999Sdteske *
39268999Sdteske * These cards use National Semiconductor DP83934AVQB as Ethernet Controller
40268999Sdteske * and National Semiconductor NS46C46 as (64 * 16 bits) Microwire Serial EEPROM.
41268999Sdteske */
42268999Sdteske
43268999Sdteskeint sncsetup(struct snc_softc *, u_int8_t *);
44268999Sdteske
45268999Sdteskeu_int8_t snc_nec16_validate_irq(int);
46268999Sdteskeint snc_nec16_register_irq(struct snc_softc *, int);
47268999Sdteskeint snc_nec16_validate_mem(int);
48268999Sdteskeint snc_nec16_register_mem(struct snc_softc *, int);
49268999Sdteske
50268999Sdteskeu_int16_t snc_nec16_nic_get(struct snc_softc *, u_int8_t);
51268999Sdteskevoid snc_nec16_nic_put(struct snc_softc *, u_int8_t, u_int16_t);
52268999Sdteske
53268999Sdteske
54268999Sdteskevoid snc_nec16_writetodesc
55268999Sdteske	(struct snc_softc *, u_int32_t, u_int32_t, u_int16_t);
56268999Sdteskeu_int16_t snc_nec16_readfromdesc
57268999Sdteske	(struct snc_softc *, u_int32_t, u_int32_t);
58268999Sdteske
59268999Sdteskevoid snc_nec16_copyfrombuf(struct snc_softc *, void *, u_int32_t, size_t);
60268999Sdteskevoid snc_nec16_copytobuf(struct snc_softc *, void *, u_int32_t, size_t);
61268999Sdteskevoid snc_nec16_zerobuf(struct snc_softc *, u_int32_t, size_t);
62268999Sdteske
63268999Sdteskeint snc_nec16_detectsubr
64268999Sdteske	(bus_space_tag_t, bus_space_handle_t, bus_space_tag_t,
65268999Sdteske		bus_space_handle_t, int, int, u_int8_t);
66268999Sdteskeint snc_nec16_check_memory
67268999Sdteske	(bus_space_tag_t, bus_space_handle_t, bus_space_tag_t,
68268999Sdteske		bus_space_handle_t);
69268999Sdteske
70268999Sdteskeint snc_nec16_get_enaddr
71268999Sdteske	(bus_space_tag_t, bus_space_handle_t, u_int8_t *);
72268999Sdteskeu_int8_t *snc_nec16_detect_type(u_int8_t *);
73268999Sdteskevoid snc_nec16_read_eeprom
74268999Sdteske	(bus_space_tag_t, bus_space_handle_t, u_int8_t *);
75268999Sdteske
76268999Sdteske#ifdef	SNCDEBUG
77268999Sdteskevoid snc_nec16_dump_reg(bus_space_tag_t, bus_space_handle_t);
78268999Sdteske#endif	/* SNDEBUG */
79268999Sdteske