1 /* $NetBSD: sd_at_scsibus_at_umass.c,v 1.5 2009/12/19 11:55:23 pooka Exp $ */
4 * MACHINE GENERATED: DO NOT EDIT
6 * ioconf.c, from the following config:
11 include "dev/usb/files.usb"
12 include "dev/scsipi/files.scsipi"
15 attach mainbus at root
16 device rumpusbhc: usbus, usbroothub
17 attach rumpusbhc at mainbus
20 rumpusbhc* at mainbus0
30 umass* at uhub? port ? configuration ? interface ?
32 sd* at scsibus? target ? lun ?
37 #include <sys/param.h>
39 #include <sys/device.h>
40 #include <sys/mount.h>
42 static const struct cfiattrdata gpibdevcf_iattrdata
= {
45 { "address", "-1", -1 },
48 static const struct cfiattrdata acpibuscf_iattrdata
= {
53 static const struct cfiattrdata caccf_iattrdata
= {
59 static const struct cfiattrdata spicf_iattrdata
= {
62 { "slave", "NULL", 0 },
65 static const struct cfiattrdata radiodevcf_iattrdata
= {
70 static const struct cfiattrdata mlxcf_iattrdata
= {
76 static const struct cfiattrdata scsibuscf_iattrdata
= {
79 { "target", "-1", -1 },
83 static const struct cfiattrdata ucombuscf_iattrdata
= {
86 { "portno", "-1", -1 },
89 static const struct cfiattrdata videobuscf_iattrdata
= {
94 static const struct cfiattrdata isabuscf_iattrdata
= {
99 static const struct cfiattrdata i2cbuscf_iattrdata
= {
104 static const struct cfiattrdata ata_hlcf_iattrdata
= {
107 { "drive", "-1", -1 },
110 static const struct cfiattrdata depcacf_iattrdata
= {
115 static const struct cfiattrdata ppbuscf_iattrdata
= {
120 static const struct cfiattrdata eisabuscf_iattrdata
= {
125 static const struct cfiattrdata atapicf_iattrdata
= {
130 static const struct cfiattrdata atapibuscf_iattrdata
= {
133 { "drive", "-1", -1 },
136 static const struct cfiattrdata usbroothubifcf_iattrdata
= {
141 static const struct cfiattrdata altmemdevcf_iattrdata
= {
146 static const struct cfiattrdata tcbuscf_iattrdata
= {
151 static const struct cfiattrdata onewirebuscf_iattrdata
= {
156 static const struct cfiattrdata gpiocf_iattrdata
= {
159 { "offset", "-1", -1 },
163 static const struct cfiattrdata cbbuscf_iattrdata
= {
168 static const struct cfiattrdata gpiobuscf_iattrdata
= {
173 static const struct cfiattrdata drmcf_iattrdata
= {
178 static const struct cfiattrdata pckbportcf_iattrdata
= {
181 { "slot", "-1", -1 },
184 static const struct cfiattrdata irbuscf_iattrdata
= {
189 static const struct cfiattrdata aaccf_iattrdata
= {
192 { "unit", "-1", -1 },
195 static const struct cfiattrdata pcibuscf_iattrdata
= {
201 static const struct cfiattrdata usbififcf_iattrdata
= {
204 { "port", "-1", -1 },
205 { "configuration", "-1", -1 },
206 { "interface", "-1", -1 },
207 { "vendor", "-1", -1 },
208 { "product", "-1", -1 },
209 { "release", "-1", -1 },
212 static const struct cfiattrdata upccf_iattrdata
= {
215 { "offset", "-1", -1 },
218 static const struct cfiattrdata iiccf_iattrdata
= {
221 { "addr", "-1", -1 },
222 { "size", "-1", -1 },
225 static const struct cfiattrdata onewirecf_iattrdata
= {
230 static const struct cfiattrdata mcabuscf_iattrdata
= {
235 static const struct cfiattrdata wsdisplaydevcf_iattrdata
= {
238 { "kbdmux", "1", 1 },
241 static const struct cfiattrdata miicf_iattrdata
= {
247 static const struct cfiattrdata cpcbuscf_iattrdata
= {
250 { "addr", "NULL", 0 },
254 static const struct cfiattrdata parportcf_iattrdata
= {
259 static const struct cfiattrdata dbcoolcf_iattrdata
= {
264 static const struct cfiattrdata usbdevifcf_iattrdata
= {
267 { "port", "-1", -1 },
268 { "configuration", "-1", -1 },
269 { "interface", "-1", -1 },
270 { "vendor", "-1", -1 },
271 { "product", "-1", -1 },
272 { "release", "-1", -1 },
275 static const struct cfiattrdata wskbddevcf_iattrdata
= {
278 { "console", "-1", -1 },
282 static const struct cfiattrdata audiobuscf_iattrdata
= {
287 static const struct cfiattrdata btbuscf_iattrdata
= {
292 static const struct cfiattrdata midibuscf_iattrdata
= {
297 static const struct cfiattrdata vmebuscf_iattrdata
= {
302 static const struct cfiattrdata wsemuldisplaydevcf_iattrdata
= {
303 "wsemuldisplaydev", 2,
305 { "console", "-1", -1 },
306 { "kbdmux", "1", 1 },
309 static const struct cfiattrdata uhidbuscf_iattrdata
= {
312 { "reportid", "-1", -1 },
315 static const struct cfiattrdata icpcf_iattrdata
= {
318 { "unit", "-1", -1 },
321 static const struct cfiattrdata sdmmcbuscf_iattrdata
= {
326 static const struct cfiattrdata comcf_iattrdata
= {
331 static const struct cfiattrdata spiflashbuscf_iattrdata
= {
336 static const struct cfiattrdata fwbuscf_iattrdata
= {
341 static const struct cfiattrdata pcmciaslotcf_iattrdata
= {
346 static const struct cfiattrdata usbuscf_iattrdata
= {
351 static const struct cfiattrdata wsmousedevcf_iattrdata
= {
357 static const struct cfiattrdata scsicf_iattrdata
= {
360 { "channel", "-1", -1 },
363 static const struct cfiattrdata atacf_iattrdata
= {
366 { "channel", "-1", -1 },
369 static const struct cfiattrdata spibuscf_iattrdata
= {
374 static const struct cfiattrdata pcmciabuscf_iattrdata
= {
377 { "controller", "-1", -1 },
378 { "socket", "-1", -1 },
382 static const struct cfiattrdata
* const usb_attrs
[] = { &usbroothubifcf_iattrdata
, NULL
};
383 CFDRIVER_DECL(usb
, DV_DULL
, usb_attrs
);
385 static const struct cfiattrdata
* const uhub_attrs
[] = { &usbififcf_iattrdata
, &usbdevifcf_iattrdata
, NULL
};
386 CFDRIVER_DECL(uhub
, DV_DULL
, uhub_attrs
);
388 static const struct cfiattrdata
* const umass_attrs
[] = { &scsicf_iattrdata
, NULL
};
389 CFDRIVER_DECL(umass
, DV_DULL
, umass_attrs
);
391 static const struct cfiattrdata
* const scsibus_attrs
[] = { &scsibuscf_iattrdata
, NULL
};
392 CFDRIVER_DECL(scsibus
, DV_DULL
, scsibus_attrs
);
394 CFDRIVER_DECL(sd
, DV_DISK
, NULL
);
396 static const struct cfiattrdata
* const rumpusbhc_attrs
[] = { &usbuscf_iattrdata
, NULL
};
397 CFDRIVER_DECL(rumpusbhc
, DV_DULL
, rumpusbhc_attrs
);
401 extern struct cfattach usb_ca
;
402 extern struct cfattach uroothub_ca
;
403 extern struct cfattach uhub_ca
;
404 extern struct cfattach umass_ca
;
405 extern struct cfattach scsibus_ca
;
406 extern struct cfattach sd_ca
;
407 extern struct cfattach rumpusbhc_ca
;
410 static int loc
[15] = {
411 -1, -1, -1, -1, -1, -1, -1, -1,
412 -1, -1, -1, -1, -1, -1, -1,
415 static const struct cfparent pspec1
= {
416 "usbus", "rumpusbhc", DVUNIT_ANY
418 static const struct cfparent pspec2
= {
419 "usbroothubif", "usb", DVUNIT_ANY
421 static const struct cfparent pspec3
= {
422 "usbdevif", "uhub", DVUNIT_ANY
424 static const struct cfparent pspec4
= {
425 "usbifif", "uhub", DVUNIT_ANY
427 static const struct cfparent pspec5
= {
430 static const struct cfparent pspec6
= {
431 "scsibus", "scsibus", DVUNIT_ANY
434 #define NORM FSTATE_NOTFOUND
435 #define STAR FSTATE_STAR
437 struct cfdata cfdata_umass
[] = {
438 /* driver attachment unit state loc flags pspec */
439 /* 0: usb* at rumpusbhc? */
440 { "usb", "usb", 0, STAR
, loc
, 0, &pspec1
},
441 /* 1: uhub* at usb? */
442 { "uhub", "uroothub", 0, STAR
, loc
, 0, &pspec2
},
443 /* 2: uhub* at uhub? port -1 configuration -1 interface -1 vendor -1 product -1 release -1 */
444 { "uhub", "uhub", 0, STAR
, loc
, 0, &pspec3
},
445 /* 3: umass* at uhub? port -1 configuration -1 interface -1 vendor -1 product -1 release -1 */
446 { "umass", "umass", 0, STAR
, loc
+6, 0, &pspec4
},
447 /* 4: scsibus* at scsi? channel -1 */
448 { "scsibus", "scsibus", 0, STAR
, loc
+14, 0, &pspec5
},
449 /* 5: sd* at scsibus? target -1 lun -1 */
450 { "sd", "sd", 0, STAR
, loc
+12, 0, &pspec6
},
451 { NULL
, NULL
, 0, 0, NULL
, 0, NULL
}
454 /**** END AUTOGENERATED STUFF ****/
457 #include <sys/param.h>
458 #include <sys/conf.h>
459 #include <sys/device.h>
460 #include <sys/kmem.h>
461 #include <sys/stat.h>
463 #include "rump_dev_private.h"
464 #include "rump_vfs_private.h"
466 #define FLAWLESSCALL(call) \
469 if ((att_error = call) != 0) \
470 panic("\"%s\" failed", #call); \
471 } while (/*CONSTCOND*/0)
474 rump_device_configuration(void)
476 extern struct cfattach usb_ca
, uhub_ca
, uroothub_ca
, umass_ca
;
477 extern struct cfattach scsibus_ca
, sd_ca
;
478 extern struct bdevsw sd_bdevsw
;
479 extern struct cdevsw sd_cdevsw
;
480 devmajor_t bmaj
, cmaj
;
482 FLAWLESSCALL(config_cfdata_attach(cfdata_umass
, 0));
484 FLAWLESSCALL(config_cfdriver_attach(&usb_cd
));
485 FLAWLESSCALL(config_cfattach_attach("usb", &usb_ca
));
487 FLAWLESSCALL(config_cfdriver_attach(&uhub_cd
));
488 FLAWLESSCALL(config_cfattach_attach("uhub", &uhub_ca
));
490 FLAWLESSCALL(config_cfdriver_attach(&umass_cd
));
491 FLAWLESSCALL(config_cfattach_attach("umass", &umass_ca
));
493 FLAWLESSCALL(config_cfdriver_attach(&scsibus_cd
));
494 FLAWLESSCALL(config_cfattach_attach("scsibus", &scsibus_ca
));
496 FLAWLESSCALL(config_cfdriver_attach(&sd_cd
));
497 FLAWLESSCALL(config_cfattach_attach("sd", &sd_ca
));
499 FLAWLESSCALL(config_cfattach_attach("uhub", &uroothub_ca
));
502 FLAWLESSCALL(devsw_attach("sd", &sd_bdevsw
, &bmaj
, &sd_cdevsw
, &cmaj
));
504 FLAWLESSCALL(rump_vfs_makedevnodes(S_IFBLK
, "/dev/sd0", 'a',
506 FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR
, "/dev/rsd0", 'a',