if_vxvar.h revision 133980
1/* 2 * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: 1. Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 2. The name 8 * of the author may not be used to endorse or promote products derived from 9 * this software without specific prior written permission 10 * 11 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 14 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 16 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 17 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 18 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 19 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 20 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21 * 22 * $FreeBSD: head/sys/dev/vx/if_vxvar.h 133980 2004-08-18 16:56:54Z gibbs $ 23 * 24 October 2, 1994 25 26 Modified by: Andres Vega Garcia 27 28 INRIA - Sophia Antipolis, France 29 e-mail: avega@sophia.inria.fr 30 finger: avega@pax.inria.fr 31 32 */ 33 34/* 35 * 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(device_t); 74extern void vxstop(struct vx_softc *); 75extern void vxintr(void *); 76extern int vxbusyeeprom(struct vx_softc *); 77