Lines Matching refs:bus

39 #include <sys/bus.h>
52 static MALLOC_DEFINE(M_PPBUSDEV, "ppbusdev", "Parallel Port bus device");
62 ppbus_print_child(device_t bus, device_t dev)
67 retval = bus_print_child_header(bus, dev);
74 retval += bus_print_child_footer(bus, dev);
82 device_set_desc(dev, "Parallel port bus");
107 /* add the device as a child to the ppbus bus with the allocated
116 ppbus_read_ivar(device_t bus, device_t dev, int index, uintptr_t* val)
122 *val = (u_long)ppb_get_mode(bus);
132 ppbus_write_ivar(device_t bus, device_t dev, int index, uintptr_t val)
138 ppb_set_mode(bus, val);
207 ppb_pnp_detect(device_t bus)
214 device_printf(bus, "Probing for PnP devices:\n");
216 if ((error = ppb_1284_read_id(bus, PPB_NIBBLE, str,
221 device_printf(bus, "<PnP> %d characters: ", len);
233 device_printf(bus, "<%s",
236 device_printf(bus, "<unknown");
288 ppb_scan_bus(device_t bus)
290 struct ppb_data * ppb = (struct ppb_data *)device_get_softc(bus);
299 error = ppb_1284_negociate(bus, PPB_NIBBLE, PPB_REQUEST_ID);
304 ppb_1284_terminate(bus);
306 device_printf(bus, "IEEE1284 device found ");
308 if (!(error = ppb_1284_negociate(bus, PPB_NIBBLE, 0))) {
310 ppb_1284_terminate(bus);
313 if (!(error = ppb_1284_negociate(bus, PPB_PS2, 0))) {
315 ppb_1284_terminate(bus);
318 if (!(error = ppb_1284_negociate(bus, PPB_ECP, 0))) {
320 ppb_1284_terminate(bus);
323 if (!(error = ppb_1284_negociate(bus, PPB_ECP, PPB_USE_RLE))) {
325 ppb_1284_terminate(bus);
328 if (!(error = ppb_1284_negociate(bus, PPB_EPP, 0))) {
330 ppb_1284_terminate(bus);
335 if (!(error = ppb_1284_negociate(bus, PPB_NIBBLE,
338 ppb_1284_terminate(bus);
341 if (!(error = ppb_1284_negociate(bus, PPB_PS2,
344 ppb_1284_terminate(bus);
347 if (!(error = ppb_1284_negociate(bus, PPB_ECP,
350 ppb_1284_terminate(bus);
353 if (!(error = ppb_1284_negociate(bus, PPB_ECP,
356 ppb_1284_terminate(bus);
359 if (!(error = ppb_1284_negociate(bus, PPB_COMPATIBLE,
362 ppb_1284_terminate(bus);
369 ppb->class_id = ppb_pnp_detect(bus);
456 ppbus_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
460 struct ppb_data *ppb = DEVTOSOFTC(bus);
480 ppbus_teardown_intr(device_t bus, device_t child, struct resource *r, void *ih)
483 struct ppb_data *ppb = DEVTOSOFTC(bus);
505 ppb_request_bus(device_t bus, device_t dev, int how)
507 struct ppb_data *ppb = DEVTOSOFTC(bus);
539 ppb_set_mode(bus, ppbdev->ctx.mode);
554 ppb_release_bus(device_t bus, device_t dev)
556 struct ppb_data *ppb = DEVTOSOFTC(bus);
564 ppbdev->ctx.mode = ppb_get_mode(bus);
585 /* bus interface */