Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / sys / dev / netif / ep / if_epvar.h
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: src/sys/dev/ep/if_epvar.h,v 1.4.2.1 2000/05/24 01:47:45 archie Exp $
23  * $DragonFly: src/sys/dev/netif/ep/if_epvar.h,v 1.2 2003/06/17 04:28:25 dillon Exp $
24  */
25
26 struct ep_board {
27         u_short         prod_id;        /* product ID */
28         int             cmd_off;        /* command offset (bit shift) */
29         int             mii_trans;      /* activate MII transiever */
30         u_short         res_cfg;        /* resource configuration */
31 };
32
33 /*
34  * Ethernet software status per interface.
35  */
36 struct ep_softc {
37         struct arpcom           arpcom;         /* Ethernet common part */
38         struct ifmedia          ifmedia;        /* media info           */
39
40         device_t                dev;
41
42         struct resource *       iobase;
43         struct resource *       irq;
44
45         bus_space_handle_t      ep_bhandle;
46         bus_space_tag_t         ep_btag;
47         void *                  ep_intrhand;
48
49         int                     ep_io_addr;     /* i/o bus address      */
50
51         u_short                 ep_connectors;  /* Connectors on this card. */
52         u_char                  ep_connector;   /* Configured connector.*/
53
54         struct mbuf *           top;
55         struct mbuf *           mcur;
56         short                   cur_len;
57
58         int                     stat;           /* some flags */
59 #define F_RX_FIRST              0x001
60 #define F_PROMISC               0x008
61 #define F_ACCESS_32_BITS        0x100
62
63         int                     gone;           /* adapter is not present (for PCCARD) */
64
65         struct ep_board         epb;
66
67         int                     unit;
68
69 #ifdef  EP_LOCAL_STATS
70         short           tx_underrun;
71         short           rx_no_first;
72         short           rx_no_mbuf;
73         short           rx_overrunf;
74         short           rx_overrunl;
75 #endif
76 };
77
78 int             ep_alloc        (device_t);
79 void            ep_free         (device_t);
80 void            ep_get_media    (struct ep_softc *);
81 int             ep_attach       (struct ep_softc *);
82 void            ep_intr         (void *);
83 u_int16_t       get_e           (struct ep_softc *, int);
84 void            ep_get_macaddr  (struct ep_softc *, u_char *);