if_mbe_pcmcia.c revision 1.33 1 1.33 mycroft /* $NetBSD: if_mbe_pcmcia.c,v 1.33 2004/08/10 18:43:49 mycroft Exp $ */
2 1.1 enami
3 1.1 enami /*-
4 1.32 mycroft * Copyright (c) 1998, 2000, 2004 The NetBSD Foundation, Inc.
5 1.1 enami * All rights reserved.
6 1.1 enami *
7 1.1 enami * This code is derived from software contributed to The NetBSD Foundation
8 1.1 enami * by Enami Tsugutomo.
9 1.1 enami *
10 1.1 enami * Redistribution and use in source and binary forms, with or without
11 1.1 enami * modification, are permitted provided that the following conditions
12 1.1 enami * are met:
13 1.1 enami * 1. Redistributions of source code must retain the above copyright
14 1.1 enami * notice, this list of conditions and the following disclaimer.
15 1.1 enami * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 enami * notice, this list of conditions and the following disclaimer in the
17 1.1 enami * documentation and/or other materials provided with the distribution.
18 1.1 enami * 3. All advertising materials mentioning features or use of this software
19 1.1 enami * must display the following acknowledgement:
20 1.1 enami * This product includes software developed by the NetBSD
21 1.1 enami * Foundation, Inc. and its contributors.
22 1.1 enami * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 enami * contributors may be used to endorse or promote products derived
24 1.1 enami * from this software without specific prior written permission.
25 1.1 enami *
26 1.1 enami * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 enami * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 enami * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1 enami * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1 enami * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 enami * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 enami * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 enami * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 enami * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 enami * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 enami * POSSIBILITY OF SUCH DAMAGE.
37 1.1 enami */
38 1.21 lukem
39 1.21 lukem #include <sys/cdefs.h>
40 1.33 mycroft __KERNEL_RCSID(0, "$NetBSD: if_mbe_pcmcia.c,v 1.33 2004/08/10 18:43:49 mycroft Exp $");
41 1.1 enami
42 1.1 enami #include <sys/param.h>
43 1.1 enami #include <sys/systm.h>
44 1.1 enami #include <sys/device.h>
45 1.1 enami #include <sys/socket.h>
46 1.1 enami
47 1.1 enami #include <net/if.h>
48 1.1 enami #include <net/if_ether.h>
49 1.1 enami #include <net/if_media.h>
50 1.1 enami
51 1.1 enami #include <machine/intr.h>
52 1.1 enami #include <machine/bus.h>
53 1.1 enami
54 1.1 enami #include <dev/ic/mb86960reg.h>
55 1.1 enami #include <dev/ic/mb86960var.h>
56 1.1 enami
57 1.1 enami #include <dev/pcmcia/pcmciareg.h>
58 1.1 enami #include <dev/pcmcia/pcmciavar.h>
59 1.3 christos #include <dev/pcmcia/pcmciadevs.h>
60 1.1 enami
61 1.1 enami int mbe_pcmcia_match __P((struct device *, struct cfdata *, void *));
62 1.1 enami void mbe_pcmcia_attach __P((struct device *, struct device *, void *));
63 1.4 thorpej int mbe_pcmcia_detach __P((struct device *, int));
64 1.1 enami
65 1.1 enami struct mbe_pcmcia_softc {
66 1.1 enami struct mb86960_softc sc_mb86960; /* real "mb" softc */
67 1.1 enami
68 1.1 enami /* PCMCIA-specific goo. */
69 1.1 enami struct pcmcia_io_handle sc_pcioh; /* PCMCIA i/o space info */
70 1.1 enami int sc_io_window; /* our i/o window */
71 1.1 enami void *sc_ih; /* interrupt cookie */
72 1.1 enami struct pcmcia_function *sc_pf; /* our PCMCIA function */
73 1.1 enami };
74 1.1 enami
75 1.28 thorpej CFATTACH_DECL(mbe_pcmcia, sizeof(struct mbe_pcmcia_softc),
76 1.29 thorpej mbe_pcmcia_match, mbe_pcmcia_attach, mbe_pcmcia_detach, mb86960_activate);
77 1.1 enami
78 1.1 enami int mbe_pcmcia_enable __P((struct mb86960_softc *));
79 1.1 enami void mbe_pcmcia_disable __P((struct mb86960_softc *));
80 1.1 enami
81 1.1 enami struct mbe_pcmcia_get_enaddr_args {
82 1.1 enami u_int8_t enaddr[ETHER_ADDR_LEN];
83 1.18 is int maddr;
84 1.1 enami };
85 1.18 is int mbe_pcmcia_get_enaddr_from_cis __P((struct pcmcia_tuple *, void *));
86 1.18 is int mbe_pcmcia_get_enaddr_from_mem __P((struct mbe_pcmcia_softc *,
87 1.19 enami struct mbe_pcmcia_get_enaddr_args *));
88 1.25 ichiro int mbe_pcmcia_get_enaddr_from_io __P((struct mbe_pcmcia_softc *,
89 1.25 ichiro struct mbe_pcmcia_get_enaddr_args *));
90 1.1 enami
91 1.24 ichiro static const struct mbe_pcmcia_product {
92 1.32 mycroft struct pcmcia_product mpp_product;
93 1.24 ichiro u_int32_t mpp_ioalign; /* required alignment */
94 1.24 ichiro int mpp_enet_maddr;
95 1.32 mycroft int mpp_flags;
96 1.25 ichiro #define MBH10302 0x0001 /* FUJITSU MBH10302 */
97 1.7 thorpej } mbe_pcmcia_products[] = {
98 1.32 mycroft { { PCMCIA_VENDOR_TDK, PCMCIA_PRODUCT_TDK_LAK_CD021BX,
99 1.32 mycroft PCMCIA_CIS_TDK_LAK_CD021BX },
100 1.19 enami 0, -1 },
101 1.13 cgd
102 1.32 mycroft { { PCMCIA_VENDOR_TDK, PCMCIA_PRODUCT_TDK_LAK_CF010,
103 1.32 mycroft PCMCIA_CIS_TDK_LAK_CF010 },
104 1.19 enami 0, -1 },
105 1.19 enami
106 1.7 thorpej #if 0 /* XXX 86960-based? */
107 1.32 mycroft { { PCMCIA_VENDOR_TDK, PCMCIA_PRODUCT_TDK_LAK_DFL9610,
108 1.32 mycroft PCMCIA_CIS_TDK_DFL9610 },
109 1.25 ichiro 0, -1, MBH10302 /* XXX */ },
110 1.7 thorpej #endif
111 1.8 tron
112 1.32 mycroft { { PCMCIA_VENDOR_CONTEC, PCMCIA_PRODUCT_CONTEC_CNETPC,
113 1.32 mycroft PCMCIA_CIS_CONTEC_CNETPC },
114 1.18 is 0, -1 },
115 1.13 cgd
116 1.32 mycroft { { PCMCIA_VENDOR_FUJITSU, PCMCIA_PRODUCT_FUJITSU_LA501,
117 1.32 mycroft PCMCIA_CIS_FUJITSU_LA501 },
118 1.18 is 0x20, -1 },
119 1.13 cgd
120 1.32 mycroft { { PCMCIA_VENDOR_FUJITSU, PCMCIA_PRODUCT_FUJITSU_FMV_J181,
121 1.32 mycroft PCMCIA_CIS_FUJITSU_FMV_J181 },
122 1.25 ichiro 0x20, -1, MBH10302 },
123 1.25 ichiro
124 1.32 mycroft { { PCMCIA_VENDOR_FUJITSU, PCMCIA_PRODUCT_FUJITSU_FMV_J182,
125 1.32 mycroft PCMCIA_CIS_FUJITSU_FMV_J182 },
126 1.25 ichiro 0, 0xf2c },
127 1.25 ichiro
128 1.32 mycroft { { PCMCIA_VENDOR_FUJITSU, PCMCIA_PRODUCT_FUJITSU_FMV_J182A,
129 1.32 mycroft PCMCIA_CIS_FUJITSU_FMV_J182A },
130 1.25 ichiro 0, 0x1cc },
131 1.23 ichiro
132 1.32 mycroft { { PCMCIA_VENDOR_FUJITSU, PCMCIA_PRODUCT_FUJITSU_ITCFJ182A,
133 1.32 mycroft PCMCIA_CIS_FUJITSU_ITCFJ182A },
134 1.23 ichiro 0, 0x1cc },
135 1.18 is
136 1.32 mycroft { { PCMCIA_VENDOR_FUJITSU, PCMCIA_PRODUCT_FUJITSU_LA10S,
137 1.32 mycroft PCMCIA_CIS_FUJITSU_LA10S },
138 1.25 ichiro 0, -1 },
139 1.25 ichiro
140 1.32 mycroft { { PCMCIA_VENDOR_RATOC, PCMCIA_PRODUCT_RATOC_REX_R280,
141 1.32 mycroft PCMCIA_CIS_RATOC_REX_R280 },
142 1.18 is 0, 0x1fc },
143 1.7 thorpej };
144 1.32 mycroft static const size_t mbe_pcmcia_nproducts =
145 1.32 mycroft sizeof(mbe_pcmcia_products) / sizeof(mbe_pcmcia_products[0]);
146 1.24 ichiro
147 1.1 enami int
148 1.1 enami mbe_pcmcia_match(parent, match, aux)
149 1.1 enami struct device *parent;
150 1.1 enami struct cfdata *match;
151 1.1 enami void *aux;
152 1.1 enami {
153 1.1 enami struct pcmcia_attach_args *pa = aux;
154 1.1 enami
155 1.32 mycroft if (pcmcia_product_lookup(pa, mbe_pcmcia_products, mbe_pcmcia_nproducts,
156 1.32 mycroft sizeof(mbe_pcmcia_products[0]), NULL))
157 1.7 thorpej return (1);
158 1.1 enami return (0);
159 1.1 enami }
160 1.1 enami
161 1.1 enami void
162 1.1 enami mbe_pcmcia_attach(parent, self, aux)
163 1.1 enami struct device *parent, *self;
164 1.1 enami void *aux;
165 1.1 enami {
166 1.1 enami struct mbe_pcmcia_softc *psc = (struct mbe_pcmcia_softc *)self;
167 1.1 enami struct mb86960_softc *sc = &psc->sc_mb86960;
168 1.1 enami struct pcmcia_attach_args *pa = aux;
169 1.1 enami struct pcmcia_config_entry *cfe;
170 1.1 enami struct mbe_pcmcia_get_enaddr_args pgea;
171 1.7 thorpej const struct mbe_pcmcia_product *mpp;
172 1.10 enami int rv;
173 1.7 thorpej
174 1.32 mycroft mpp = pcmcia_product_lookup(pa, mbe_pcmcia_products,
175 1.32 mycroft mbe_pcmcia_nproducts, sizeof(mbe_pcmcia_products[0]), NULL);
176 1.32 mycroft if (!mpp)
177 1.7 thorpej panic("mbe_pcmcia_attach: impossible");
178 1.1 enami
179 1.1 enami psc->sc_pf = pa->pf;
180 1.26 lukem cfe = SIMPLEQ_FIRST(&pa->pf->cfe_head);
181 1.1 enami
182 1.1 enami /* Enable the card. */
183 1.1 enami pcmcia_function_init(pa->pf, cfe);
184 1.1 enami if (pcmcia_function_enable(pa->pf)) {
185 1.32 mycroft printf("%s: function enable failed\n", sc->sc_dev.dv_xname);
186 1.17 enami goto enable_failed;
187 1.1 enami }
188 1.1 enami
189 1.1 enami /* Allocate and map i/o space for the card. */
190 1.1 enami if (pcmcia_io_alloc(pa->pf, cfe->iospace[0].start,
191 1.7 thorpej cfe->iospace[0].length,
192 1.7 thorpej mpp->mpp_ioalign ? mpp->mpp_ioalign : cfe->iospace[0].length,
193 1.7 thorpej &psc->sc_pcioh)) {
194 1.32 mycroft printf("%s: can't allocate i/o space\n", sc->sc_dev.dv_xname);
195 1.14 enami goto ioalloc_failed;
196 1.1 enami }
197 1.1 enami
198 1.1 enami sc->sc_bst = psc->sc_pcioh.iot;
199 1.1 enami sc->sc_bsh = psc->sc_pcioh.ioh;
200 1.1 enami
201 1.1 enami sc->sc_enable = mbe_pcmcia_enable;
202 1.1 enami sc->sc_disable = mbe_pcmcia_disable;
203 1.1 enami
204 1.7 thorpej /*
205 1.7 thorpej * Don't bother checking flags; the back-end sets the chip
206 1.7 thorpej * into 16-bit mode.
207 1.7 thorpej */
208 1.31 mycroft if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_IO16, &psc->sc_pcioh,
209 1.31 mycroft &psc->sc_io_window)) {
210 1.32 mycroft printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
211 1.14 enami goto iomap_failed;
212 1.1 enami }
213 1.1 enami
214 1.25 ichiro /* Read station address from io/mem or CIS. */
215 1.19 enami if (mpp->mpp_enet_maddr >= 0) {
216 1.19 enami pgea.maddr = mpp->mpp_enet_maddr;
217 1.18 is if (mbe_pcmcia_get_enaddr_from_mem(psc, &pgea) != 0) {
218 1.18 is printf("%s: Couldn't get ethernet address "
219 1.19 enami "from mem\n", sc->sc_dev.dv_xname);
220 1.18 is goto no_enaddr;
221 1.18 is }
222 1.32 mycroft } else if ((mpp->mpp_flags & MBH10302) != 0) {
223 1.25 ichiro bus_space_write_1(sc->sc_bst, sc->sc_bsh, FE_MBH0 ,
224 1.25 ichiro FE_MBH0_MASK | FE_MBH0_INTR_ENABLE);
225 1.25 ichiro if (mbe_pcmcia_get_enaddr_from_io(psc, &pgea) != 0) {
226 1.25 ichiro printf("%s: Couldn't get ethernet address "
227 1.25 ichiro "from io\n", sc->sc_dev.dv_xname);
228 1.25 ichiro goto no_enaddr;
229 1.25 ichiro }
230 1.18 is } else {
231 1.19 enami rv = pcmcia_scan_cis(parent,
232 1.19 enami mbe_pcmcia_get_enaddr_from_cis, &pgea);
233 1.18 is if (rv == -1) {
234 1.18 is printf("%s: Couldn't read CIS to get ethernet "
235 1.19 enami "address\n", sc->sc_dev.dv_xname);
236 1.18 is goto no_enaddr;
237 1.18 is } else if (rv == 0) {
238 1.18 is printf("%s: Couldn't get ethernet address "
239 1.19 enami "from CIS\n", sc->sc_dev.dv_xname);
240 1.18 is goto no_enaddr;
241 1.18 is }
242 1.1 enami #ifdef DIAGNOSTIC
243 1.18 is if (rv != 1) {
244 1.18 is printf("%s: pcmcia_scan_cis returns %d\n",
245 1.19 enami sc->sc_dev.dv_xname, rv);
246 1.18 is panic("mbe_pcmcia_attach");
247 1.18 is }
248 1.18 is printf("%s: Ethernet address from CIS: %s\n",
249 1.19 enami sc->sc_dev.dv_xname, ether_sprintf(pgea.enaddr));
250 1.18 is #endif
251 1.10 enami }
252 1.1 enami
253 1.1 enami /* Perform generic initialization. */
254 1.32 mycroft if ((mpp->mpp_flags & MBH10302) != 0)
255 1.30 tsutsui sc->sc_flags |= FE_FLAGS_MB86960;
256 1.30 tsutsui
257 1.30 tsutsui mb86960_attach(sc, pgea.enaddr);
258 1.1 enami
259 1.1 enami mb86960_config(sc, NULL, 0, 0);
260 1.1 enami
261 1.1 enami pcmcia_function_disable(pa->pf);
262 1.14 enami return;
263 1.14 enami
264 1.14 enami no_enaddr:
265 1.14 enami /* Unmap our i/o window. */
266 1.14 enami pcmcia_io_unmap(psc->sc_pf, psc->sc_io_window);
267 1.14 enami
268 1.14 enami iomap_failed:
269 1.14 enami /* Free our i/o space. */
270 1.14 enami pcmcia_io_free(psc->sc_pf, &psc->sc_pcioh);
271 1.14 enami
272 1.14 enami ioalloc_failed:
273 1.14 enami pcmcia_function_disable(pa->pf);
274 1.17 enami
275 1.17 enami enable_failed:
276 1.17 enami psc->sc_io_window = -1;
277 1.4 thorpej }
278 1.4 thorpej
279 1.4 thorpej int
280 1.4 thorpej mbe_pcmcia_detach(self, flags)
281 1.4 thorpej struct device *self;
282 1.4 thorpej int flags;
283 1.4 thorpej {
284 1.5 thorpej struct mbe_pcmcia_softc *psc = (struct mbe_pcmcia_softc *)self;
285 1.12 enami int error;
286 1.12 enami
287 1.14 enami if (psc->sc_io_window == -1)
288 1.19 enami /* Nothing to detach. */
289 1.14 enami return (0);
290 1.14 enami
291 1.14 enami error = mb86960_detach(&psc->sc_mb86960);
292 1.12 enami if (error != 0)
293 1.12 enami return (error);
294 1.5 thorpej
295 1.5 thorpej /* Unmap our i/o window. */
296 1.5 thorpej pcmcia_io_unmap(psc->sc_pf, psc->sc_io_window);
297 1.5 thorpej
298 1.5 thorpej /* Free our i/o space. */
299 1.5 thorpej pcmcia_io_free(psc->sc_pf, &psc->sc_pcioh);
300 1.5 thorpej
301 1.4 thorpej return (0);
302 1.1 enami }
303 1.1 enami
304 1.1 enami int
305 1.1 enami mbe_pcmcia_enable(sc)
306 1.1 enami struct mb86960_softc *sc;
307 1.1 enami {
308 1.1 enami struct mbe_pcmcia_softc *psc = (struct mbe_pcmcia_softc *)sc;
309 1.1 enami
310 1.1 enami /* Establish the interrupt handler. */
311 1.1 enami psc->sc_ih = pcmcia_intr_establish(psc->sc_pf, IPL_NET, mb86960_intr,
312 1.1 enami sc);
313 1.1 enami if (psc->sc_ih == NULL) {
314 1.1 enami printf("%s: couldn't establish interrupt handler\n",
315 1.1 enami sc->sc_dev.dv_xname);
316 1.1 enami return (1);
317 1.1 enami }
318 1.1 enami
319 1.17 enami if (pcmcia_function_enable(psc->sc_pf)) {
320 1.17 enami pcmcia_intr_disestablish(psc->sc_pf, psc->sc_ih);
321 1.17 enami return (1);
322 1.17 enami }
323 1.16 enami
324 1.17 enami return (0);
325 1.1 enami }
326 1.1 enami
327 1.1 enami void
328 1.1 enami mbe_pcmcia_disable(sc)
329 1.1 enami struct mb86960_softc *sc;
330 1.1 enami {
331 1.1 enami struct mbe_pcmcia_softc *psc = (struct mbe_pcmcia_softc *)sc;
332 1.1 enami
333 1.1 enami pcmcia_function_disable(psc->sc_pf);
334 1.17 enami pcmcia_intr_disestablish(psc->sc_pf, psc->sc_ih);
335 1.1 enami }
336 1.1 enami
337 1.1 enami int
338 1.18 is mbe_pcmcia_get_enaddr_from_cis(tuple, arg)
339 1.1 enami struct pcmcia_tuple *tuple;
340 1.1 enami void *arg;
341 1.1 enami {
342 1.1 enami struct mbe_pcmcia_get_enaddr_args *p = arg;
343 1.1 enami int i;
344 1.1 enami
345 1.1 enami if (tuple->code == PCMCIA_CISTPL_FUNCE) {
346 1.1 enami if (tuple->length < 2) /* sub code and ether addr length */
347 1.1 enami return (0);
348 1.1 enami
349 1.1 enami if ((pcmcia_tuple_read_1(tuple, 0) !=
350 1.1 enami PCMCIA_TPLFE_TYPE_LAN_NID) ||
351 1.1 enami (pcmcia_tuple_read_1(tuple, 1) != ETHER_ADDR_LEN))
352 1.1 enami return (0);
353 1.1 enami
354 1.1 enami for (i = 0; i < ETHER_ADDR_LEN; i++)
355 1.1 enami p->enaddr[i] = pcmcia_tuple_read_1(tuple, i + 2);
356 1.1 enami return (1);
357 1.1 enami }
358 1.25 ichiro return (0);
359 1.25 ichiro }
360 1.25 ichiro
361 1.25 ichiro int
362 1.25 ichiro mbe_pcmcia_get_enaddr_from_io(psc, ea)
363 1.25 ichiro struct mbe_pcmcia_softc *psc;
364 1.25 ichiro struct mbe_pcmcia_get_enaddr_args *ea;
365 1.25 ichiro {
366 1.25 ichiro int i;
367 1.25 ichiro
368 1.25 ichiro for (i = 0; i < ETHER_ADDR_LEN; i++)
369 1.25 ichiro ea->enaddr[i] = bus_space_read_1(psc->sc_pcioh.iot,
370 1.25 ichiro psc->sc_pcioh.ioh, FE_MBH_ENADDR + i);
371 1.25 ichiro
372 1.25 ichiro if (ea->enaddr == NULL)
373 1.25 ichiro return (1);
374 1.18 is return (0);
375 1.18 is }
376 1.18 is
377 1.18 is int
378 1.18 is mbe_pcmcia_get_enaddr_from_mem(psc, ea)
379 1.18 is struct mbe_pcmcia_softc *psc;
380 1.18 is struct mbe_pcmcia_get_enaddr_args *ea;
381 1.18 is {
382 1.18 is struct mb86960_softc *sc = &psc->sc_mb86960;
383 1.18 is struct pcmcia_mem_handle pcmh;
384 1.22 soren bus_size_t offset;
385 1.20 enami int i, mwindow, rv = 1;
386 1.18 is
387 1.18 is if (ea->maddr < 0)
388 1.20 enami goto bad_memaddr;
389 1.18 is
390 1.18 is if (pcmcia_mem_alloc(psc->sc_pf, ETHER_ADDR_LEN * 2, &pcmh)) {
391 1.18 is printf("%s: can't alloc mem for enet addr\n",
392 1.19 enami sc->sc_dev.dv_xname);
393 1.20 enami goto memalloc_failed;
394 1.18 is }
395 1.18 is
396 1.18 is if (pcmcia_mem_map(psc->sc_pf, PCMCIA_MEM_ATTR, ea->maddr,
397 1.19 enami ETHER_ADDR_LEN * 2, &pcmh, &offset, &mwindow)) {
398 1.18 is printf("%s: can't map mem for enet addr\n",
399 1.19 enami sc->sc_dev.dv_xname);
400 1.20 enami goto memmap_failed;
401 1.18 is }
402 1.18 is
403 1.18 is for (i = 0; i < ETHER_ADDR_LEN; i++)
404 1.18 is ea->enaddr[i] = bus_space_read_1(pcmh.memt, pcmh.memh,
405 1.19 enami offset + (i * 2));
406 1.18 is
407 1.20 enami rv = 0;
408 1.18 is pcmcia_mem_unmap(psc->sc_pf, mwindow);
409 1.20 enami memmap_failed:
410 1.18 is pcmcia_mem_free(psc->sc_pf, &pcmh);
411 1.20 enami memalloc_failed:
412 1.20 enami bad_memaddr:
413 1.18 is
414 1.20 enami return (rv);
415 1.1 enami }
416