Home | History | Annotate | Line # | Download | only in dev
if_aevar.h revision 1.3
      1 /*	$NetBSD: if_aevar.h,v 1.3 1997/02/25 06:36:07 scottr Exp $	*/
      2 
      3 /*
      4  * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
      5  * adapters.
      6  *
      7  * Copyright (c) 1994, 1995 Charles M. Hannum.  All rights reserved.
      8  *
      9  * Copyright (C) 1993, David Greenman.  This software may be used, modified,
     10  * copied, distributed, and sold, in both source and binary form provided that
     11  * the above copyright and these terms are retained.  Under no circumstances is
     12  * the author responsible for the proper functioning of this software, nor does
     13  * the author assume any responsibility for damages incurred with its use.
     14  *
     15  * Adapted for MacBSD by Brad Parker <brad (at) fcr.com>.
     16  */
     17 
     18 #define INTERFACE_NAME_LEN	32
     19 
     20 /*
     21  * ae_softc: per line info and status
     22  */
     23 struct ae_softc {
     24 	struct device	sc_dev;
     25 	bus_space_tag_t	sc_reg_tag;	/* NIC register space tag */
     26 	bus_space_handle_t sc_reg_handle; /* NIC register space handle */
     27 	bus_space_tag_t	sc_buf_tag;	/* Buffer space tag */
     28 	bus_space_handle_t sc_buf_handle; /* Buffer space handle */
     29 
     30 /*	struct	intrhand sc_ih;	*/
     31 
     32 	struct arpcom sc_arpcom;/* ethernet common */
     33 	int	sc_flags;	/* interface flags, from config */
     34 
     35 	char	type_str[INTERFACE_NAME_LEN];	/* type string */
     36 	u_short	type;		/* interface type code */
     37 	u_char	vendor;		/* interface vendor */
     38 	u_char	regs_rev;	/* registers are reversed */
     39 	u_char	use16bit;	/* use word-width transfers */
     40 
     41 	u_char  cr_proto;	/* values always set in CR */
     42 
     43 	int	mem_size;	/* total shared memory size */
     44 	int	mem_ring;	/* start of RX ring-buffer (in smem) */
     45 
     46 	u_char  txb_cnt;	/* Number of transmit buffers */
     47 	u_char  txb_inuse;	/* number of transmit buffers active */
     48 
     49 	u_char  txb_new;	/* pointer to where new buffer will be added */
     50 	u_char  txb_next_tx;	/* pointer to next buffer ready to xmit */
     51 	u_short txb_len[8];	/* buffered xmit buffer lengths */
     52 	u_char  tx_page_start;	/* first page of TX buffer area */
     53 	u_char  rec_page_start;	/* first page of RX ring-buffer */
     54 	u_char  rec_page_stop;	/* last page of RX ring-buffer */
     55 	u_char  next_packet;	/* pointer to next unread RX packet */
     56 };
     57 
     58 int	ae_size_card_memory __P((
     59 	    bus_space_tag_t, bus_space_handle_t, int));
     60 
     61 void	aesetup __P((struct ae_softc *));
     62 void	aeintr __P((void *, int));
     63 int	aeioctl __P((struct ifnet *, u_long, caddr_t));
     64 void	aestart __P((struct ifnet *));
     65 void	aewatchdog __P((struct ifnet *));
     66 void	aereset __P((struct ae_softc *));
     67 void	aeinit __P((struct ae_softc *));
     68 void	aestop __P((struct ae_softc *));
     69 
     70 void	aeread __P((struct ae_softc *, int, int));
     71 struct mbuf *aeget __P((struct ae_softc *, int, int));
     72 
     73 int	ae_put __P((struct ae_softc *, struct mbuf *, int));
     74 void	ae_getmcaf __P((struct arpcom *, u_char *));
     75