Sync usage with man page.
[netbsd-mini2440.git] / sys / rump / dev / wip / libulpt / ulpt_at_usb.c
blob60c3220203e52079be6ce48d50dbc114340a7d98
1 /* $NetBSD$ */
3 /*
4 * MACHINE GENERATED: DO NOT EDIT
6 * ioconf.c, from "TESTI_ulpt"
7 */
9 #include <sys/param.h>
10 #include <sys/conf.h>
11 #include <sys/device.h>
12 #include <sys/mount.h>
13 #include <sys/stat.h>
15 static const struct cfiattrdata gpibdevcf_iattrdata = {
16 "gpibdev", 1,
18 { "address", "-1", -1 },
21 static const struct cfiattrdata acpibuscf_iattrdata = {
22 "acpibus", 0, {
23 { NULL, NULL, 0 },
26 static const struct cfiattrdata caccf_iattrdata = {
27 "cac", 1,
29 { "unit", "-1", -1 },
32 static const struct cfiattrdata spicf_iattrdata = {
33 "spi", 1,
35 { "slave", "NULL", 0 },
38 static const struct cfiattrdata radiodevcf_iattrdata = {
39 "radiodev", 0, {
40 { NULL, NULL, 0 },
43 static const struct cfiattrdata mlxcf_iattrdata = {
44 "mlx", 1,
46 { "unit", "-1", -1 },
49 static const struct cfiattrdata ucombuscf_iattrdata = {
50 "ucombus", 1,
52 { "portno", "-1", -1 },
55 static const struct cfiattrdata videobuscf_iattrdata = {
56 "videobus", 0, {
57 { NULL, NULL, 0 },
60 static const struct cfiattrdata isabuscf_iattrdata = {
61 "isabus", 0, {
62 { NULL, NULL, 0 },
65 static const struct cfiattrdata i2cbuscf_iattrdata = {
66 "i2cbus", 0, {
67 { NULL, NULL, 0 },
70 static const struct cfiattrdata ata_hlcf_iattrdata = {
71 "ata_hl", 1,
73 { "drive", "-1", -1 },
76 static const struct cfiattrdata depcacf_iattrdata = {
77 "depca", 0, {
78 { NULL, NULL, 0 },
81 static const struct cfiattrdata ppbuscf_iattrdata = {
82 "ppbus", 0, {
83 { NULL, NULL, 0 },
86 static const struct cfiattrdata eisabuscf_iattrdata = {
87 "eisabus", 0, {
88 { NULL, NULL, 0 },
91 static const struct cfiattrdata atapicf_iattrdata = {
92 "atapi", 0, {
93 { NULL, NULL, 0 },
96 static const struct cfiattrdata usbroothubifcf_iattrdata = {
97 "usbroothubif", 0, {
98 { NULL, NULL, 0 },
101 static const struct cfiattrdata altmemdevcf_iattrdata = {
102 "altmemdev", 0, {
103 { NULL, NULL, 0 },
106 static const struct cfiattrdata tcbuscf_iattrdata = {
107 "tcbus", 0, {
108 { NULL, NULL, 0 },
111 static const struct cfiattrdata onewirebuscf_iattrdata = {
112 "onewirebus", 0, {
113 { NULL, NULL, 0 },
116 static const struct cfiattrdata gpiocf_iattrdata = {
117 "gpio", 2,
119 { "offset", "-1", -1 },
120 { "mask", "0", 0 },
123 static const struct cfiattrdata cbbuscf_iattrdata = {
124 "cbbus", 0, {
125 { NULL, NULL, 0 },
128 static const struct cfiattrdata gpiobuscf_iattrdata = {
129 "gpiobus", 0, {
130 { NULL, NULL, 0 },
133 static const struct cfiattrdata drmcf_iattrdata = {
134 "drm", 0, {
135 { NULL, NULL, 0 },
138 static const struct cfiattrdata pckbportcf_iattrdata = {
139 "pckbport", 1,
141 { "slot", "-1", -1 },
144 static const struct cfiattrdata irbuscf_iattrdata = {
145 "irbus", 0, {
146 { NULL, NULL, 0 },
149 static const struct cfiattrdata aaccf_iattrdata = {
150 "aac", 1,
152 { "unit", "-1", -1 },
155 static const struct cfiattrdata pcibuscf_iattrdata = {
156 "pcibus", 1,
158 { "bus", "-1", -1 },
161 static const struct cfiattrdata usbififcf_iattrdata = {
162 "usbifif", 6,
164 { "port", "-1", -1 },
165 { "configuration", "-1", -1 },
166 { "interface", "-1", -1 },
167 { "vendor", "-1", -1 },
168 { "product", "-1", -1 },
169 { "release", "-1", -1 },
172 static const struct cfiattrdata upccf_iattrdata = {
173 "upc", 1,
175 { "offset", "-1", -1 },
178 static const struct cfiattrdata iiccf_iattrdata = {
179 "iic", 2,
181 { "addr", "-1", -1 },
182 { "size", "-1", -1 },
185 static const struct cfiattrdata onewirecf_iattrdata = {
186 "onewire", 0, {
187 { NULL, NULL, 0 },
190 static const struct cfiattrdata mcabuscf_iattrdata = {
191 "mcabus", 0, {
192 { NULL, NULL, 0 },
195 static const struct cfiattrdata wsdisplaydevcf_iattrdata = {
196 "wsdisplaydev", 1,
198 { "kbdmux", "1", 1 },
201 static const struct cfiattrdata miicf_iattrdata = {
202 "mii", 1,
204 { "phy", "-1", -1 },
207 static const struct cfiattrdata cpcbuscf_iattrdata = {
208 "cpcbus", 2,
210 { "addr", "NULL", 0 },
211 { "irq", "-1", -1 },
214 static const struct cfiattrdata parportcf_iattrdata = {
215 "parport", 0, {
216 { NULL, NULL, 0 },
219 static const struct cfiattrdata dbcoolcf_iattrdata = {
220 "dbcool", 0, {
221 { NULL, NULL, 0 },
224 static const struct cfiattrdata usbdevifcf_iattrdata = {
225 "usbdevif", 6,
227 { "port", "-1", -1 },
228 { "configuration", "-1", -1 },
229 { "interface", "-1", -1 },
230 { "vendor", "-1", -1 },
231 { "product", "-1", -1 },
232 { "release", "-1", -1 },
235 static const struct cfiattrdata wskbddevcf_iattrdata = {
236 "wskbddev", 2,
238 { "console", "-1", -1 },
239 { "mux", "1", 1 },
242 static const struct cfiattrdata audiobuscf_iattrdata = {
243 "audiobus", 0, {
244 { NULL, NULL, 0 },
247 static const struct cfiattrdata btbuscf_iattrdata = {
248 "btbus", 0, {
249 { NULL, NULL, 0 },
252 static const struct cfiattrdata midibuscf_iattrdata = {
253 "midibus", 0, {
254 { NULL, NULL, 0 },
257 static const struct cfiattrdata vmebuscf_iattrdata = {
258 "vmebus", 0, {
259 { NULL, NULL, 0 },
262 static const struct cfiattrdata wsemuldisplaydevcf_iattrdata = {
263 "wsemuldisplaydev", 2,
265 { "console", "-1", -1 },
266 { "kbdmux", "1", 1 },
269 static const struct cfiattrdata uhidbuscf_iattrdata = {
270 "uhidbus", 1,
272 { "reportid", "-1", -1 },
275 static const struct cfiattrdata icpcf_iattrdata = {
276 "icp", 1,
278 { "unit", "-1", -1 },
281 static const struct cfiattrdata sdmmcbuscf_iattrdata = {
282 "sdmmcbus", 0, {
283 { NULL, NULL, 0 },
286 static const struct cfiattrdata comcf_iattrdata = {
287 "com", 0, {
288 { NULL, NULL, 0 },
291 static const struct cfiattrdata spiflashbuscf_iattrdata = {
292 "spiflashbus", 0, {
293 { NULL, NULL, 0 },
296 static const struct cfiattrdata fwbuscf_iattrdata = {
297 "fwbus", 0, {
298 { NULL, NULL, 0 },
301 static const struct cfiattrdata pcmciaslotcf_iattrdata = {
302 "pcmciaslot", 0, {
303 { NULL, NULL, 0 },
306 static const struct cfiattrdata usbuscf_iattrdata = {
307 "usbus", 0, {
308 { NULL, NULL, 0 },
311 static const struct cfiattrdata wsmousedevcf_iattrdata = {
312 "wsmousedev", 1,
314 { "mux", "0", 0 },
317 static const struct cfiattrdata scsicf_iattrdata = {
318 "scsi", 1,
320 { "channel", "-1", -1 },
323 static const struct cfiattrdata atacf_iattrdata = {
324 "ata", 1,
326 { "channel", "-1", -1 },
329 static const struct cfiattrdata spibuscf_iattrdata = {
330 "spibus", 0, {
331 { NULL, NULL, 0 },
334 static const struct cfiattrdata pcmciabuscf_iattrdata = {
335 "pcmciabus", 2,
337 { "controller", "-1", -1 },
338 { "socket", "-1", -1 },
342 static const struct cfiattrdata * const usb_attrs[] = { &usbroothubifcf_iattrdata, NULL };
343 CFDRIVER_DECL(usb, DV_DULL, usb_attrs);
345 static const struct cfiattrdata * const uhub_attrs[] = { &usbififcf_iattrdata, &usbdevifcf_iattrdata, NULL };
346 CFDRIVER_DECL(uhub, DV_DULL, uhub_attrs);
348 CFDRIVER_DECL(ulpt, DV_DULL, NULL);
350 static const struct cfiattrdata * const rumpusbhc_attrs[] = { &usbuscf_iattrdata, NULL };
351 CFDRIVER_DECL(rumpusbhc, DV_DULL, rumpusbhc_attrs);
355 extern struct cfattach usb_ca;
356 extern struct cfattach uroothub_ca;
357 extern struct cfattach ulpt_ca;
358 extern struct cfattach rumpusbhc_ca;
360 /* locators */
361 static int loc[6] = {
362 -1, -1, -1, -1, -1, -1,
365 static const struct cfparent pspec1 = {
366 "usbus", "rumpusbhc", DVUNIT_ANY
368 static const struct cfparent pspec2 = {
369 "usbroothubif", "usb", DVUNIT_ANY
371 static const struct cfparent pspec3 = {
372 "usbifif", "uhub", DVUNIT_ANY
375 #define NORM FSTATE_NOTFOUND
376 #define STAR FSTATE_STAR
378 struct cfdata cfdata_ulpt[] = {
379 /* driver attachment unit state loc flags pspec */
380 /* 0: usb* at rumpusbhc? */
381 { "usb", "usb", 0, STAR, loc, 0, &pspec1 },
382 /* 1: uhub* at usb? */
383 { "uhub", "uroothub", 0, STAR, loc, 0, &pspec2 },
384 /* 2: ulpt* at uhub? port -1 configuration -1 interface -1 vendor -1 product -1 release -1 */
385 { "ulpt", "ulpt", 0, STAR, loc+ 0, 0, &pspec3 },
386 { NULL, NULL, 0, 0, NULL, 0, NULL }
389 #include "rump_dev_private.h"
390 #include "rump_vfs_private.h"
392 #define FLAWLESSCALL(call) \
393 do { \
394 int att_error; \
395 if ((att_error = call) != 0) \
396 panic("\"%s\" failed", #call); \
397 } while (/*CONSTCOND*/0)
399 void
400 rump_device_configuration(void)
402 extern struct cfattach usb_ca, uhub_ca, uroothub_ca, ulpt_ca;
403 extern struct cdevsw ulpt_cdevsw;
404 devmajor_t bmaj, cmaj;
406 FLAWLESSCALL(config_cfdata_attach(cfdata_ulpt, 0));
408 FLAWLESSCALL(config_cfdriver_attach(&usb_cd));
409 FLAWLESSCALL(config_cfattach_attach("usb", &usb_ca));
411 FLAWLESSCALL(config_cfdriver_attach(&uhub_cd));
412 FLAWLESSCALL(config_cfattach_attach("uhub", &uhub_ca));
414 FLAWLESSCALL(config_cfdriver_attach(&ulpt_cd));
415 FLAWLESSCALL(config_cfattach_attach("ulpt", &ulpt_ca));
417 FLAWLESSCALL(config_cfattach_attach("uhub", &uroothub_ca));
419 bmaj = cmaj = -1;
420 FLAWLESSCALL(devsw_attach("ulpt", NULL, &bmaj, &ulpt_cdevsw, &cmaj));
422 FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR, "/dev/ulpt", '0',
423 cmaj, 0, 1));