FreeBSD/Linux Kernel Cross Reference
sys/dev/i2o/ioplvar.h
1 /* $NetBSD: ioplvar.h,v 1.3 2002/05/04 16:43:26 ad Exp $ */
2
3 /*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _I2O_IOPLVAR_H_
40 #define _I2O_IOPLVAR_H_
41
42 #define IOPL_TICK_HZ 3
43 #define IOPL_DESCRIPTORS 128
44 #define IOPL_MAX_SEGS 16
45 #define IOPL_MAX_BATCH 4
46 #define IOPL_MAX_MULTI 256
47 #define IOPL_BATCHING_ENABLED 1
48
49 struct iopl_media {
50 u_int ilm_i2o;
51 u_int ilm_ifmedia;
52 };
53
54 struct iopl_tx {
55 SLIST_ENTRY(iopl_tx) tx_chain;
56 struct mbuf *tx_mbuf;
57 bus_dmamap_t tx_dmamap;
58 int tx_ident;
59 };
60
61 struct iopl_rx {
62 SLIST_ENTRY(iopl_rx) rx_chain;
63 struct mbuf *rx_mbuf;
64 bus_dmamap_t rx_dmamap;
65 int rx_ident;
66 };
67
68 struct iopl_softc {
69 struct device sc_dv; /* Generic device info */
70 int sc_tid; /* Device TID */
71 int sc_flags; /* Control flags */
72 bus_dma_tag_t sc_dmat; /* DMA tag */
73
74 struct iop_initiator sc_ii_evt; /* Event initiator */
75 struct iop_initiator sc_ii_pg; /* PG retrieval initiator */
76 struct iop_initiator sc_ii_rx; /* Receive initiator */
77 struct iop_initiator sc_ii_tx; /* Transmit initiator */
78 struct iop_initiator sc_ii_null; /* Bit-bucket */
79
80 struct callout sc_pg_callout; /* PG retrieval callout */
81 int sc_ms_pg; /* Medium-specific PG # */
82 int sc_next_pg; /* Next PG to retrieve */
83 int sc_mtype; /* Medium type */
84 int sc_curmbps; /* Current link speed */
85 int sc_conntype; /* Connection type */
86
87 struct iopl_tx *sc_tx; /* Transmit descriptors */
88 SLIST_HEAD(,iopl_tx) sc_tx_free; /* Free TX descriptor list */
89 u_int sc_tx_freecnt; /* # of free TX descriptors */
90 u_int sc_tx_maxout; /* Max outstanding xmits */
91 u_int sc_tx_maxsegs; /* Max segments per xmit */
92 u_int sc_tx_maxreq; /* Max xmits per message */
93 u_int sc_tx_ohead; /* S/G list overhead */
94 u_int sc_tx_tcw; /* Transmit control word */
95
96 struct iopl_rx *sc_rx; /* Receive descriptors */
97 SLIST_HEAD(,iopl_rx) sc_rx_free; /* Free RX descriptor list */
98 u_int sc_rx_freecnt; /* # of free RX descriptors */
99 u_int sc_rx_maxbkt; /* Max receive buckets */
100 u_int sc_rx_prepad; /* Pre-padding for alignment */
101 u_int sc_rx_csumflgs; /* Checksum flags */
102
103 u_int sc_mcast_max; /* Maximum multicast addrs */
104 u_int sc_mcast_cnt; /* Active multicast addrs */
105
106 /* Pull dst address from a packet and insert into buffer context. */
107 void (*sc_munge)(struct mbuf *, u_int8_t *);
108
109 /*
110 * Interface info
111 */
112 union {
113 struct ifnet sci_if;
114 struct ethercom sci_ec;
115 } sc_if;
116
117 struct ifmedia sc_ifmedia; /* ifmedia linkage */
118
119 /*
120 * Parameter group buffers. We retrieve only one parameter group at
121 * a time.
122 */
123 struct {
124 struct i2o_param_op_results pr;
125 struct i2o_param_read_results prr;
126 union {
127 struct i2o_param_lan_stats ls;
128 struct i2o_param_lan_802_3_stats les;
129 struct i2o_param_lan_fddi_stats lfs;
130 struct i2o_param_lan_media_operation lmo;
131 } p;
132 } __attribute__ ((__packed__)) sc_pb;
133 };
134 #define IOPL_MEDIA_CHANGE 0x01
135 #define IOPL_LINK 0x02
136 #define IOPL_FDX 0x04
137 #define IOPL_INITTED 0x08
138
139 #endif /* !_I2O_IOPLVAR_H_ */
Cache object: 98ddcea44cbf401cc5255ae340c20676
|