1 /* $NetBSD: phantomas.c,v 1.6 2009/05/07 15:34:49 skrll Exp $ */
2 /* $OpenBSD: phantomas.c,v 1.1 2002/12/18 23:52:45 mickey Exp $ */
5 * Copyright (c) 2002 Michael Shalayeff
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
26 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGE.
30 #include <sys/param.h>
31 #include <sys/systm.h>
32 #include <sys/device.h>
34 #include <machine/iomod.h>
35 #include <machine/autoconf.h>
37 #include <hp700/dev/cpudevs.h>
39 struct phantomas_softc
{
43 int phantomasmatch(device_t
, cfdata_t
, void *);
44 void phantomasattach(device_t
, device_t
, void *);
45 static void phantomas_callback(device_t self
, struct confargs
*ca
);
47 CFATTACH_DECL_NEW(phantomas
, sizeof(struct phantomas_softc
),
48 phantomasmatch
, phantomasattach
, NULL
, NULL
);
51 phantomasmatch(device_t parent
, cfdata_t cfdata
, void *aux
)
53 struct confargs
*ca
= aux
;
55 if (ca
->ca_type
.iodc_type
!= HPPA_TYPE_BCPORT
||
56 ca
->ca_type
.iodc_sv_model
!= HPPA_BCPORT_PHANTOM
) {
63 phantomasattach(device_t parent
, device_t self
, void *aux
)
65 struct phantomas_softc
*sc
= device_private(self
);
66 struct confargs
*ca
= aux
, nca
;
71 nca
.ca_nmodules
= MAXMODBUS
;
74 pdc_scanbus(self
, &nca
, phantomas_callback
);
78 phantomas_callback(device_t self
, struct confargs
*ca
)
81 config_found_sm_loc(self
, "gedoens", NULL
, ca
, mbprint
, mbsubmatch
);