if_vxvar.h revision 139749
1139749Simp/*-
2121491Simp * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved.
3121491Simp *
4121491Simp * Redistribution and use in source and binary forms, with or without
5121491Simp * modification, are permitted provided that the following conditions are
6121491Simp * met: 1. Redistributions of source code must retain the above copyright
7121491Simp * notice, this list of conditions and the following disclaimer. 2. The name
8121491Simp * of the author may not be used to endorse or promote products derived from
9121491Simp * this software without specific prior written permission
10121491Simp *
11121491Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
12121491Simp * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13121491Simp * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
14121491Simp * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15121491Simp * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
16121491Simp * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
17121491Simp * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
18121491Simp * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
19121491Simp * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
20121491Simp * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21121491Simp *
22121491Simp * $FreeBSD: head/sys/dev/vx/if_vxvar.h 139749 2005-01-06 01:43:34Z imp $
23121491Simp *
24121491Simp October 2, 1994
25121491Simp
26121491Simp Modified by: Andres Vega Garcia
27121491Simp
28121491Simp INRIA - Sophia Antipolis, France
29121491Simp e-mail: avega@sophia.inria.fr
30121491Simp finger: avega@pax.inria.fr
31121491Simp
32121491Simp */
33121491Simp
34121491Simp/*
35121491Simp * Ethernet software status per interface.
36121491Simp */
37121491Simpstruct vx_softc {
38133980Sgibbs	struct arpcom arpcom;		/* Ethernet common part		 */
39133980Sgibbs	int unit;			/* unit number                   */
40133980Sgibbs	bus_space_tag_t bst;
41133980Sgibbs	bus_space_handle_t bsh;
42133980Sgibbs	void *vx_intrhand;
43133980Sgibbs	struct resource *vx_irq;
44133980Sgibbs	struct resource *vx_res;
45133980Sgibbs#define MAX_MBS  8			/* # of mbufs we keep around	 */
46133980Sgibbs	struct mbuf *mb[MAX_MBS];	/* spare mbuf storage.		 */
47133980Sgibbs	int next_mb;			/* Which mbuf to use next. 	 */
48133980Sgibbs	int last_mb;			/* Last mbuf.			 */
49133980Sgibbs	char vx_connectors;		/* Connectors on this card.	 */
50133980Sgibbs	char vx_connector;		/* Connector to use.		 */
51133980Sgibbs	short tx_start_thresh;		/* Current TX_start_thresh.	 */
52133980Sgibbs	int tx_succ_ok;			/* # packets sent in sequence	 */
53133980Sgibbs					/* w/o underrun			 */
54133980Sgibbs	struct callout_handle ch;	/* Callout handle for timeouts  */
55133980Sgibbs	int buffill_pending;
56121491Simp};
57121491Simp
58121491Simp#define CSR_WRITE_4(sc, reg, val)	\
59121491Simp	bus_space_write_4(sc->bst, sc->bsh, reg, val)
60121491Simp#define CSR_WRITE_2(sc, reg, val)	\
61121491Simp	bus_space_write_2(sc->bst, sc->bsh, reg, val)
62121491Simp#define CSR_WRITE_1(sc, reg, val)	\
63121491Simp	bus_space_write_1(sc->bst, sc->bsh, reg, val)
64121491Simp
65121491Simp#define CSR_READ_4(sc, reg)		\
66121491Simp	bus_space_read_4(sc->bst, sc->bsh, reg)
67121491Simp#define CSR_READ_2(sc, reg)		\
68121491Simp	bus_space_read_2(sc->bst, sc->bsh, reg)
69121491Simp#define CSR_READ_1(sc, reg)		\
70121491Simp	bus_space_read_1(sc->bst, sc->bsh, reg)
71121491Simp
72121491Simpextern void vxfree(struct vx_softc *);
73121816Sbrooksextern int vxattach(device_t);
74121491Simpextern void vxstop(struct vx_softc *);
75121491Simpextern void vxintr(void *);
76121491Simpextern int vxbusyeeprom(struct vx_softc *);
77