1 /* $NetBSD: ucom_at_usb.c,v 1.1 2009/12/20 15:43:13 pooka Exp $ */
6 #include <sys/device.h>
10 * MACHINE GENERATED: DO NOT EDIT
12 * ioconf.c, from "TESTI_ucom"
15 #include <sys/param.h>
17 #include <sys/device.h>
18 #include <sys/mount.h>
20 static const struct cfiattrdata gpibdevcf_iattrdata
= {
23 { "address", "-1", -1 },
26 static const struct cfiattrdata acpibuscf_iattrdata
= {
31 static const struct cfiattrdata caccf_iattrdata
= {
37 static const struct cfiattrdata spicf_iattrdata
= {
40 { "slave", "NULL", 0 },
43 static const struct cfiattrdata radiodevcf_iattrdata
= {
48 static const struct cfiattrdata mlxcf_iattrdata
= {
54 static const struct cfiattrdata ucombuscf_iattrdata
= {
57 { "portno", "-1", -1 },
60 static const struct cfiattrdata videobuscf_iattrdata
= {
65 static const struct cfiattrdata isabuscf_iattrdata
= {
70 static const struct cfiattrdata i2cbuscf_iattrdata
= {
75 static const struct cfiattrdata ata_hlcf_iattrdata
= {
78 { "drive", "-1", -1 },
81 static const struct cfiattrdata depcacf_iattrdata
= {
86 static const struct cfiattrdata ppbuscf_iattrdata
= {
91 static const struct cfiattrdata eisabuscf_iattrdata
= {
96 static const struct cfiattrdata atapicf_iattrdata
= {
101 static const struct cfiattrdata usbroothubifcf_iattrdata
= {
106 static const struct cfiattrdata altmemdevcf_iattrdata
= {
111 static const struct cfiattrdata tcbuscf_iattrdata
= {
116 static const struct cfiattrdata onewirebuscf_iattrdata
= {
121 static const struct cfiattrdata gpiocf_iattrdata
= {
124 { "offset", "-1", -1 },
128 static const struct cfiattrdata cbbuscf_iattrdata
= {
133 static const struct cfiattrdata gpiobuscf_iattrdata
= {
138 static const struct cfiattrdata drmcf_iattrdata
= {
143 static const struct cfiattrdata pckbportcf_iattrdata
= {
146 { "slot", "-1", -1 },
149 static const struct cfiattrdata irbuscf_iattrdata
= {
154 static const struct cfiattrdata aaccf_iattrdata
= {
157 { "unit", "-1", -1 },
160 static const struct cfiattrdata pcibuscf_iattrdata
= {
166 static const struct cfiattrdata usbififcf_iattrdata
= {
169 { "port", "-1", -1 },
170 { "configuration", "-1", -1 },
171 { "interface", "-1", -1 },
172 { "vendor", "-1", -1 },
173 { "product", "-1", -1 },
174 { "release", "-1", -1 },
177 static const struct cfiattrdata upccf_iattrdata
= {
180 { "offset", "-1", -1 },
183 static const struct cfiattrdata iiccf_iattrdata
= {
186 { "addr", "-1", -1 },
187 { "size", "-1", -1 },
190 static const struct cfiattrdata onewirecf_iattrdata
= {
195 static const struct cfiattrdata mcabuscf_iattrdata
= {
200 static const struct cfiattrdata wsdisplaydevcf_iattrdata
= {
203 { "kbdmux", "1", 1 },
206 static const struct cfiattrdata miicf_iattrdata
= {
212 static const struct cfiattrdata cpcbuscf_iattrdata
= {
215 { "addr", "NULL", 0 },
219 static const struct cfiattrdata parportcf_iattrdata
= {
224 static const struct cfiattrdata dbcoolcf_iattrdata
= {
229 static const struct cfiattrdata usbdevifcf_iattrdata
= {
232 { "port", "-1", -1 },
233 { "configuration", "-1", -1 },
234 { "interface", "-1", -1 },
235 { "vendor", "-1", -1 },
236 { "product", "-1", -1 },
237 { "release", "-1", -1 },
240 static const struct cfiattrdata wskbddevcf_iattrdata
= {
243 { "console", "-1", -1 },
247 static const struct cfiattrdata audiobuscf_iattrdata
= {
252 static const struct cfiattrdata btbuscf_iattrdata
= {
257 static const struct cfiattrdata midibuscf_iattrdata
= {
262 static const struct cfiattrdata vmebuscf_iattrdata
= {
267 static const struct cfiattrdata wsemuldisplaydevcf_iattrdata
= {
268 "wsemuldisplaydev", 2,
270 { "console", "-1", -1 },
271 { "kbdmux", "1", 1 },
274 static const struct cfiattrdata uhidbuscf_iattrdata
= {
277 { "reportid", "-1", -1 },
280 static const struct cfiattrdata icpcf_iattrdata
= {
283 { "unit", "-1", -1 },
286 static const struct cfiattrdata sdmmcbuscf_iattrdata
= {
291 static const struct cfiattrdata comcf_iattrdata
= {
296 static const struct cfiattrdata spiflashbuscf_iattrdata
= {
301 static const struct cfiattrdata fwbuscf_iattrdata
= {
306 static const struct cfiattrdata pcmciaslotcf_iattrdata
= {
311 static const struct cfiattrdata usbuscf_iattrdata
= {
316 static const struct cfiattrdata wsmousedevcf_iattrdata
= {
322 static const struct cfiattrdata scsicf_iattrdata
= {
325 { "channel", "-1", -1 },
328 static const struct cfiattrdata atacf_iattrdata
= {
331 { "channel", "-1", -1 },
334 static const struct cfiattrdata spibuscf_iattrdata
= {
339 static const struct cfiattrdata pcmciabuscf_iattrdata
= {
342 { "controller", "-1", -1 },
343 { "socket", "-1", -1 },
347 static const struct cfiattrdata
* const usb_attrs
[] = { &usbroothubifcf_iattrdata
, NULL
};
348 CFDRIVER_DECL(usb
, DV_DULL
, usb_attrs
);
350 static const struct cfiattrdata
* const uhub_attrs
[] = { &usbififcf_iattrdata
, &usbdevifcf_iattrdata
, NULL
};
351 CFDRIVER_DECL(uhub
, DV_DULL
, uhub_attrs
);
353 CFDRIVER_DECL(ucom
, DV_DULL
, NULL
);
355 static const struct cfiattrdata
* const uplcom_attrs
[] = { &ucombuscf_iattrdata
, NULL
};
356 CFDRIVER_DECL(uplcom
, DV_DULL
, uplcom_attrs
);
358 static const struct cfiattrdata
* const rumpusbhc_attrs
[] = { &usbuscf_iattrdata
, NULL
};
359 CFDRIVER_DECL(rumpusbhc
, DV_DULL
, rumpusbhc_attrs
);
363 extern struct cfattach usb_ca
;
364 extern struct cfattach uroothub_ca
;
365 extern struct cfattach ucom_ca
;
366 extern struct cfattach uplcom_ca
;
367 extern struct cfattach rumpusbhc_ca
;
370 static int loc
[7] = {
371 -1, -1, -1, -1, -1, -1, -1,
374 static const struct cfparent pspec1
= {
375 "usbus", "rumpusbhc", DVUNIT_ANY
377 static const struct cfparent pspec2
= {
378 "usbroothubif", "usb", DVUNIT_ANY
380 static const struct cfparent pspec3
= {
381 "usbdevif", "uhub", DVUNIT_ANY
383 static const struct cfparent pspec4
= {
384 "ucombus", "uplcom", DVUNIT_ANY
387 #define NORM FSTATE_NOTFOUND
388 #define STAR FSTATE_STAR
390 struct cfdata cfdata_ucom
[] = {
391 /* driver attachment unit state loc flags pspec */
392 /* 0: usb* at rumpusbhc? */
393 { "usb", "usb", 0, STAR
, loc
, 0, &pspec1
},
394 /* 1: uhub* at usb? */
395 { "uhub", "uroothub", 0, STAR
, loc
, 0, &pspec2
},
396 /* 2: ucom* at uplcom? portno -1 */
397 { "ucom", "ucom", 0, STAR
, loc
+ 6, 0, &pspec4
},
398 /* 3: uplcom* at uhub? port -1 configuration -1 interface -1 vendor -1 product -1 release -1 */
399 { "uplcom", "uplcom", 0, STAR
, loc
+ 0, 0, &pspec3
},
400 { NULL
, NULL
, 0, 0, NULL
, 0, NULL
}
403 #include <sys/stat.h>
405 #include "rump_dev_private.h"
406 #include "rump_vfs_private.h"
408 #define FLAWLESSCALL(call) \
411 if ((att_error = call) != 0) \
412 panic("\"%s\" failed", #call); \
413 } while (/*CONSTCOND*/0)
418 rump_device_configuration(void)
420 extern struct cfattach usb_ca
, uhub_ca
, uroothub_ca
, ucom_ca
, uplcom_ca
;
421 extern struct cdevsw ucom_cdevsw
;
422 devmajor_t cmaj
, bmaj
;
424 FLAWLESSCALL(config_cfdata_attach(cfdata_ucom
, 0));
426 FLAWLESSCALL(config_cfdriver_attach(&usb_cd
));
427 FLAWLESSCALL(config_cfattach_attach("usb", &usb_ca
));
429 FLAWLESSCALL(config_cfdriver_attach(&uhub_cd
));
430 FLAWLESSCALL(config_cfattach_attach("uhub", &uhub_ca
));
432 FLAWLESSCALL(config_cfdriver_attach(&uplcom_cd
));
433 FLAWLESSCALL(config_cfattach_attach("uplcom", &uplcom_ca
));
435 FLAWLESSCALL(config_cfdriver_attach(&ucom_cd
));
436 FLAWLESSCALL(config_cfattach_attach("ucom", &ucom_ca
));
438 FLAWLESSCALL(config_cfattach_attach("uhub", &uroothub_ca
));
441 FLAWLESSCALL(devsw_attach("ucom", NULL
, &bmaj
, &ucom_cdevsw
, &cmaj
));
443 FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR
, "/dev/ttyU", '0',
445 FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR
, "/dev/dtyU", '0',