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