if_edvar.h revision 62236
1226586Sdim/*
2226586Sdim * Copyright (c) 1995, David Greenman
3226586Sdim * All rights reserved.
4226586Sdim *
5226586Sdim * Redistribution and use in source and binary forms, with or without
6226586Sdim * modification, are permitted provided that the following conditions
7226586Sdim * are met:
8226586Sdim * 1. Redistributions of source code must retain the above copyright
9226586Sdim *    notice unmodified, this list of conditions, and the following
10226586Sdim *    disclaimer.
11226586Sdim * 2. Redistributions in binary form must reproduce the above copyright
12226586Sdim *    notice, this list of conditions and the following disclaimer in the
13226586Sdim *    documentation and/or other materials provided with the distribution.
14226586Sdim *
15226586Sdim * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16226586Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17226586Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18226586Sdim * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19226586Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20226586Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21226586Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22226586Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23226586Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24226586Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25226586Sdim * SUCH DAMAGE.
26239462Sdim *
27226586Sdim * $FreeBSD: head/sys/dev/ed/if_edvar.h 62236 2000-06-29 07:31:37Z ps $
28226586Sdim */
29226586Sdim
30239462Sdim/*
31234353Sdim * ed_softc: per line info and status
32239462Sdim */
33239462Sdimstruct ed_softc {
34239462Sdim	struct arpcom arpcom;	/* ethernet common */
35226586Sdim
36226586Sdim	char   *type_str;	/* pointer to type string */
37226586Sdim	u_char  vendor;		/* interface vendor */
38239462Sdim	u_char  type;		/* interface type code */
39239462Sdim	u_char	gone;		/* HW missing, presumed having a good time */
40239462Sdim
41239462Sdim	int	port_rid;	/* resource id for port range */
42239462Sdim	int	port_used;	/* nonzero if ports used */
43239462Sdim	struct resource* port_res; /* resource for port range */
44239462Sdim	int	mem_rid;	/* resource id for memory range */
45239462Sdim	int	mem_used;	/* nonzero if memory used */
46239462Sdim	struct resource* mem_res; /* resource for memory range */
47239462Sdim	int	irq_rid;	/* resource id for irq */
48239462Sdim	struct resource* irq_res; /* resource for irq */
49239462Sdim	void*	irq_handle;	/* handle for irq handler */
50239462Sdim
51239462Sdim	u_short asic_addr;	/* ASIC I/O bus address */
52239462Sdim	u_short nic_addr;	/* NIC (DS8390) I/O bus address */
53239462Sdim
54239462Sdim/*
55239462Sdim * The following 'proto' variable is part of a work-around for 8013EBT asics
56239462Sdim *	being write-only. It's sort of a prototype/shadow of the real thing.
57239462Sdim */
58239462Sdim	u_char  wd_laar_proto;
59239462Sdim	u_char	cr_proto;
60239462Sdim	u_char  isa16bit;	/* width of access to card 0=8 or 1=16 */
61239462Sdim	int     is790;		/* set by the probe code if the card is 790
62239462Sdim				 * based */
63239462Sdim
64239462Sdim/*
65239462Sdim * HP PC LAN PLUS card support.
66239462Sdim */
67239462Sdim
68239462Sdim	u_short	hpp_options;	/* flags controlling behaviour of the HP card */
69239462Sdim	u_short hpp_id;		/* software revision and other fields */
70239462Sdim	caddr_t hpp_mem_start;	/* Memory-mapped IO register address */
71239462Sdim
72239462Sdim	caddr_t mem_start;	/* NIC memory start address */
73239462Sdim	caddr_t mem_end;	/* NIC memory end address */
74239462Sdim	u_long  mem_size;	/* total NIC memory size */
75239462Sdim	caddr_t mem_ring;	/* start of RX ring-buffer (in NIC mem) */
76239462Sdim
77239462Sdim	u_char  mem_shared;	/* NIC memory is shared with host */
78239462Sdim	u_char  xmit_busy;	/* transmitter is busy */
79239462Sdim	u_char  txb_cnt;	/* number of transmit buffers */
80239462Sdim	u_char  txb_inuse;	/* number of TX buffers currently in-use */
81239462Sdim
82239462Sdim	u_char  txb_new;	/* pointer to where new buffer will be added */
83239462Sdim	u_char  txb_next_tx;	/* pointer to next buffer ready to xmit */
84239462Sdim	u_short txb_len[8];	/* buffered xmit buffer lengths */
85239462Sdim	u_char  tx_page_start;	/* first page of TX buffer area */
86239462Sdim	u_char  rec_page_start;	/* first page of RX ring-buffer */
87239462Sdim	u_char  rec_page_stop;	/* last page of RX ring-buffer */
88239462Sdim	u_char  next_packet;	/* pointer to next unread RX packet */
89239462Sdim	struct	ifmib_iso_8802_3 mibdata; /* stuff for network mgmt */
90239462Sdim};
91239462Sdim
92239462Sdimvoid	ed_release_resources	__P((device_t));
93239462Sdimint	ed_alloc_port		__P((device_t, int, int));
94239462Sdimint	ed_alloc_memory		__P((device_t, int, int));
95239462Sdimint	ed_alloc_irq		__P((device_t, int, int));
96239462Sdim
97239462Sdimint	ed_probe_generic8390	__P((struct ed_softc *));
98239462Sdimint	ed_probe_WD80x3		__P((device_t));
99239462Sdimint	ed_probe_3Com		__P((device_t));
100239462Sdimint	ed_probe_Novell		__P((device_t));
101239462Sdimint	ed_probe_Novell_generic	__P((device_t, int, int));
102239462Sdimint	ed_probe_HP_pclanp	__P((device_t));
103239462Sdimint	ed_get_Linksys		__P((struct ed_softc *));
104239462Sdim
105239462Sdimint	ed_attach		__P((struct ed_softc *, int, int));
106239462Sdimvoid	ed_stop			__P((struct ed_softc *));
107239462Sdim
108239462Sdimdriver_intr_t	edintr;
109239462Sdim
110239462Sdim