166550Snyan/*	$FreeBSD$	*/
266550Snyan/*	$NecBSD: dp83932subr.h,v 1.5 1999/02/02 00:47:25 kmatsuda Exp $	*/
366550Snyan/*	$NetBSD$	*/
4139749Simp
5139749Simp/*-
666550Snyan * Copyright (c) 1997, 1998, 1999
766550Snyan *	Kouichi Matsuda.  All rights reserved.
866550Snyan *
966550Snyan * Redistribution and use in source and binary forms, with or without
1066550Snyan * modification, are permitted provided that the following conditions
1166550Snyan * are met:
1266550Snyan * 1. Redistributions of source code must retain the above copyright
1366550Snyan *    notice, this list of conditions and the following disclaimer.
1466550Snyan * 2. Redistributions in binary form must reproduce the above copyright
1566550Snyan *    notice, this list of conditions and the following disclaimer in the
1666550Snyan *    documentation and/or other materials provided with the distribution.
1766550Snyan * 3. All advertising materials mentioning features or use of this software
1866550Snyan *    must display the following acknowledgement:
1966550Snyan *      This product includes software developed by Kouichi Matsuda for
2066550Snyan *      NetBSD/pc98.
2166550Snyan * 4. The name of the author may not be used to endorse or promote products
2266550Snyan *    derived from this software without specific prior written permission
2366550Snyan *
2466550Snyan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2566550Snyan * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2666550Snyan * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2766550Snyan * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2866550Snyan * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2966550Snyan * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3066550Snyan * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3166550Snyan * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3266550Snyan * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3366550Snyan * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3466550Snyan */
3566550Snyan/*
3666550Snyan * Routines of NEC PC-9801-83, 84, 103, 104, PC-9801N-25 and PC-9801N-J02, J02R
3766550Snyan * Ethernet interface for NetBSD/pc98, ported by Kouichi Matsuda.
3866550Snyan *
3966550Snyan * These cards use National Semiconductor DP83934AVQB as Ethernet Controller
4066550Snyan * and National Semiconductor NS46C46 as (64 * 16 bits) Microwire Serial EEPROM.
4166550Snyan */
4266550Snyan
4392739Salfredint sncsetup(struct snc_softc *, u_int8_t *);
4466550Snyan
4592739Salfredu_int8_t snc_nec16_validate_irq(int);
4692739Salfredint snc_nec16_register_irq(struct snc_softc *, int);
4792739Salfredint snc_nec16_validate_mem(int);
4892739Salfredint snc_nec16_register_mem(struct snc_softc *, int);
4966550Snyan
5092739Salfredu_int16_t snc_nec16_nic_get(struct snc_softc *, u_int8_t);
5192739Salfredvoid snc_nec16_nic_put(struct snc_softc *, u_int8_t, u_int16_t);
5266550Snyan
5366550Snyan
5466550Snyanvoid snc_nec16_writetodesc
5592739Salfred	(struct snc_softc *, u_int32_t, u_int32_t, u_int16_t);
5666550Snyanu_int16_t snc_nec16_readfromdesc
5792739Salfred	(struct snc_softc *, u_int32_t, u_int32_t);
5866550Snyan
5992739Salfredvoid snc_nec16_copyfrombuf(struct snc_softc *, void *, u_int32_t, size_t);
6092739Salfredvoid snc_nec16_copytobuf(struct snc_softc *, void *, u_int32_t, size_t);
6192739Salfredvoid snc_nec16_zerobuf(struct snc_softc *, u_int32_t, size_t);
6266550Snyan
6366550Snyanint snc_nec16_detectsubr
6492739Salfred	(bus_space_tag_t, bus_space_handle_t, bus_space_tag_t,
6592739Salfred		bus_space_handle_t, int, int, u_int8_t);
6666550Snyanint snc_nec16_check_memory
6792739Salfred	(bus_space_tag_t, bus_space_handle_t, bus_space_tag_t,
6892739Salfred		bus_space_handle_t);
6966550Snyan
7066550Snyanint snc_nec16_get_enaddr
7192739Salfred	(bus_space_tag_t, bus_space_handle_t, u_int8_t *);
7292739Salfredu_int8_t *snc_nec16_detect_type(u_int8_t *);
7366550Snyanvoid snc_nec16_read_eeprom
7492739Salfred	(bus_space_tag_t, bus_space_handle_t, u_int8_t *);
7566550Snyan
7666550Snyan#ifdef	SNCDEBUG
7792739Salfredvoid snc_nec16_dump_reg(bus_space_tag_t, bus_space_handle_t);
7866550Snyan#endif	/* SNDEBUG */
79