mb86950var.h revision 1.1 1 1.1 jdolecek /* $NetBSD: mb86950var.h,v 1.1 2005/04/03 11:21:44 jdolecek Exp $ */
2 1.1 jdolecek
3 1.1 jdolecek /*
4 1.1 jdolecek * Copyright (c) 1995 Mika Kortelainen
5 1.1 jdolecek * All rights reserved.
6 1.1 jdolecek *
7 1.1 jdolecek * Redistribution and use in source and binary forms, with or without
8 1.1 jdolecek * modification, are permitted provided that the following conditions
9 1.1 jdolecek * are met:
10 1.1 jdolecek * 1. Redistributions of source code must retain the above copyright
11 1.1 jdolecek * notice, this list of conditions and the following disclaimer.
12 1.1 jdolecek * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 jdolecek * notice, this list of conditions and the following disclaimer in the
14 1.1 jdolecek * documentation and/or other materials provided with the distribution.
15 1.1 jdolecek * 3. All advertising materials mentioning features or use of this software
16 1.1 jdolecek * must display the following acknowledgement:
17 1.1 jdolecek * This product includes software developed by Mika Kortelainen
18 1.1 jdolecek * 4. The name of the author may not be used to endorse or promote products
19 1.1 jdolecek * derived from this software without specific prior written permission
20 1.1 jdolecek *
21 1.1 jdolecek * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 1.1 jdolecek * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 1.1 jdolecek * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 1.1 jdolecek * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.1 jdolecek * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 1.1 jdolecek * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 1.1 jdolecek * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 1.1 jdolecek * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 1.1 jdolecek * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 1.1 jdolecek * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 1.1 jdolecek */
32 1.1 jdolecek
33 1.1 jdolecek /*
34 1.1 jdolecek * Adapted from if_qnreg.h for the amiga port of NetBSD by Dave J. Barnes, 2004.
35 1.1 jdolecek */
36 1.1 jdolecek
37 1.1 jdolecek /*
38 1.1 jdolecek * EStar_softc: per line info and status
39 1.1 jdolecek */
40 1.1 jdolecek struct mb86950_softc {
41 1.1 jdolecek struct device sc_dev;
42 1.1 jdolecek struct ethercom sc_ec; /* ethernet common */
43 1.1 jdolecek struct ifmedia sc_media; /* supported media information */
44 1.1 jdolecek
45 1.1 jdolecek bus_space_tag_t sc_bst; /* bus space */
46 1.1 jdolecek bus_space_handle_t sc_bsh;
47 1.1 jdolecek
48 1.1 jdolecek /* Transmission buffer management. */
49 1.1 jdolecek /* XXX not used */
50 1.1 jdolecek int txb_free; /* free TX buffers */
51 1.1 jdolecek int txb_size; /* total size of TX buffer */
52 1.1 jdolecek int txb_count; /* number of TX buffers in use */
53 1.1 jdolecek int txb_sched; /* number of scheduled packets */
54 1.1 jdolecek int rxb_size; /* size of receive buffer */
55 1.1 jdolecek /* XXX */
56 1.1 jdolecek int txb_num_pkt; /* max number of outstanding transmit packets allowed */
57 1.1 jdolecek int rxb_num_pkt; /* max number of packets that could be in receive buffer */
58 1.1 jdolecek
59 1.1 jdolecek u_int8_t sc_enaddr[ETHER_ADDR_LEN];
60 1.1 jdolecek
61 1.1 jdolecek #if NRND > 0
62 1.1 jdolecek rndsource_element_t rnd_source;
63 1.1 jdolecek #endif
64 1.1 jdolecek
65 1.1 jdolecek u_int32_t sc_stat; /* driver status */
66 1.1 jdolecek
67 1.1 jdolecek #define ESTAR_STAT_ENABLED 0x0001 /* power enabled on interface */
68 1.1 jdolecek #define ESTAR_STAT_ATTACHED 0x0002 /* attach has succeeded */
69 1.1 jdolecek
70 1.1 jdolecek int (*sc_enable) __P((struct mb86950_softc *));
71 1.1 jdolecek void (*sc_disable) __P((struct mb86950_softc *));
72 1.1 jdolecek
73 1.1 jdolecek int (*sc_mediachange) __P((struct mb86950_softc *));
74 1.1 jdolecek void (*sc_mediastatus) __P((struct mb86950_softc *,
75 1.1 jdolecek struct ifmediareq *));
76 1.1 jdolecek
77 1.1 jdolecek };
78 1.1 jdolecek
79 1.1 jdolecek /* Size (in bytes) of a "packet length" word in transmission buffer. */
80 1.1 jdolecek #define ESTAR_TXLEN_SIZE 2
81 1.1 jdolecek
82 1.1 jdolecek #define GOOD_PKT 0x20
83 1.1 jdolecek
84 1.1 jdolecek void mb86950_attach __P((struct mb86950_softc *, u_int8_t *));
85 1.1 jdolecek void mb86950_config __P((struct mb86950_softc *, int *, int, int));
86 1.1 jdolecek int mb86950_intr __P((void *));
87 1.1 jdolecek int mb86950_enable __P((struct mb86950_softc *));
88 1.1 jdolecek void mb86950_disable __P((struct mb86950_softc *));
89 1.1 jdolecek int mb86950_activate __P((struct device *, enum devact));
90 1.1 jdolecek int mb86950_detach __P((struct mb86950_softc *));
91