lance.c revision 1.1.2.2 1 1.1.2.2 yamt /* $NetBSD: lance.c,v 1.1.2.2 2013/01/23 00:05:54 yamt Exp $ */
2 1.1.2.2 yamt
3 1.1.2.2 yamt /*
4 1.1.2.2 yamt * Copyright (c) 2013 Izumi Tsutsui. All rights reserved.
5 1.1.2.2 yamt *
6 1.1.2.2 yamt * Redistribution and use in source and binary forms, with or without
7 1.1.2.2 yamt * modification, are permitted provided that the following conditions
8 1.1.2.2 yamt * are met:
9 1.1.2.2 yamt * 1. Redistributions of source code must retain the above copyright
10 1.1.2.2 yamt * notice, this list of conditions and the following disclaimer.
11 1.1.2.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
12 1.1.2.2 yamt * notice, this list of conditions and the following disclaimer in the
13 1.1.2.2 yamt * documentation and/or other materials provided with the distribution.
14 1.1.2.2 yamt *
15 1.1.2.2 yamt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 1.1.2.2 yamt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 1.1.2.2 yamt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 1.1.2.2 yamt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 1.1.2.2 yamt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 1.1.2.2 yamt * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 1.1.2.2 yamt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 1.1.2.2 yamt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 1.1.2.2 yamt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 1.1.2.2 yamt * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 1.1.2.2 yamt */
26 1.1.2.2 yamt /*-
27 1.1.2.2 yamt * Copyright (c) 2004 The NetBSD Foundation, Inc.
28 1.1.2.2 yamt * All rights reserved.
29 1.1.2.2 yamt *
30 1.1.2.2 yamt * This code is derived from software contributed to The NetBSD Foundation
31 1.1.2.2 yamt * by UCHIYAMA Yasushi.
32 1.1.2.2 yamt *
33 1.1.2.2 yamt * Redistribution and use in source and binary forms, with or without
34 1.1.2.2 yamt * modification, are permitted provided that the following conditions
35 1.1.2.2 yamt * are met:
36 1.1.2.2 yamt * 1. Redistributions of source code must retain the above copyright
37 1.1.2.2 yamt * notice, this list of conditions and the following disclaimer.
38 1.1.2.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
39 1.1.2.2 yamt * notice, this list of conditions and the following disclaimer in the
40 1.1.2.2 yamt * documentation and/or other materials provided with the distribution.
41 1.1.2.2 yamt *
42 1.1.2.2 yamt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
43 1.1.2.2 yamt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
44 1.1.2.2 yamt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
45 1.1.2.2 yamt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
46 1.1.2.2 yamt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
47 1.1.2.2 yamt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
48 1.1.2.2 yamt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
49 1.1.2.2 yamt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
50 1.1.2.2 yamt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51 1.1.2.2 yamt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
52 1.1.2.2 yamt * POSSIBILITY OF SUCH DAMAGE.
53 1.1.2.2 yamt */
54 1.1.2.2 yamt
55 1.1.2.2 yamt /*
56 1.1.2.2 yamt * LANCE driver for LUNA
57 1.1.2.2 yamt * based on sys/arch/ews4800mips/stand/common/lance.c
58 1.1.2.2 yamt */
59 1.1.2.2 yamt
60 1.1.2.2 yamt #include <lib/libsa/stand.h>
61 1.1.2.2 yamt #include <lib/libkern/libkern.h>
62 1.1.2.2 yamt
63 1.1.2.2 yamt #include <dev/ic/am7990reg.h>
64 1.1.2.2 yamt #include <dev/ic/lancereg.h>
65 1.1.2.2 yamt
66 1.1.2.2 yamt #include <luna68k/stand/boot/samachdep.h>
67 1.1.2.2 yamt #include <luna68k/stand/boot/lance.h>
68 1.1.2.2 yamt
69 1.1.2.2 yamt static void lance_setup(struct le_softc *);
70 1.1.2.2 yamt static bool lance_set_initblock(struct le_softc *);
71 1.1.2.2 yamt static bool lance_do_initialize(struct le_softc *);
72 1.1.2.2 yamt
73 1.1.2.2 yamt #define NLE 1 /* XXX for now */
74 1.1.2.2 yamt static struct le_softc lesc[NLE];
75 1.1.2.2 yamt
76 1.1.2.2 yamt void *
77 1.1.2.2 yamt lance_attach(int unit, void *reg, void *mem, uint8_t *eaddr)
78 1.1.2.2 yamt {
79 1.1.2.2 yamt struct le_softc *sc;
80 1.1.2.2 yamt
81 1.1.2.2 yamt if (unit >= NLE) {
82 1.1.2.2 yamt printf("%s: invalid unit number\n", __func__);
83 1.1.2.2 yamt return NULL;
84 1.1.2.2 yamt }
85 1.1.2.2 yamt sc = &lesc[unit];
86 1.1.2.2 yamt
87 1.1.2.2 yamt if (sc->sc_reg != NULL) {
88 1.1.2.2 yamt printf("%s: unit %d is already attached\n", __func__, unit);
89 1.1.2.2 yamt return NULL;
90 1.1.2.2 yamt }
91 1.1.2.2 yamt sc->sc_reg = reg;
92 1.1.2.2 yamt sc->sc_mem = mem;
93 1.1.2.2 yamt memcpy(sc->sc_enaddr, eaddr, 6);
94 1.1.2.2 yamt
95 1.1.2.2 yamt return sc;
96 1.1.2.2 yamt }
97 1.1.2.2 yamt
98 1.1.2.2 yamt void *
99 1.1.2.2 yamt lance_cookie(int unit)
100 1.1.2.2 yamt {
101 1.1.2.2 yamt struct le_softc *sc;
102 1.1.2.2 yamt
103 1.1.2.2 yamt if (unit >= NLE)
104 1.1.2.2 yamt return NULL;
105 1.1.2.2 yamt
106 1.1.2.2 yamt sc = &lesc[unit];
107 1.1.2.2 yamt
108 1.1.2.2 yamt if (sc->sc_reg == NULL)
109 1.1.2.2 yamt return NULL;
110 1.1.2.2 yamt
111 1.1.2.2 yamt return sc;
112 1.1.2.2 yamt }
113 1.1.2.2 yamt
114 1.1.2.2 yamt uint8_t *
115 1.1.2.2 yamt lance_eaddr(void *cookie)
116 1.1.2.2 yamt {
117 1.1.2.2 yamt struct le_softc *sc = cookie;
118 1.1.2.2 yamt
119 1.1.2.2 yamt if (sc == NULL || sc->sc_reg == NULL)
120 1.1.2.2 yamt return NULL;
121 1.1.2.2 yamt
122 1.1.2.2 yamt return sc->sc_enaddr;
123 1.1.2.2 yamt }
124 1.1.2.2 yamt
125 1.1.2.2 yamt bool
126 1.1.2.2 yamt lance_init(void *cookie)
127 1.1.2.2 yamt {
128 1.1.2.2 yamt struct le_softc *sc = cookie;
129 1.1.2.2 yamt
130 1.1.2.2 yamt lance_setup(sc);
131 1.1.2.2 yamt
132 1.1.2.2 yamt if (!lance_set_initblock(sc))
133 1.1.2.2 yamt return false;
134 1.1.2.2 yamt
135 1.1.2.2 yamt if (!lance_do_initialize(sc))
136 1.1.2.2 yamt return false;
137 1.1.2.2 yamt
138 1.1.2.2 yamt return true;
139 1.1.2.2 yamt }
140 1.1.2.2 yamt
141 1.1.2.2 yamt int
142 1.1.2.2 yamt lance_get(void *cookie, void *data, size_t maxlen)
143 1.1.2.2 yamt {
144 1.1.2.2 yamt struct le_softc *sc = cookie;
145 1.1.2.2 yamt struct lereg *lereg = sc->sc_reg;
146 1.1.2.2 yamt struct lemem *lemem = sc->sc_mem;
147 1.1.2.2 yamt struct lermd_v *rmd;
148 1.1.2.2 yamt uint16_t csr;
149 1.1.2.2 yamt int len = -1;
150 1.1.2.2 yamt
151 1.1.2.2 yamt lereg->ler_rap = LE_CSR0;
152 1.1.2.2 yamt if ((lereg->ler_rdp & LE_C0_RINT) != 0)
153 1.1.2.2 yamt lereg->ler_rdp = LE_C0_RINT;
154 1.1.2.2 yamt rmd = &lemem->lem_rmd[sc->sc_currmd];
155 1.1.2.2 yamt if ((rmd->rmd1_bits & LE_R1_OWN) != 0)
156 1.1.2.2 yamt return -1;
157 1.1.2.2 yamt
158 1.1.2.2 yamt csr = lereg->ler_rdp;
159 1.1.2.2 yamt #if 0
160 1.1.2.2 yamt if ((csr & LE_C0_ERR) != 0)
161 1.1.2.2 yamt printf("%s: RX poll error (CSR=0x%x)\n", __func__, csr);
162 1.1.2.2 yamt #endif
163 1.1.2.2 yamt if ((rmd->rmd1_bits & LE_R1_ERR) != 0) {
164 1.1.2.2 yamt printf("%s: RX error (rmd status=0x%x)\n", __func__,
165 1.1.2.2 yamt rmd->rmd1_bits);
166 1.1.2.2 yamt goto out;
167 1.1.2.2 yamt }
168 1.1.2.2 yamt
169 1.1.2.2 yamt len = rmd->rmd3;
170 1.1.2.2 yamt if (len < LEMINSIZE + 4 || len > LEMTU) {
171 1.1.2.2 yamt printf("%s: RX error (bad length %d)\n", __func__, len);
172 1.1.2.2 yamt goto out;
173 1.1.2.2 yamt }
174 1.1.2.2 yamt len -= 4;
175 1.1.2.2 yamt memcpy(data, (void *)lemem->lem_rbuf[sc->sc_currmd], min(len, maxlen));
176 1.1.2.2 yamt
177 1.1.2.2 yamt out:
178 1.1.2.2 yamt rmd->rmd2 = -LEMTU;
179 1.1.2.2 yamt rmd->rmd1_bits = LE_R1_OWN; /* return to LANCE */
180 1.1.2.2 yamt sc->sc_currmd = LE_NEXTRMD(sc->sc_currmd);
181 1.1.2.2 yamt
182 1.1.2.2 yamt return len;
183 1.1.2.2 yamt }
184 1.1.2.2 yamt
185 1.1.2.2 yamt bool
186 1.1.2.2 yamt lance_put(void *cookie, void *data, size_t len)
187 1.1.2.2 yamt {
188 1.1.2.2 yamt struct le_softc *sc = cookie;
189 1.1.2.2 yamt struct lereg *lereg = sc->sc_reg;
190 1.1.2.2 yamt struct lemem *lemem = sc->sc_mem;
191 1.1.2.2 yamt struct letmd_v *tmd;
192 1.1.2.2 yamt uint16_t stat;
193 1.1.2.2 yamt int timeout;
194 1.1.2.2 yamt
195 1.1.2.2 yamt lereg->ler_rap = LE_CSR0;
196 1.1.2.2 yamt stat = lereg->ler_rdp;
197 1.1.2.2 yamt lereg->ler_rdp =
198 1.1.2.2 yamt stat & (LE_C0_BABL | LE_C0_CERR | LE_C0_MISS | LE_C0_TINT);
199 1.1.2.2 yamt #if 0
200 1.1.2.2 yamt if (stat & (LE_C0_BABL | LE_C0_CERR | LE_C0_MISS | LE_C0_MERR))
201 1.1.2.2 yamt printf("%s: TX error before xmit csr0=0x%x\n",
202 1.1.2.2 yamt __func__, stat);
203 1.1.2.2 yamt #endif
204 1.1.2.2 yamt
205 1.1.2.2 yamt /* setup TX descriptor */
206 1.1.2.2 yamt tmd = &lemem->lem_tmd[sc->sc_curtmd];
207 1.1.2.2 yamt while (tmd->tmd1_bits & LE_T1_OWN)
208 1.1.2.2 yamt continue;
209 1.1.2.2 yamt tmd->tmd1_bits = LE_T1_STP | LE_T1_ENP;
210 1.1.2.2 yamt memcpy((void *)lemem->lem_tbuf[sc->sc_curtmd], data, len);
211 1.1.2.2 yamt tmd->tmd2 = -max(len, LEMINSIZE);
212 1.1.2.2 yamt tmd->tmd3 = 0;
213 1.1.2.2 yamt
214 1.1.2.2 yamt /* start TX */
215 1.1.2.2 yamt tmd->tmd1_bits |= LE_T1_OWN;
216 1.1.2.2 yamt lereg->ler_rap = LE_CSR0;
217 1.1.2.2 yamt lereg->ler_rdp = LE_C0_TDMD;
218 1.1.2.2 yamt
219 1.1.2.2 yamt /* check TX complete */
220 1.1.2.2 yamt timeout = 0;
221 1.1.2.2 yamt do {
222 1.1.2.2 yamt lereg->ler_rap = LE_CSR0;
223 1.1.2.2 yamt stat = lereg->ler_rdp;
224 1.1.2.2 yamt #if 0
225 1.1.2.2 yamt if (stat & LE_C0_ERR) {
226 1.1.2.2 yamt printf("%s: TX error (CSR0=%x)\n", __func__, stat);
227 1.1.2.2 yamt if (stat & LE_C0_CERR) {
228 1.1.2.2 yamt lereg->ler_rdp = LE_C0_CERR;
229 1.1.2.2 yamt }
230 1.1.2.2 yamt }
231 1.1.2.2 yamt #endif
232 1.1.2.2 yamt if (timeout++ > 1000) {
233 1.1.2.2 yamt printf("%s: TX timeout (CSR0=%x)\n", __func__, stat);
234 1.1.2.2 yamt return false;
235 1.1.2.2 yamt }
236 1.1.2.2 yamt } while ((stat & LE_C0_TINT) == 0);
237 1.1.2.2 yamt
238 1.1.2.2 yamt lereg->ler_rdp = LE_C0_TINT;
239 1.1.2.2 yamt
240 1.1.2.2 yamt sc->sc_curtmd = LE_NEXTTMD(sc->sc_curtmd);
241 1.1.2.2 yamt
242 1.1.2.2 yamt return true;
243 1.1.2.2 yamt }
244 1.1.2.2 yamt
245 1.1.2.2 yamt bool
246 1.1.2.2 yamt lance_end(void *cookie)
247 1.1.2.2 yamt {
248 1.1.2.2 yamt struct le_softc *sc = cookie;
249 1.1.2.2 yamt struct lereg *lereg = sc->sc_reg;
250 1.1.2.2 yamt
251 1.1.2.2 yamt lereg->ler_rap = LE_CSR0;
252 1.1.2.2 yamt lereg->ler_rdp = LE_C0_STOP;
253 1.1.2.2 yamt
254 1.1.2.2 yamt return true;
255 1.1.2.2 yamt }
256 1.1.2.2 yamt
257 1.1.2.2 yamt /* XXX */
258 1.1.2.2 yamt int
259 1.1.2.2 yamt lance_intr(void)
260 1.1.2.2 yamt {
261 1.1.2.2 yamt
262 1.1.2.2 yamt return 1;
263 1.1.2.2 yamt }
264 1.1.2.2 yamt
265 1.1.2.2 yamt static bool
266 1.1.2.2 yamt lance_set_initblock(struct le_softc *sc)
267 1.1.2.2 yamt {
268 1.1.2.2 yamt struct lereg *lereg = sc->sc_reg;
269 1.1.2.2 yamt uint32_t addr = (uint32_t)sc->sc_mem;
270 1.1.2.2 yamt
271 1.1.2.2 yamt lereg->ler_rap = LE_CSR0;
272 1.1.2.2 yamt lereg->ler_rdp = LE_C0_STOP; /* disable all external activity */
273 1.1.2.2 yamt DELAY(100);
274 1.1.2.2 yamt
275 1.1.2.2 yamt /* Set the correct byte swapping mode */
276 1.1.2.2 yamt lereg->ler_rap = LE_CSR3;
277 1.1.2.2 yamt lereg->ler_rdp = LE_C3_BSWP;
278 1.1.2.2 yamt
279 1.1.2.2 yamt /* Low address of init block */
280 1.1.2.2 yamt lereg->ler_rap = LE_CSR1;
281 1.1.2.2 yamt lereg->ler_rdp = addr & 0xfffe;
282 1.1.2.2 yamt
283 1.1.2.2 yamt /* High address of init block */
284 1.1.2.2 yamt lereg->ler_rap = LE_CSR2;
285 1.1.2.2 yamt lereg->ler_rdp = (addr >> 16) & 0x00ff;
286 1.1.2.2 yamt DELAY(100);
287 1.1.2.2 yamt
288 1.1.2.2 yamt return true;
289 1.1.2.2 yamt }
290 1.1.2.2 yamt
291 1.1.2.2 yamt static bool
292 1.1.2.2 yamt lance_do_initialize(struct le_softc *sc)
293 1.1.2.2 yamt {
294 1.1.2.2 yamt struct lereg *lereg = sc->sc_reg;
295 1.1.2.2 yamt uint16_t reg;
296 1.1.2.2 yamt int timeout;
297 1.1.2.2 yamt
298 1.1.2.2 yamt sc->sc_curtmd = 0;
299 1.1.2.2 yamt sc->sc_currmd = 0;
300 1.1.2.2 yamt
301 1.1.2.2 yamt /* Initialze LANCE */
302 1.1.2.2 yamt lereg->ler_rap = LE_CSR0;
303 1.1.2.2 yamt lereg->ler_rdp = LE_C0_INIT;
304 1.1.2.2 yamt
305 1.1.2.2 yamt /* Wait interrupt */
306 1.1.2.2 yamt timeout = 1000000;
307 1.1.2.2 yamt do {
308 1.1.2.2 yamt lereg->ler_rap = LE_CSR0;
309 1.1.2.2 yamt reg = lereg->ler_rdp;
310 1.1.2.2 yamt if (--timeout == 0) {
311 1.1.2.2 yamt printf("le: init timeout (CSR=0x%x)\n", reg);
312 1.1.2.2 yamt return false;
313 1.1.2.2 yamt }
314 1.1.2.2 yamt DELAY(1);
315 1.1.2.2 yamt } while ((reg & LE_C0_IDON) == 0);
316 1.1.2.2 yamt
317 1.1.2.2 yamt lereg->ler_rap = LE_CSR0;
318 1.1.2.2 yamt lereg->ler_rdp = LE_C0_STRT | LE_C0_IDON;
319 1.1.2.2 yamt
320 1.1.2.2 yamt return true;
321 1.1.2.2 yamt }
322 1.1.2.2 yamt
323 1.1.2.2 yamt static void
324 1.1.2.2 yamt lance_setup(struct le_softc *sc)
325 1.1.2.2 yamt {
326 1.1.2.2 yamt struct lereg *lereg = sc->sc_reg;
327 1.1.2.2 yamt struct lemem *lemem = sc->sc_mem;
328 1.1.2.2 yamt uint32_t addr;
329 1.1.2.2 yamt int i;
330 1.1.2.2 yamt
331 1.1.2.2 yamt /* make sure to stop LANCE chip before setup memory */
332 1.1.2.2 yamt lereg->ler_rap = LE_CSR0;
333 1.1.2.2 yamt lereg->ler_rdp = LE_C0_STOP;
334 1.1.2.2 yamt
335 1.1.2.2 yamt memset(lemem, 0, sizeof *lemem);
336 1.1.2.2 yamt
337 1.1.2.2 yamt /* Init block */
338 1.1.2.2 yamt lemem->lem_mode = LE_MODE_NORMAL;
339 1.1.2.2 yamt lemem->lem_padr[0] = (sc->sc_enaddr[1] << 8) | sc->sc_enaddr[0];
340 1.1.2.2 yamt lemem->lem_padr[1] = (sc->sc_enaddr[3] << 8) | sc->sc_enaddr[2];
341 1.1.2.2 yamt lemem->lem_padr[2] = (sc->sc_enaddr[5] << 8) | sc->sc_enaddr[4];
342 1.1.2.2 yamt /* Logical address filter */
343 1.1.2.2 yamt for (i = 0; i < 4; i++)
344 1.1.2.2 yamt lemem->lem_ladrf[i] = 0x0000;
345 1.1.2.2 yamt
346 1.1.2.2 yamt /* Location of Rx descriptor ring */
347 1.1.2.2 yamt addr = (uint32_t)lemem->lem_rmd;
348 1.1.2.2 yamt lemem->lem_rdra = addr & 0xffff;
349 1.1.2.2 yamt lemem->lem_rlen = LE_RLEN | ((addr >> 16) & 0xff);
350 1.1.2.2 yamt
351 1.1.2.2 yamt /* Location of Tx descriptor ring */
352 1.1.2.2 yamt addr = (uint32_t)lemem->lem_tmd;
353 1.1.2.2 yamt lemem->lem_tdra = addr & 0xffff;
354 1.1.2.2 yamt lemem->lem_tlen = LE_TLEN | ((addr >> 16) & 0xff);
355 1.1.2.2 yamt
356 1.1.2.2 yamt /* Rx descriptor */
357 1.1.2.2 yamt for (i = 0; i < LERBUF; i++) {
358 1.1.2.2 yamt addr = (uint32_t)lemem->lem_rbuf[i];
359 1.1.2.2 yamt lemem->lem_rmd[i].rmd0 = addr & 0xffff;
360 1.1.2.2 yamt lemem->lem_rmd[i].rmd1_hadr = (addr >> 16) & 0xff;
361 1.1.2.2 yamt lemem->lem_rmd[i].rmd1_bits = LE_R1_OWN;
362 1.1.2.2 yamt lemem->lem_rmd[i].rmd2 = LE_XMD2_ONES | -LEMTU;
363 1.1.2.2 yamt lemem->lem_rmd[i].rmd3 = 0;
364 1.1.2.2 yamt }
365 1.1.2.2 yamt
366 1.1.2.2 yamt /* Tx descriptor */
367 1.1.2.2 yamt for (i = 0; i < LETBUF; i++) {
368 1.1.2.2 yamt addr = (uint32_t)lemem->lem_tbuf[i];
369 1.1.2.2 yamt lemem->lem_tmd[i].tmd0 = addr & 0xffff;
370 1.1.2.2 yamt lemem->lem_tmd[i].tmd1_hadr = (addr >> 16) & 0xff;
371 1.1.2.2 yamt lemem->lem_tmd[i].tmd1_bits = 0;
372 1.1.2.2 yamt lemem->lem_tmd[i].tmd2 = LE_XMD2_ONES | 0;
373 1.1.2.2 yamt lemem->lem_tmd[i].tmd3 = 0;
374 1.1.2.2 yamt }
375 1.1.2.2 yamt }
376