if_epvar.h revision 51673
1283015Sdim/*
2283015Sdim * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved.
3283015Sdim *
4283015Sdim * Redistribution and use in source and binary forms, with or without
5283015Sdim * modification, are permitted provided that the following conditions are
6283015Sdim * met: 1. Redistributions of source code must retain the above copyright
7283015Sdim * notice, this list of conditions and the following disclaimer. 2. The name
8283015Sdim * of the author may not be used to endorse or promote products derived from
9283015Sdim * this software without specific prior written permission
10283015Sdim *
11283015Sdim * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
12283015Sdim * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13283015Sdim * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
14283015Sdim * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15283015Sdim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
16283015Sdim * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
17283015Sdim * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
18283015Sdim * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
19283015Sdim * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
20283015Sdim * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21283015Sdim *
22283015Sdim * $FreeBSD: head/sys/dev/ep/if_epvar.h 51673 1999-09-26 06:42:36Z mdodd $
23283015Sdim */
24283015Sdim
25283015Sdim/*
26283015Sdim * Ethernet software status per interface.
27283015Sdim */
28283015Sdimstruct ep_softc {
29283015Sdim	struct arpcom	arpcom;		/* Ethernet common part		 */
30283015Sdim	int		ep_io_addr;	/* i/o bus address		 */
31283015Sdim	struct mbuf *	top;
32283015Sdim	struct mbuf *	mcur;
33283015Sdim	short		cur_len;
34283015Sdim	u_short		ep_connectors;	/* Connectors on this card.	 */
35283015Sdim	u_char		ep_connector;	/* Configured connector.	 */
36283015Sdim	int		stat;		/* some flags */
37283015Sdim	int		gone;		/* adapter is not present (for PCCARD) */
38283015Sdim#define	F_RX_FIRST		0x1
39283015Sdim#define	F_PROMISC		0x8
40283015Sdim
41283015Sdim#define	F_ACCESS_32_BITS	0x100
42283015Sdim
43283015Sdim	struct ep_board *epb;
44283015Sdim
45283015Sdim	int		unit;
46283015Sdim
47283015Sdim#ifdef  EP_LOCAL_STATS
48283015Sdim	short		tx_underrun;
49283015Sdim	short		rx_no_first;
50283015Sdim	short		rx_no_mbuf;
51283015Sdim	short		rx_bpf_disc;
52283015Sdim	short		rx_overrunf;
53283015Sdim	short		rx_overrunl;
54283015Sdim#endif
55283015Sdim};
56283015Sdim
57283015Sdimstruct ep_board {
58283015Sdim	int		epb_addr;	/* address of this board */
59283015Sdim	char		epb_used;	/* was this entry already used for configuring ? */
60283015Sdim					/* data from EEPROM for later use */
61283015Sdim	u_short		eth_addr[3];	/* Ethernet address */
62283015Sdim	u_short		prod_id;	/* product ID */
63283015Sdim	int		cmd_off;	/* command offset (bit shift) */
64283015Sdim	int		mii_trans;	/* activate MII transiever */
65283015Sdim	u_short		res_cfg;	/* resource configuration */
66283015Sdim};
67283015Sdim
68283015Sdimextern struct ep_softc*	ep_softc[];
69283015Sdimextern struct ep_board	ep_board[];
70283015Sdimextern int		ep_boards;
71283015Sdimextern u_long		ep_unit;
72283015Sdim
73283015Sdimextern struct ep_softc*	ep_alloc	(int, struct ep_board *);
74283015Sdimextern int		ep_attach	(struct ep_softc *);
75283015Sdimextern void		ep_free		(struct ep_softc *);
76283015Sdimextern void		ep_intr		(void *);
77283015Sdim
78283015Sdimextern u_int16_t	get_e		(struct ep_softc *, int);
79283015Sdim