dp83932subr.h revision 92739
18163Sweijun/*	$FreeBSD: head/sys/dev/snc/dp83932subr.h 92739 2002-03-20 02:08:01Z alfred $	*/
212215Srhalade/*	$NecBSD: dp83932subr.h,v 1.5 1999/02/02 00:47:25 kmatsuda Exp $	*/
38163Sweijun/*	$NetBSD$	*/
48163Sweijun
58163Sweijun/*
68163Sweijun * Copyright (c) 1997, 1998, 1999
78163Sweijun *	Kouichi Matsuda.  All rights reserved.
88163Sweijun *
98163Sweijun * Redistribution and use in source and binary forms, with or without
108163Sweijun * modification, are permitted provided that the following conditions
118163Sweijun * are met:
128163Sweijun * 1. Redistributions of source code must retain the above copyright
138163Sweijun *    notice, this list of conditions and the following disclaimer.
148163Sweijun * 2. Redistributions in binary form must reproduce the above copyright
158163Sweijun *    notice, this list of conditions and the following disclaimer in the
168163Sweijun *    documentation and/or other materials provided with the distribution.
178163Sweijun * 3. All advertising materials mentioning features or use of this software
188163Sweijun *    must display the following acknowledgement:
198163Sweijun *      This product includes software developed by Kouichi Matsuda for
208163Sweijun *      NetBSD/pc98.
218163Sweijun * 4. The name of the author may not be used to endorse or promote products
228163Sweijun *    derived from this software without specific prior written permission
238163Sweijun *
248163Sweijun * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
258163Sweijun * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
268163Sweijun * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
278163Sweijun * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2812057Smchung * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
298163Sweijun * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
308163Sweijun * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
318163Sweijun * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
328163Sweijun * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
338163Sweijun * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
348163Sweijun */
358163Sweijun/*
368163Sweijun * Routines of NEC PC-9801-83, 84, 103, 104, PC-9801N-25 and PC-9801N-J02, J02R
378163Sweijun * Ethernet interface for NetBSD/pc98, ported by Kouichi Matsuda.
388163Sweijun *
398163Sweijun * These cards use National Semiconductor DP83934AVQB as Ethernet Controller
408163Sweijun * and National Semiconductor NS46C46 as (64 * 16 bits) Microwire Serial EEPROM.
418163Sweijun */
428163Sweijun
438163Sweijunint sncsetup(struct snc_softc *, u_int8_t *);
448163Sweijun
458163Sweijunu_int8_t snc_nec16_validate_irq(int);
468163Sweijunint snc_nec16_register_irq(struct snc_softc *, int);
478163Sweijunint snc_nec16_validate_mem(int);
4812070Srriggsint snc_nec16_register_mem(struct snc_softc *, int);
498163Sweijun
508163Sweijunu_int16_t snc_nec16_nic_get(struct snc_softc *, u_int8_t);
518163Sweijunvoid snc_nec16_nic_put(struct snc_softc *, u_int8_t, u_int16_t);
528163Sweijun
538163Sweijun
548163Sweijunvoid snc_nec16_writetodesc
558163Sweijun	(struct snc_softc *, u_int32_t, u_int32_t, u_int16_t);
568163Sweijunu_int16_t snc_nec16_readfromdesc
578163Sweijun	(struct snc_softc *, u_int32_t, u_int32_t);
588163Sweijun
598163Sweijunvoid snc_nec16_copyfrombuf(struct snc_softc *, void *, u_int32_t, size_t);
608163Sweijunvoid snc_nec16_copytobuf(struct snc_softc *, void *, u_int32_t, size_t);
618163Sweijunvoid snc_nec16_zerobuf(struct snc_softc *, u_int32_t, size_t);
628163Sweijun
638163Sweijunint snc_nec16_detectsubr
648163Sweijun	(bus_space_tag_t, bus_space_handle_t, bus_space_tag_t,
658163Sweijun		bus_space_handle_t, int, int, u_int8_t);
6610277Sweijunint snc_nec16_check_memory
678163Sweijun	(bus_space_tag_t, bus_space_handle_t, bus_space_tag_t,
6810277Sweijun		bus_space_handle_t);
698163Sweijun
708163Sweijunint snc_nec16_get_enaddr
718163Sweijun	(bus_space_tag_t, bus_space_handle_t, u_int8_t *);
7212215Srhaladeu_int8_t *snc_nec16_detect_type(u_int8_t *);
7312215Srhaladevoid snc_nec16_read_eeprom
7412215Srhalade	(bus_space_tag_t, bus_space_handle_t, u_int8_t *);
758163Sweijun
768163Sweijun#ifdef	SNCDEBUG
778163Sweijunvoid snc_nec16_dump_reg(bus_space_tag_t, bus_space_handle_t);
788163Sweijun#endif	/* SNDEBUG */
798163Sweijun