]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - sys/dev/snc/dp83932subr.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / sys / dev / snc / dp83932subr.h
1 /*      $FreeBSD$       */
2 /*      $NecBSD: dp83932subr.h,v 1.5 1999/02/02 00:47:25 kmatsuda Exp $ */
3 /*      $NetBSD$        */
4
5 /*-
6  * Copyright (c) 1997, 1998, 1999
7  *      Kouichi Matsuda.  All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
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
20  *      NetBSD/pc98.
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
23  *
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.
34  */
35 /*
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.
38  *
39  * These cards use National Semiconductor DP83934AVQB as Ethernet Controller
40  * and National Semiconductor NS46C46 as (64 * 16 bits) Microwire Serial EEPROM.
41  */
42
43 int sncsetup(struct snc_softc *, u_int8_t *);
44
45 u_int8_t snc_nec16_validate_irq(int);
46 int snc_nec16_register_irq(struct snc_softc *, int);
47 int snc_nec16_validate_mem(int);
48 int snc_nec16_register_mem(struct snc_softc *, int);
49
50 u_int16_t snc_nec16_nic_get(struct snc_softc *, u_int8_t);
51 void snc_nec16_nic_put(struct snc_softc *, u_int8_t, u_int16_t);
52
53
54 void snc_nec16_writetodesc
55         (struct snc_softc *, u_int32_t, u_int32_t, u_int16_t);
56 u_int16_t snc_nec16_readfromdesc
57         (struct snc_softc *, u_int32_t, u_int32_t);
58
59 void snc_nec16_copyfrombuf(struct snc_softc *, void *, u_int32_t, size_t);
60 void snc_nec16_copytobuf(struct snc_softc *, void *, u_int32_t, size_t);
61 void snc_nec16_zerobuf(struct snc_softc *, u_int32_t, size_t);
62
63 int snc_nec16_detectsubr
64         (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         (bus_space_tag_t, bus_space_handle_t, bus_space_tag_t,
68                 bus_space_handle_t);
69
70 int snc_nec16_get_enaddr
71         (bus_space_tag_t, bus_space_handle_t, u_int8_t *);
72 u_int8_t *snc_nec16_detect_type(u_int8_t *);
73 void snc_nec16_read_eeprom
74         (bus_space_tag_t, bus_space_handle_t, u_int8_t *);
75
76 #ifdef  SNCDEBUG
77 void snc_nec16_dump_reg(bus_space_tag_t, bus_space_handle_t);
78 #endif  /* SNDEBUG */