Print this page
3373 gcc >= 4.5 concerns about offsetof()
Portions contributed by: Igor Pashev <pashev.igor@gmail.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/xen/io/xnf.h
+++ new/usr/src/uts/common/xen/io/xnf.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 #ifndef _SYS_XNF_H
28 28 #define _SYS_XNF_H
29 29
30 30 #ifdef __cplusplus
31 31 extern "C" {
32 32 #endif
33 33
34 -#define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGESIZE)
35 -#define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGESIZE)
34 +#define NET_TX_RING_SIZE __CONST_RING_SIZE(netif_tx, PAGESIZE)
35 +#define NET_RX_RING_SIZE __CONST_RING_SIZE(netif_rx, PAGESIZE)
36 36
37 37 #define XNF_MAXPKT 1500 /* MTU size */
38 38 #define XNF_FRAMESIZE 1514 /* frame size including MAC header */
39 39
40 40 /* DEBUG flags */
41 41 #define XNF_DEBUG_DDI 0x01
42 42 #define XNF_DEBUG_TRACE 0x02
43 43
44 44 /*
45 45 * Information about each receive buffer and any transmit look-aside
46 46 * buffers.
47 47 */
48 48 typedef struct xnf_buf {
49 49 frtn_t free_rtn;
50 50 struct xnf *xnfp;
51 51 ddi_dma_handle_t dma_handle;
52 52 caddr_t buf; /* DMA-able data buffer */
53 53 paddr_t buf_phys;
54 54 mfn_t buf_mfn;
55 55 size_t len;
56 56 struct xnf_buf *next; /* For linking into free list */
57 57 ddi_acc_handle_t acc_handle;
58 58 grant_ref_t grant_ref; /* grant table reference */
59 59 uint16_t id; /* buffer id */
60 60 unsigned int gen;
61 61 } xnf_buf_t;
62 62
63 63 /*
64 64 * Information about each transmit buffer.
65 65 */
66 66 typedef struct xnf_txbuf {
67 67 struct xnf_txbuf *tx_next;
68 68 mblk_t *tx_mp; /* mblk associated with packet */
69 69 netif_tx_request_t tx_txreq;
70 70 caddr_t tx_bufp;
71 71 ddi_dma_handle_t tx_dma_handle;
72 72 mfn_t tx_mfn;
73 73 xnf_buf_t *tx_bdesc; /* Look-aside buffer, if used. */
74 74 unsigned char tx_type;
75 75 int16_t tx_status;
76 76 RING_IDX tx_slot;
77 77
78 78 #define TX_DATA 1
79 79 #define TX_MCAST_REQ 2
80 80 #define TX_MCAST_RSP 3
81 81 } xnf_txbuf_t;
82 82
83 83 /*
84 84 * Information about each outstanding transmit operation.
85 85 */
86 86 typedef struct xnf_txid {
87 87 uint16_t id; /* Id of this transmit buffer. */
88 88 uint16_t next; /* Freelist of ids. */
89 89 xnf_txbuf_t *txbuf; /* Buffer details. */
90 90 } xnf_txid_t;
91 91
92 92 /*
93 93 * Per-instance data.
94 94 */
95 95 typedef struct xnf {
96 96 /* most interesting stuff first to assist debugging */
97 97 dev_info_t *xnf_devinfo;
98 98 mac_handle_t xnf_mh;
99 99 unsigned char xnf_mac_addr[ETHERADDRL];
100 100
101 101 unsigned int xnf_gen; /* Increments on resume. */
102 102
103 103 boolean_t xnf_connected;
104 104 boolean_t xnf_running;
105 105
106 106 boolean_t xnf_be_rx_copy;
107 107 boolean_t xnf_be_mcast_control;
108 108
109 109 uint64_t xnf_stat_interrupts;
110 110 uint64_t xnf_stat_unclaimed_interrupts;
111 111 uint64_t xnf_stat_norxbuf;
112 112 uint64_t xnf_stat_drop;
113 113 uint64_t xnf_stat_errrx;
114 114
115 115 uint64_t xnf_stat_tx_attempt;
116 116 uint64_t xnf_stat_tx_pullup;
117 117 uint64_t xnf_stat_tx_pagebndry;
118 118 uint64_t xnf_stat_tx_defer;
119 119 uint64_t xnf_stat_mac_rcv_error;
120 120 uint64_t xnf_stat_runt;
121 121
122 122 uint64_t xnf_stat_ipackets;
123 123 uint64_t xnf_stat_opackets;
124 124 uint64_t xnf_stat_rbytes;
125 125 uint64_t xnf_stat_obytes;
126 126
127 127 uint64_t xnf_stat_tx_cksum_deferred;
128 128 uint64_t xnf_stat_rx_cksum_no_need;
129 129
130 130 uint64_t xnf_stat_buf_allocated;
131 131 uint64_t xnf_stat_buf_outstanding;
132 132 uint64_t xnf_stat_gref_outstanding;
133 133 uint64_t xnf_stat_gref_failure;
134 134 uint64_t xnf_stat_gref_peak;
135 135 uint64_t xnf_stat_rx_allocb_fail;
136 136 uint64_t xnf_stat_rx_desballoc_fail;
137 137
138 138 kstat_t *xnf_kstat_aux;
139 139
140 140 ddi_iblock_cookie_t xnf_icookie;
141 141
142 142 netif_tx_front_ring_t xnf_tx_ring;
143 143 ddi_dma_handle_t xnf_tx_ring_dma_handle;
144 144 ddi_acc_handle_t xnf_tx_ring_dma_acchandle;
145 145 paddr_t xnf_tx_ring_phys_addr;
146 146 grant_ref_t xnf_tx_ring_ref;
147 147
148 148 xnf_txid_t xnf_tx_pkt_id[NET_TX_RING_SIZE];
149 149 uint16_t xnf_tx_pkt_id_head;
150 150 kmutex_t xnf_txlock;
151 151 kmutex_t xnf_schedlock;
152 152 boolean_t xnf_need_sched;
153 153 kcondvar_t xnf_cv_tx_slots;
154 154 kmem_cache_t *xnf_tx_buf_cache;
155 155
156 156 netif_rx_front_ring_t xnf_rx_ring;
157 157 ddi_dma_handle_t xnf_rx_ring_dma_handle;
158 158 ddi_acc_handle_t xnf_rx_ring_dma_acchandle;
159 159 paddr_t xnf_rx_ring_phys_addr;
160 160 grant_ref_t xnf_rx_ring_ref;
161 161
162 162 xnf_buf_t *xnf_rx_pkt_info[NET_RX_RING_SIZE];
163 163 kmutex_t xnf_rxlock;
164 164 mblk_t *xnf_rx_head;
165 165 mblk_t *xnf_rx_tail;
166 166 boolean_t xnf_rx_new_buffers_posted;
167 167 kmem_cache_t *xnf_buf_cache;
168 168
169 169 uint16_t xnf_evtchn;
170 170
171 171 kmutex_t xnf_gref_lock;
172 172 grant_ref_t xnf_gref_head;
173 173
174 174 kcondvar_t xnf_cv_state;
175 175 kcondvar_t xnf_cv_multicast;
176 176 uint_t xnf_pending_multicast;
177 177 } xnf_t;
178 178
179 179 #ifdef __cplusplus
180 180 }
181 181 #endif
182 182
183 183 #endif /* _SYS_XNF_H */
↓ open down ↓ |
138 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX