if_vxvar.h revision 121491
1208963Srdivacky/* 2208963Srdivacky * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. 3246259Sdim * 4246259Sdim * Redistribution and use in source and binary forms, with or without 5208963Srdivacky * modification, are permitted provided that the following conditions are 6208963Srdivacky * met: 1. Redistributions of source code must retain the above copyright 7208963Srdivacky * notice, this list of conditions and the following disclaimer. 2. The name 8210299Sed * of the author may not be used to endorse or promote products derived from 9210299Sed * this software without specific prior written permission 10210299Sed * 11210299Sed * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 12210299Sed * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 13210299Sed * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 14234353Sdim * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15210299Sed * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 16234353Sdim * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 17249423Sdim * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 18210299Sed * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 19210299Sed * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 20210299Sed * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21210299Sed * 22210299Sed * $FreeBSD: head/sys/dev/vx/if_vxvar.h 121491 2003-10-25 04:05:33Z imp $ 23210299Sed * 24210299Sed October 2, 1994 25210299Sed 26210299Sed Modified by: Andres Vega Garcia 27210299Sed 28210299Sed INRIA - Sophia Antipolis, France 29210299Sed e-mail: avega@sophia.inria.fr 30208963Srdivacky finger: avega@pax.inria.fr 31218893Sdim 32218893Sdim */ 33210299Sed 34208963Srdivacky/* 35208963Srdivacky * Ethernet software status per interface. 36 */ 37struct vx_softc { 38 struct arpcom arpcom; /* Ethernet common part */ 39 int unit; /* unit number */ 40 bus_space_tag_t bst; 41 bus_space_handle_t bsh; 42 void *vx_intrhand; 43 struct resource *vx_irq; 44 struct resource *vx_res; 45#define MAX_MBS 8 /* # of mbufs we keep around */ 46 struct mbuf *mb[MAX_MBS]; /* spare mbuf storage. */ 47 int next_mb; /* Which mbuf to use next. */ 48 int last_mb; /* Last mbuf. */ 49 char vx_connectors; /* Connectors on this card. */ 50 char vx_connector; /* Connector to use. */ 51 short tx_start_thresh; /* Current TX_start_thresh. */ 52 int tx_succ_ok; /* # packets sent in sequence */ 53 /* w/o underrun */ 54 struct callout_handle ch; /* Callout handle for timeouts */ 55 int buffill_pending; 56}; 57 58#define CSR_WRITE_4(sc, reg, val) \ 59 bus_space_write_4(sc->bst, sc->bsh, reg, val) 60#define CSR_WRITE_2(sc, reg, val) \ 61 bus_space_write_2(sc->bst, sc->bsh, reg, val) 62#define CSR_WRITE_1(sc, reg, val) \ 63 bus_space_write_1(sc->bst, sc->bsh, reg, val) 64 65#define CSR_READ_4(sc, reg) \ 66 bus_space_read_4(sc->bst, sc->bsh, reg) 67#define CSR_READ_2(sc, reg) \ 68 bus_space_read_2(sc->bst, sc->bsh, reg) 69#define CSR_READ_1(sc, reg) \ 70 bus_space_read_1(sc->bst, sc->bsh, reg) 71 72extern void vxfree(struct vx_softc *); 73extern int vxattach(struct vx_softc *); 74extern void vxstop(struct vx_softc *); 75extern void vxintr(void *); 76extern int vxbusyeeprom(struct vx_softc *); 77