if_edvar.h revision 52247
1/*
2 * Copyright (c) 1995, David Greenman
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice unmodified, this list of conditions, and the following
10 *    disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 *    notice, this list of conditions and the following disclaimer in the
13 *    documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/dev/ed/if_edvar.h 52247 1999-10-15 03:12:48Z mdodd $
28 */
29
30/*
31 * ed_softc: per line info and status
32 */
33struct ed_softc {
34	struct arpcom arpcom;	/* ethernet common */
35
36	char   *type_str;	/* pointer to type string */
37	u_char  vendor;		/* interface vendor */
38	u_char  type;		/* interface type code */
39	u_char	gone;		/* HW missing, presumed having a good time */
40
41	int	port_rid;	/* resource id for port range */
42	int	port_used;	/* nonzero if ports used */
43	struct resource* port_res; /* resource for port range */
44	int	mem_rid;	/* resource id for memory range */
45	int	mem_used;	/* nonzero if memory used */
46	struct resource* mem_res; /* resource for memory range */
47	int	irq_rid;	/* resource id for irq */
48	struct resource* irq_res; /* resource for irq */
49	void*	irq_handle;	/* handle for irq handler */
50
51	u_short asic_addr;	/* ASIC I/O bus address */
52	u_short nic_addr;	/* NIC (DS8390) I/O bus address */
53
54/*
55 * The following 'proto' variable is part of a work-around for 8013EBT asics
56 *	being write-only. It's sort of a prototype/shadow of the real thing.
57 */
58	u_char  wd_laar_proto;
59	u_char	cr_proto;
60	u_char  isa16bit;	/* width of access to card 0=8 or 1=16 */
61	int     is790;		/* set by the probe code if the card is 790
62				 * based */
63
64/*
65 * HP PC LAN PLUS card support.
66 */
67
68	u_short	hpp_options;	/* flags controlling behaviour of the HP card */
69	u_short hpp_id;		/* software revision and other fields */
70	caddr_t hpp_mem_start;	/* Memory-mapped IO register address */
71
72	caddr_t mem_start;	/* NIC memory start address */
73	caddr_t mem_end;	/* NIC memory end address */
74	u_long  mem_size;	/* total NIC memory size */
75	caddr_t mem_ring;	/* start of RX ring-buffer (in NIC mem) */
76
77	u_char  mem_shared;	/* NIC memory is shared with host */
78	u_char  xmit_busy;	/* transmitter is busy */
79	u_char  txb_cnt;	/* number of transmit buffers */
80	u_char  txb_inuse;	/* number of TX buffers currently in-use */
81
82	u_char  txb_new;	/* pointer to where new buffer will be added */
83	u_char  txb_next_tx;	/* pointer to next buffer ready to xmit */
84	u_short txb_len[8];	/* buffered xmit buffer lengths */
85	u_char  tx_page_start;	/* first page of TX buffer area */
86	u_char  rec_page_start;	/* first page of RX ring-buffer */
87	u_char  rec_page_stop;	/* last page of RX ring-buffer */
88	u_char  next_packet;	/* pointer to next unread RX packet */
89	struct	ifmib_iso_8802_3 mibdata; /* stuff for network mgmt */
90};
91
92void	ed_release_resources	__P((device_t));
93int	ed_alloc_port		__P((device_t, int, int));
94int	ed_alloc_memory		__P((device_t, int, int));
95int	ed_alloc_irq		__P((device_t, int, int));
96
97int	ed_probe_generic8390	__P((struct ed_softc *));
98int	ed_probe_WD80x3		__P((device_t));
99int	ed_probe_3Com		__P((device_t));
100int	ed_probe_Novell		__P((device_t));
101int	ed_probe_Novell_generic	__P((device_t, int, int));
102int	ed_probe_HP_pclanp	__P((device_t));
103
104int	ed_attach		__P((struct ed_softc *, int, int));
105
106driver_intr_t	edintr;
107
108