dp83932subr.h revision 66550
1/* $FreeBSD: head/sys/dev/snc/dp83932subr.h 66550 2000-10-02 14:27:20Z nyan $ */ 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 43int sncsetup __P((struct snc_softc *, u_int8_t *)); 44 45u_int8_t snc_nec16_validate_irq __P((int)); 46int snc_nec16_register_irq __P((struct snc_softc *, int)); 47int snc_nec16_validate_mem __P((int)); 48int snc_nec16_register_mem __P((struct snc_softc *, int)); 49 50u_int16_t snc_nec16_nic_get __P((struct snc_softc *, u_int8_t)); 51void snc_nec16_nic_put __P((struct snc_softc *, u_int8_t, u_int16_t)); 52 53 54void snc_nec16_writetodesc 55 __P((struct snc_softc *, u_int32_t, u_int32_t, u_int16_t)); 56u_int16_t snc_nec16_readfromdesc 57 __P((struct snc_softc *, u_int32_t, u_int32_t)); 58 59void snc_nec16_copyfrombuf __P((struct snc_softc *, void *, u_int32_t, size_t)); 60void snc_nec16_copytobuf __P((struct snc_softc *, void *, u_int32_t, size_t)); 61void snc_nec16_zerobuf __P((struct snc_softc *, u_int32_t, size_t)); 62 63int 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)); 66int snc_nec16_check_memory 67 __P((bus_space_tag_t, bus_space_handle_t, bus_space_tag_t, 68 bus_space_handle_t)); 69 70int snc_nec16_get_enaddr 71 __P((bus_space_tag_t, bus_space_handle_t, u_int8_t *)); 72u_int8_t *snc_nec16_detect_type __P((u_int8_t *)); 73void snc_nec16_read_eeprom 74 __P((bus_space_tag_t, bus_space_handle_t, u_int8_t *)); 75 76#ifdef SNCDEBUG 77void snc_nec16_dump_reg __P((bus_space_tag_t, bus_space_handle_t)); 78#endif /* SNDEBUG */ 79