Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / rump / dev / wip / libusbrum / rum_at_usb.c
blobf634cf265b180aa9084fd2145ad1c1326c46e5aa
1 /* $NetBSD$ */
3 #include <sys/param.h>
4 #include <sys/types.h>
5 #include <sys/conf.h>
6 #include <sys/device.h>
7 #include <sys/kmem.h>
9 /*
10 * rum @ usb
12 * handwritten device configuration.... 'nuf said
15 static const struct cfiattrdata uroothub_iattrdata = {
16 "usbroothubif", 0, {
17 { NULL, NULL, 0 },
20 static const struct cfiattrdata *const usb_attrs[] = {
21 &uroothub_iattrdata,
22 NULL,
24 CFDRIVER_DECL(usb, DV_DULL, usb_attrs);
26 static const struct cfiattrdata usbdevif_iattrdata = {
27 "usbdevif", 0, {
28 { NULL, NULL, 0 },
31 static const struct cfiattrdata usbifif_iattrdata = {
32 "usbifif", 0, {
33 { NULL, NULL, 0 },
36 static const struct cfiattrdata *const uhub_attrs[] = {
37 &usbdevif_iattrdata,
38 &usbifif_iattrdata,
39 NULL,
41 CFDRIVER_DECL(uhub, DV_DULL, uhub_attrs);
43 CFDRIVER_DECL(rum, DV_IFNET, NULL);
45 struct cfparent rumpusbhc_pspec = {
46 "usbus",
47 "rumpusbhc",
48 DVUNIT_ANY
51 struct cfdata usb_cfdata[] = {
52 { "usb", "usb", 0, FSTATE_STAR, NULL, 0, &rumpusbhc_pspec },
55 struct cfparent usb_pspec = {
56 "usbroothubif",
57 "usb",
58 DVUNIT_ANY
61 struct cfdata uhub_cfdata[] = {
62 { "uhub", "uroothub", 0, FSTATE_STAR, NULL, 0, &usb_pspec },
65 struct cfparent usbifif_pspec = {
66 "usbifif",
67 "uhub",
68 DVUNIT_ANY
71 struct cfparent usbdevif_pspec = {
72 "usbdevif",
73 "uhub",
74 DVUNIT_ANY
77 struct cfdata rum_cfdata[] = {
78 { "rum", "rum", 0, FSTATE_STAR, NULL, 0, &usbdevif_pspec },
81 #include "rump_dev_private.h"
83 #define FLAWLESSCALL(call) \
84 do { \
85 int att_error; \
86 if ((att_error = call) != 0) \
87 panic("\"%s\" failed", #call); \
88 } while (/*CONSTCOND*/0)
90 void
91 rump_device_configuration(void)
93 extern struct cfattach usb_ca, uhub_ca, uroothub_ca, rum_ca;
95 FLAWLESSCALL(config_cfdriver_attach(&usb_cd));
96 FLAWLESSCALL(config_cfattach_attach("usb", &usb_ca));
97 FLAWLESSCALL(config_cfdata_attach(usb_cfdata, 0));
99 FLAWLESSCALL(config_cfdriver_attach(&uhub_cd));
100 FLAWLESSCALL(config_cfattach_attach("uhub", &uhub_ca));
101 FLAWLESSCALL(config_cfdata_attach(uhub_cfdata, 0));
103 FLAWLESSCALL(config_cfdriver_attach(&rum_cd));
104 FLAWLESSCALL(config_cfattach_attach("rum", &rum_ca));
105 FLAWLESSCALL(config_cfdata_attach(rum_cfdata, 0));
107 FLAWLESSCALL(config_cfattach_attach("uhub", &uroothub_ca));